From a0ea35da309df6c82ea91784f89e53cda0a153b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Sep 2005 12:09:35 +0200 Subject: [PATCH 1/4] BUG#12983 TRASH macro confliciting with TRASH in my_sys.h mysys/my_alloc.c: Rename TRASH to TRASH_MEM and use the TRASH macro from my_sys.h --- mysys/my_alloc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 5a78eb17c96..fd5a4908572 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -221,11 +221,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) #endif } -#ifdef SAFEMALLOC -#define TRASH(X) bfill(((char*)(X) + ((X)->size-(X)->left)), (X)->left, 0xa5) -#else -#define TRASH /* no-op */ -#endif +#define TRASH_MEM(X) TRASH(((char*)(X) + ((X)->size-(X)->left)), (X)->left) /* Mark all data in blocks free for reusage */ @@ -239,7 +235,7 @@ static inline void mark_blocks_free(MEM_ROOT* root) for (next= root->free; next; next= *(last= &next->next)) { next->left= next->size - ALIGN_SIZE(sizeof(USED_MEM)); - TRASH(next); + TRASH_MEM(next); } /* Combine the free and the used list */ @@ -249,7 +245,7 @@ static inline void mark_blocks_free(MEM_ROOT* root) for (; next; next= next->next) { next->left= next->size - ALIGN_SIZE(sizeof(USED_MEM)); - TRASH(next); + TRASH_MEM(next); } /* Now everything is set; Indicate that nothing is used anymore */ @@ -310,7 +306,7 @@ void free_root(MEM_ROOT *root, myf MyFlags) { root->free=root->pre_alloc; root->free->left=root->pre_alloc->size-ALIGN_SIZE(sizeof(USED_MEM)); - TRASH(root->pre_alloc); + TRASH_MEM(root->pre_alloc); root->free->next=0; } root->block_num= 4; From e93e346a244d06b0bdb91d8c83b4da46a2406ac9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Sep 2005 12:33:25 +0200 Subject: [PATCH 2/4] Remove extra ; mysql-test/t/openssl_1.test: Remove extra delimiter ; --- mysql-test/t/openssl_1.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 3698ab54ec1..3f398a91834 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -20,22 +20,22 @@ connect (con4,localhost,ssl_user4,,); connection con1; select * from t1; ---error 1044; +--error 1044 delete from t1; connection con2; select * from t1; ---error 1044; +--error 1044 delete from t1; connection con3; select * from t1; ---error 1044; +--error 1044 delete from t1; connection con4; select * from t1; ---error 1044; +--error 1044 delete from t1; connection default; From 8b1751e5c35bbde1af36a104f1cf7b3c2ab4e919 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Sep 2005 22:40:13 +0200 Subject: [PATCH 3/4] BUG#12984 mysqltest.test: different output from "exec NonExistsinfComamdn" mysql-test/r/mysqltest.result: Disable test for failing --exec and --system since output can't be piped to /dev/null on all platforms mysql-test/t/mysqltest.test: Disable test for failing --exec and --system since output can't be piped to /dev/null on all platforms Avoid "echo -e" by using a temporary .sql file for tests that require more than one line. --- mysql-test/r/mysqltest.result | 2 -- mysql-test/t/mysqltest.test | 30 ++++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 9175bdc7250..ae44233aab6 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -179,7 +179,6 @@ source database echo message echo message mysqltest: At line 1: Empty variable -mysqltest: At line 1: command "';' 2> /dev/null" failed mysqltest: At line 1: Missing argument in exec MySQL "MySQL" @@ -301,7 +300,6 @@ mysqltest: At line 1: First argument to dec must be a variable (start with $) mysqltest: At line 1: End of line junk detected: "1000" mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do! -mysqltest: At line 1: system command 'NonExistsinfComamdn 2> /dev/null' failed test test2 test3 diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 4c23f915503..04fed048674 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -358,8 +358,11 @@ select 3 from t1 ; # Missing delimiter # The comment will be "sucked into" the sleep command since # delimiter is missing until after "show status" +--system echo "sleep 4" > var/log/mysqltest.sql +--system echo "# A comment" >> var/log/mysqltest.sql +--system echo "show status;" >> var/log/mysqltest.sql --error 1 ---exec echo -e "sleep 4\n # A comment\nshow status;" | $MYSQL_TEST 2>&1 +--exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1 # # Extra delimiter @@ -423,8 +426,9 @@ echo ; # ---------------------------------------------------------------------------- # Illegal use of exec ---error 1 ---exec echo "--exec ';' 2> /dev/null" | $MYSQL_TEST 2>&1 +# Disabled, some shells prints the failed command regardless of pipes +#--error 1 +#--exec echo "--exec ';' 2> /dev/null" | $MYSQL_TEST 2>&1 --error 1 --exec echo "--exec " | $MYSQL_TEST 2>&1 @@ -671,8 +675,9 @@ system echo "hej" > /dev/null; --exec echo "system;" | $MYSQL_TEST 2>&1 --error 1 --exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1 ---error 1 ---exec echo "system NonExistsinfComamdn 2> /dev/null;" | $MYSQL_TEST 2>&1 +# Disabled, some shells prints the failed command regardless of pipes +#--error 1 +#--exec echo "system NonExistsinfComamdn 2> /dev/null;" | $MYSQL_TEST 2>&1 --disable_abort_on_error system NonExistsinfComamdn; @@ -722,12 +727,21 @@ while ($i) --exec echo "end;" | $MYSQL_TEST 2>&1 --error 1 --exec echo "{;" | $MYSQL_TEST 2>&1 + +--system echo "while (0)" > var/log/mysqltest.sql +--system echo "echo hej;" >> var/log/mysqltest.sql --error 1 ---exec echo -e "while (0)\necho hej;" | $MYSQL_TEST 2>&1 +--exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1 + +--system echo "while (0)" > var/log/mysqltest.sql +--system echo "{echo hej;" >> var/log/mysqltest.sql --error 1 ---exec echo -e "while (0)\n{echo hej;" | $MYSQL_TEST 2>&1 +--exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1 + +--system echo "while (0){" > var/log/mysqltest.sql +--system echo "echo hej;" >> var/log/mysqltest.sql --error 1 ---exec echo -e "while (0){\n echo hej;" | $MYSQL_TEST 2>&1 +--exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1 # ---------------------------------------------------------------------------- # Test error messages returned from comments starting with a command From 3ae91695de838aad59a01f7766ee1aa43470ea6f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Sep 2005 09:40:42 +0200 Subject: [PATCH 4/4] BUG#12959 mysqltest crashes if testcase passed with -x option - Update test cases mysql-test/t/mysqltest.test: Uncomment the mysqltest -x test. Can't get the output to end up in the result file. --- mysql-test/t/mysqltest.test | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 04fed048674..39c1e867f28 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -812,11 +812,11 @@ select "a" as col1, "c" as col2; # ---------------------------------------------------------------------------- # -x , use the file specified after -x as the test file ---exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc ---exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc ---exec $MYSQL_TEST --result_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc ---error 1 ---exec $MYSQL_TEST -x non_existing_file.inc +#--exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1 +#--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1 +#--exec $MYSQL_TEST --result_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1 +#--error 1 +#--exec $MYSQL_TEST -x non_existing_file.inc 2>&1 # ----------------------------------------------------------------------------