mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for BUG#5033 "When using temporary tables truncate does NOT reset the auto_increment counter"
(ok'd by CTO to fix it in 4.0). Fix to make mysql-test-run work with all Valgrind versions.
This commit is contained in:
@ -349,9 +349,11 @@ while test $# -gt 0; do
|
||||
VALGRIND=`which valgrind` # this will print an error if not found
|
||||
# Give good warning to the user and stop
|
||||
if [ -z "$VALGRIND" ] ; then
|
||||
$ECHO "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://developer.kde.org/~sewardj ."
|
||||
$ECHO "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://valgrind.kde.org ."
|
||||
exit 1
|
||||
fi
|
||||
# >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr
|
||||
valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && VALGRIND="$VALGRIND --tool=memcheck"
|
||||
VALGRIND="$VALGRIND --alignment=8 --leak-check=yes --num-callers=16"
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||
|
@ -31,4 +31,25 @@ SELECT * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
delete from t1;
|
||||
insert into t1 (a) values (NULL),(NULL);
|
||||
SELECT * from t1;
|
||||
a
|
||||
3
|
||||
4
|
||||
drop table t1;
|
||||
create temporary table t1 (a integer auto_increment primary key);
|
||||
insert into t1 (a) values (NULL),(NULL);
|
||||
truncate table t1;
|
||||
insert into t1 (a) values (NULL),(NULL);
|
||||
SELECT * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
delete from t1;
|
||||
insert into t1 (a) values (NULL),(NULL);
|
||||
SELECT * from t1;
|
||||
a
|
||||
3
|
||||
4
|
||||
drop table t1;
|
||||
|
@ -23,7 +23,7 @@ drop table t1;
|
||||
truncate non_existing_table;
|
||||
|
||||
#
|
||||
# test autoincrement with TRUNCATE
|
||||
# test autoincrement with TRUNCATE; verifying difference with DELETE
|
||||
#
|
||||
|
||||
create table t1 (a integer auto_increment primary key);
|
||||
@ -31,5 +31,19 @@ insert into t1 (a) values (NULL),(NULL);
|
||||
truncate table t1;
|
||||
insert into t1 (a) values (NULL),(NULL);
|
||||
SELECT * from t1;
|
||||
delete from t1;
|
||||
insert into t1 (a) values (NULL),(NULL);
|
||||
SELECT * from t1;
|
||||
drop table t1;
|
||||
|
||||
# Verifying that temp tables are handled the same way
|
||||
|
||||
create temporary table t1 (a integer auto_increment primary key);
|
||||
insert into t1 (a) values (NULL),(NULL);
|
||||
truncate table t1;
|
||||
insert into t1 (a) values (NULL),(NULL);
|
||||
SELECT * from t1;
|
||||
delete from t1;
|
||||
insert into t1 (a) values (NULL),(NULL);
|
||||
SELECT * from t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user