You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1144 lines
31 KiB

WL#1622 "SQL Syntax for Prepared Statements": Post-review fixes (1 of 2) mysql-test/r/ps.result: Added tests for PREPARE stmt1 FROM @var syntax mysql-test/t/ps.test: Added tests for PREPARE stmt1 FROM @var syntax mysys/my_error.c: Added support for "%.*s" format sql/item.cc: Removed one redundant Item_param::set_value function sql/item.h: Removed one redundant Item_param::set_value function sql/mysqld.cc: Reformmated the code sql/share/czech/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/dutch/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/english/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/estonian/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/french/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/german/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/greek/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/hungarian/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/italian/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/japanese/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/korean/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/norwegian-ny/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/norwegian/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/polish/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/portuguese/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/romanian/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/russian/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/slovak/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/spanish/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/swedish/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/share/ukrainian/errmsg.txt: Changed ER_UNKNOWN_STMT_HANDLER format string sql/sql_class.h: SQL Prepared statements now can't be used by binary protocol commands sql/sql_lex.h: Added support for PREPARE stmt1 FROM @var syntax. sql/sql_parse.cc: Added support for PREPARE stmt1 FROM @var syntax. sql/sql_prepare.cc: Code cleanup sql/sql_yacc.yy: Added support for PREPARE stmt1 FROM @var syntax.
22 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
22 years ago
Fix for bug#4912 "mysqld crashs in case a statement is executed a second time". The bug was caused by incompatibility of negations elimination algorithm and PS: during first statement execute a subtree with negation was replaced with equivalent subtree without NOTs. The problem was that although this transformation was permanent, items of the new subtree were created in execute-local memory. The patch adds means to check if it is the first execute of a prepared statement, and if this is the case, to allocate items in memory of the prepared statement. The implementation: - backports Item_arena from 5.0 - adds Item_arena::is_stmt_prepare(), Item_arena::is_first_stmt_execute(). - deletes THD::allocate_temporary_pool_for_ps_preparing(), THD::free_temporary_pool_for_ps_preparing(); they were redundant. and adds a few invariants: - thd->free_list never contains junk (= freed items) - thd->current_arena is never null. If there is no prepared statement, it points at the thd. The rest of the patch contains mainly mechanical changes and cleanups. mysql-test/r/ps.result: Test results updated (test case for Bug#4912) mysql-test/t/ps.test: A test case for Bug#4912 "mysqld crashs in case a statement is executed a second time" sql/item_cmpfunc.cc: current_statement -> current_arena sql/item_subselect.cc: Statement -> Item_arena, current_statement -> current_arena sql/item_subselect.h: Item_subselect does not need to save thd->current_statement. sql/item_sum.cc: Statement -> Item_arena sql/item_sum.h: Statement -> Item_arena sql/mysql_priv.h: Statement -> Item_arena sql/sql_base.cc: current_statement -> current_arena sql/sql_class.cc: - Item_arena - convenient set_n_backup_statement, restore_backup_statement (nice idea, Sanja) sql/sql_class.h: - Item_arena: backport from 5.0 - allocate_temporary_pool_for_ps_preparing, free_temporary_pool_for_ps_preparing removed. sql/sql_derived.cc: current_statement -> current_arena sql/sql_lex.cc: current_statement -> current_arena sql/sql_parse.cc: Deploy invariant that thd->free_list never contains junk items (backport from 5.0). sql/sql_prepare.cc: - backporting Item_arena - no need to allocate_temporary_pool_for_ps_preparing(). sql/sql_select.cc: Fix for bug#4912 "mysqld crashs in case a statement is executed a second time": if this is the first execute of a prepared statement, negation elimination is done in memory of the prepared statement. sql/sql_union.cc: Backporting Item_arena from 5.0.
22 years ago
Fix for Bug#5034 "prepared "select 1 into @arg15", second execute crashes server": we were deleting lex->result after each execute, but prepared statements assumed that it's left intact. The fix adds cleanup() method to select_result hierarchy, so that result objects can be reused. Plus we now need to delete result objects more wisely. mysql-test/r/ps.result: Test results fixed: test case for bug#5034 mysql-test/t/ps.test: A test case for bug#5034, few followups sql/sql_class.cc: - fix warning in THD::THD - implementation of cleanup() for select_result hierarchy - select_export::send_eof was identical to select_dump::send_eof: moved to the base class select_to_file. - Statement::end_statement() to end lex, free items, and delete possible select_result sql/sql_class.h: - select_result::cleanup() declaration - sql/sql_insert.cc: - implementation of select_insert::cleanup(): currently we always create a new instance of select_insert/ select_create on each execute. sql/sql_lex.cc: - with more complicated logic of freeing lex->result it's easier to have it non-zero only if it points to a valid result. sql/sql_lex.h: Now st_lex::st_lex is not empty. sql/sql_parse.cc: mysql_execute_command(): - delete select_result *result only if it was created in this function. - use end_statement() to cleanup lex and thd in the end of each statement. - no need to save THD::lock if this is explain. This save apparently left from times when derived tables were materialized here, not in open_and_lock_tables. sql/sql_prepare.cc: - call result->cleanup() in reset_stmt_for_execute - now Statement is responsible for freeing its lex->result. sql/sql_select.cc: handle_select(): - don't delete result, it might be needed for next executions - result is never null
22 years ago
Fix for bug#4912 "mysqld crashs in case a statement is executed a second time". The bug was caused by incompatibility of negations elimination algorithm and PS: during first statement execute a subtree with negation was replaced with equivalent subtree without NOTs. The problem was that although this transformation was permanent, items of the new subtree were created in execute-local memory. The patch adds means to check if it is the first execute of a prepared statement, and if this is the case, to allocate items in memory of the prepared statement. The implementation: - backports Item_arena from 5.0 - adds Item_arena::is_stmt_prepare(), Item_arena::is_first_stmt_execute(). - deletes THD::allocate_temporary_pool_for_ps_preparing(), THD::free_temporary_pool_for_ps_preparing(); they were redundant. and adds a few invariants: - thd->free_list never contains junk (= freed items) - thd->current_arena is never null. If there is no prepared statement, it points at the thd. The rest of the patch contains mainly mechanical changes and cleanups. mysql-test/r/ps.result: Test results updated (test case for Bug#4912) mysql-test/t/ps.test: A test case for Bug#4912 "mysqld crashs in case a statement is executed a second time" sql/item_cmpfunc.cc: current_statement -> current_arena sql/item_subselect.cc: Statement -> Item_arena, current_statement -> current_arena sql/item_subselect.h: Item_subselect does not need to save thd->current_statement. sql/item_sum.cc: Statement -> Item_arena sql/item_sum.h: Statement -> Item_arena sql/mysql_priv.h: Statement -> Item_arena sql/sql_base.cc: current_statement -> current_arena sql/sql_class.cc: - Item_arena - convenient set_n_backup_statement, restore_backup_statement (nice idea, Sanja) sql/sql_class.h: - Item_arena: backport from 5.0 - allocate_temporary_pool_for_ps_preparing, free_temporary_pool_for_ps_preparing removed. sql/sql_derived.cc: current_statement -> current_arena sql/sql_lex.cc: current_statement -> current_arena sql/sql_parse.cc: Deploy invariant that thd->free_list never contains junk items (backport from 5.0). sql/sql_prepare.cc: - backporting Item_arena - no need to allocate_temporary_pool_for_ps_preparing(). sql/sql_select.cc: Fix for bug#4912 "mysqld crashs in case a statement is executed a second time": if this is the first execute of a prepared statement, negation elimination is done in memory of the prepared statement. sql/sql_union.cc: Backporting Item_arena from 5.0.
22 years ago
Fix for Bug#5034 "prepared "select 1 into @arg15", second execute crashes server": we were deleting lex->result after each execute, but prepared statements assumed that it's left intact. The fix adds cleanup() method to select_result hierarchy, so that result objects can be reused. Plus we now need to delete result objects more wisely. mysql-test/r/ps.result: Test results fixed: test case for bug#5034 mysql-test/t/ps.test: A test case for bug#5034, few followups sql/sql_class.cc: - fix warning in THD::THD - implementation of cleanup() for select_result hierarchy - select_export::send_eof was identical to select_dump::send_eof: moved to the base class select_to_file. - Statement::end_statement() to end lex, free items, and delete possible select_result sql/sql_class.h: - select_result::cleanup() declaration - sql/sql_insert.cc: - implementation of select_insert::cleanup(): currently we always create a new instance of select_insert/ select_create on each execute. sql/sql_lex.cc: - with more complicated logic of freeing lex->result it's easier to have it non-zero only if it points to a valid result. sql/sql_lex.h: Now st_lex::st_lex is not empty. sql/sql_parse.cc: mysql_execute_command(): - delete select_result *result only if it was created in this function. - use end_statement() to cleanup lex and thd in the end of each statement. - no need to save THD::lock if this is explain. This save apparently left from times when derived tables were materialized here, not in open_and_lock_tables. sql/sql_prepare.cc: - call result->cleanup() in reset_stmt_for_execute - now Statement is responsible for freeing its lex->result. sql/sql_select.cc: handle_select(): - don't delete result, it might be needed for next executions - result is never null
22 years ago
Fix for bug#4912 "mysqld crashs in case a statement is executed a second time". The bug was caused by incompatibility of negations elimination algorithm and PS: during first statement execute a subtree with negation was replaced with equivalent subtree without NOTs. The problem was that although this transformation was permanent, items of the new subtree were created in execute-local memory. The patch adds means to check if it is the first execute of a prepared statement, and if this is the case, to allocate items in memory of the prepared statement. The implementation: - backports Item_arena from 5.0 - adds Item_arena::is_stmt_prepare(), Item_arena::is_first_stmt_execute(). - deletes THD::allocate_temporary_pool_for_ps_preparing(), THD::free_temporary_pool_for_ps_preparing(); they were redundant. and adds a few invariants: - thd->free_list never contains junk (= freed items) - thd->current_arena is never null. If there is no prepared statement, it points at the thd. The rest of the patch contains mainly mechanical changes and cleanups. mysql-test/r/ps.result: Test results updated (test case for Bug#4912) mysql-test/t/ps.test: A test case for Bug#4912 "mysqld crashs in case a statement is executed a second time" sql/item_cmpfunc.cc: current_statement -> current_arena sql/item_subselect.cc: Statement -> Item_arena, current_statement -> current_arena sql/item_subselect.h: Item_subselect does not need to save thd->current_statement. sql/item_sum.cc: Statement -> Item_arena sql/item_sum.h: Statement -> Item_arena sql/mysql_priv.h: Statement -> Item_arena sql/sql_base.cc: current_statement -> current_arena sql/sql_class.cc: - Item_arena - convenient set_n_backup_statement, restore_backup_statement (nice idea, Sanja) sql/sql_class.h: - Item_arena: backport from 5.0 - allocate_temporary_pool_for_ps_preparing, free_temporary_pool_for_ps_preparing removed. sql/sql_derived.cc: current_statement -> current_arena sql/sql_lex.cc: current_statement -> current_arena sql/sql_parse.cc: Deploy invariant that thd->free_list never contains junk items (backport from 5.0). sql/sql_prepare.cc: - backporting Item_arena - no need to allocate_temporary_pool_for_ps_preparing(). sql/sql_select.cc: Fix for bug#4912 "mysqld crashs in case a statement is executed a second time": if this is the first execute of a prepared statement, negation elimination is done in memory of the prepared statement. sql/sql_union.cc: Backporting Item_arena from 5.0.
22 years ago
Fix for Bug#5034 "prepared "select 1 into @arg15", second execute crashes server": we were deleting lex->result after each execute, but prepared statements assumed that it's left intact. The fix adds cleanup() method to select_result hierarchy, so that result objects can be reused. Plus we now need to delete result objects more wisely. mysql-test/r/ps.result: Test results fixed: test case for bug#5034 mysql-test/t/ps.test: A test case for bug#5034, few followups sql/sql_class.cc: - fix warning in THD::THD - implementation of cleanup() for select_result hierarchy - select_export::send_eof was identical to select_dump::send_eof: moved to the base class select_to_file. - Statement::end_statement() to end lex, free items, and delete possible select_result sql/sql_class.h: - select_result::cleanup() declaration - sql/sql_insert.cc: - implementation of select_insert::cleanup(): currently we always create a new instance of select_insert/ select_create on each execute. sql/sql_lex.cc: - with more complicated logic of freeing lex->result it's easier to have it non-zero only if it points to a valid result. sql/sql_lex.h: Now st_lex::st_lex is not empty. sql/sql_parse.cc: mysql_execute_command(): - delete select_result *result only if it was created in this function. - use end_statement() to cleanup lex and thd in the end of each statement. - no need to save THD::lock if this is explain. This save apparently left from times when derived tables were materialized here, not in open_and_lock_tables. sql/sql_prepare.cc: - call result->cleanup() in reset_stmt_for_execute - now Statement is responsible for freeing its lex->result. sql/sql_select.cc: handle_select(): - don't delete result, it might be needed for next executions - result is never null
22 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": implementation for a generic item tree modifications registry. Every item tree modification which should be rolled back for subsequent execution of a prepared statement or stored procedure should be saved in the registry. All such modifications are rolled back at once during cleanup stage of PS. Actual fix for the bug just adds a call to register modifications to convert_constant_item. Post review fixes implemented. mysql-test/r/ps.result: A fix for bug#5748, test results fixed. mysql-test/t/ps.test: A test case for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld" sql/item.cc: Fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": First step in removing up item-specific cleanups: now all such tree modifications should be done using the genericm mechanism implemented in this changeset. sql/item.h: Fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": no need for an item-specific change record any more. sql/item_cmpfunc.cc: A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": register item tree transformation performed by convert_constant_item. sql/sql_class.cc: Implementation for item tree transformations registry. sql/sql_class.h: Declarations, necessary for the tree transformations registry. sql/sql_parse.cc: Assert that the item tree transformations registry is not used for conventional execution. sql/sql_prepare.cc: Use of the item tree modifications registry in prepared statements: rollback all modifications in the end of statement prepare and execute. Also we now always set thd->current_arena to be able to determine that this is an execution of prepared statement inside the registry code. tests/client_test.c: A typo fixed.
21 years ago
A fix and test case for Bug#5987 "subselect in bool function crashes server (prepared statements)": the bug was that all boolean items always recovered its original arguments at statement cleanup stage. This collided with Item_subselect::select_transformer, which tries to permanently change the item tree to use a transformed subselect instead of original one. So we had this call sequence for prepare: mysql_stmt_prepare -> JOIN::prepare -> Item_subselect::fix_fields -> the item tree gets transformed -> Item_bool_rowready_func2::cleanup, item tree is recovered to original state, while it shouldn't have been; mysql_stmt_execute -> attempts to execute a broken tree -> crash. Now instead of bluntly recovering all arguments of bool functions in Item_bool_rowready_func2::cleanup, we recover only those which were changed, and do it in one place. There still would exist a possibility for a collision with subselect tranformation, if permanent and temporary changes were performed at the same stage. But fortunately subselect transformation is always done first, so it doesn't conflict with the optimization done by propogate_cond_constants. Now we have: mysql_stmt_prepare -> JOIN::prepare -> subselect transformation permanently changes the tree -> cleanup doesn't recover anything, because nothing was registered for recovery. mysql_stmt_execute -> JOIN::prepare (the tree is already transformed, so it doesn't change), JOIN::optimize -> propogate_cond_constants -> temporary changes the item tree with constants -> JOIN::execute -> cleanup -> the changes done by propogate_cond_constants are recovered, as they were registered for recovery. mysql-test/r/ps.result: Bug#5987: test results fixed. mysql-test/t/ps.test: A test for bug#5987 "subselect in bool function crashes server (prepared statements)" sql/item.cc: resolve_const_item is now responsible to register all changes of the item tree for recovery sql/item.h: resolve_const_item signagture changed sql/item_cmpfunc.h: Arguments of boolean functions are now recovered using the centralized registry of THD. sql/sql_class.cc: It's crucial to add new items to the beginning of the recovery list, so that the recovery is performed in LIFO mode: otherwise if we change one node of a tree twice, it will be recovered to some intermediate state. sql/sql_select.cc: change_cond_ref_to_const and propogate_cond_constants are now responsible to register all changes of the item tree for recovery. The recovery is done using the centralized THD registry of changed tree items.
21 years ago
Update mysqltest to latest version - ie. backport from 5.1 - also update testcase error dected by new version mysql-test/include/show_msg.inc: BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg.inc mysql-test/include/show_msg80.inc: BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg80.inc BitKeeper/deleted/.del-rpl_chain_temp_table.test: Delete: mysql-test/t/rpl_chain_temp_table.test BitKeeper/deleted/.del-rpl_chain_temp_table.result: Delete: mysql-test/r/rpl_chain_temp_table.result BitKeeper/deleted/.del-rpl_failsafe.result: Delete: mysql-test/r/rpl_failsafe.result BitKeeper/deleted/.del-rpl_failsafe.test: Delete: mysql-test/t/rpl_failsafe.test BitKeeper/deleted/.del-rpl_heap.test: Delete: mysql-test/t/rpl_heap.test BitKeeper/deleted/.del-rpl_heap.result: Delete: mysql-test/r/rpl_heap.result BitKeeper/deleted/.del-rpl000018.result: Delete: mysql-test/r/rpl000018.result BitKeeper/deleted/.del-rpl000018.test: Delete: mysql-test/t/rpl000018.test client/Makefile.am: Link mysqltest with mysys/my_copy.c client/mysqltest.c: Update mysqltest to latest version mysql-test/include/have_multi_ndb.inc: Remove old syntax "@filename" in favor of "--require filename" mysql-test/include/master-slave.inc: Remove old syntax "@filename" in favor of "--require filename" mysql-test/include/ps_query.inc: Remove the comment about no output now when it does. mysql-test/r/check.result: Update output from --send mysql-test/r/connect.result: Update result file for connect test after backport form 5.1 mysql-test/r/flush.result: Update output from --send mysql-test/r/flush_block_commit.result: Update output from --send mysql-test/r/func_misc.result: Update output from --send mysql-test/r/grant2.result: Update output from --send mysql-test/r/handler.result: Update output from --send mysql-test/r/kill.result: Update output from --send mysql-test/r/lock_multi.result: Update output from --send mysql-test/r/mix_innodb_myisam_binlog.result: Update output from --send mysql-test/r/mysqltest.result: Update mysqltest.result after backport mysql-test/r/ps_2myisam.result: Update result as the output from query is now printed mysql-test/r/ps_3innodb.result: Update result as the output from query is now printed mysql-test/r/ps_4heap.result: Update result as the output from query is now printed mysql-test/r/ps_5merge.result: Update result as the output from query is now printed mysql-test/r/ps_6bdb.result: Update result as the output from query is now printed mysql-test/r/ps_7ndb.result: Update result as the output from query is now printed mysql-test/r/rename.result: Update output from --send mysql-test/r/rpl000001.result: Update output from --send mysql-test/r/rpl_error_ignored_table.result: Update output from --send mysql-test/r/rpl_master_pos_wait.result: Update output from --send mysql-test/r/subselect.result: Update result file after adding missing ; mysql-test/r/synchronization.result: Update output from --send mysql-test/r/type_blob.result: Update result file after adding missing ; mysql-test/t/connect.test: Backport test from 5.1 mysql-test/t/init_file.test: Update test so something is printed mysql-test/t/mysql_client_test.test: Update test so result is sent to file and something is printed mysql-test/t/mysqltest.test: Backport latest mysqltest.test file mysql-test/t/ps.test: Move the --replace_column statement to just before the statetement it should replace mysql-test/t/ps_1general.test: Move the --replace_column statement to just before the statetement it should replace mysql-test/t/ps_grant.test: Remove the $DB, no other test uses it mysql-test/t/rpl_flush_tables.test: Fetch $SERVER_VERSION from the db server mysql-test/t/rpl_trunc_temp.test: Remove the selection of connection master after it's been disconnected already mysql-test/t/subselect.test: Add missing ; mysql-test/t/type_blob.test: Add missing ;
19 years ago
Update mysqltest to latest version - ie. backport from 5.1 - also update testcase error dected by new version mysql-test/include/show_msg.inc: BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg.inc mysql-test/include/show_msg80.inc: BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg80.inc BitKeeper/deleted/.del-rpl_chain_temp_table.test: Delete: mysql-test/t/rpl_chain_temp_table.test BitKeeper/deleted/.del-rpl_chain_temp_table.result: Delete: mysql-test/r/rpl_chain_temp_table.result BitKeeper/deleted/.del-rpl_failsafe.result: Delete: mysql-test/r/rpl_failsafe.result BitKeeper/deleted/.del-rpl_failsafe.test: Delete: mysql-test/t/rpl_failsafe.test BitKeeper/deleted/.del-rpl_heap.test: Delete: mysql-test/t/rpl_heap.test BitKeeper/deleted/.del-rpl_heap.result: Delete: mysql-test/r/rpl_heap.result BitKeeper/deleted/.del-rpl000018.result: Delete: mysql-test/r/rpl000018.result BitKeeper/deleted/.del-rpl000018.test: Delete: mysql-test/t/rpl000018.test client/Makefile.am: Link mysqltest with mysys/my_copy.c client/mysqltest.c: Update mysqltest to latest version mysql-test/include/have_multi_ndb.inc: Remove old syntax "@filename" in favor of "--require filename" mysql-test/include/master-slave.inc: Remove old syntax "@filename" in favor of "--require filename" mysql-test/include/ps_query.inc: Remove the comment about no output now when it does. mysql-test/r/check.result: Update output from --send mysql-test/r/connect.result: Update result file for connect test after backport form 5.1 mysql-test/r/flush.result: Update output from --send mysql-test/r/flush_block_commit.result: Update output from --send mysql-test/r/func_misc.result: Update output from --send mysql-test/r/grant2.result: Update output from --send mysql-test/r/handler.result: Update output from --send mysql-test/r/kill.result: Update output from --send mysql-test/r/lock_multi.result: Update output from --send mysql-test/r/mix_innodb_myisam_binlog.result: Update output from --send mysql-test/r/mysqltest.result: Update mysqltest.result after backport mysql-test/r/ps_2myisam.result: Update result as the output from query is now printed mysql-test/r/ps_3innodb.result: Update result as the output from query is now printed mysql-test/r/ps_4heap.result: Update result as the output from query is now printed mysql-test/r/ps_5merge.result: Update result as the output from query is now printed mysql-test/r/ps_6bdb.result: Update result as the output from query is now printed mysql-test/r/ps_7ndb.result: Update result as the output from query is now printed mysql-test/r/rename.result: Update output from --send mysql-test/r/rpl000001.result: Update output from --send mysql-test/r/rpl_error_ignored_table.result: Update output from --send mysql-test/r/rpl_master_pos_wait.result: Update output from --send mysql-test/r/subselect.result: Update result file after adding missing ; mysql-test/r/synchronization.result: Update output from --send mysql-test/r/type_blob.result: Update result file after adding missing ; mysql-test/t/connect.test: Backport test from 5.1 mysql-test/t/init_file.test: Update test so something is printed mysql-test/t/mysql_client_test.test: Update test so result is sent to file and something is printed mysql-test/t/mysqltest.test: Backport latest mysqltest.test file mysql-test/t/ps.test: Move the --replace_column statement to just before the statetement it should replace mysql-test/t/ps_1general.test: Move the --replace_column statement to just before the statetement it should replace mysql-test/t/ps_grant.test: Remove the $DB, no other test uses it mysql-test/t/rpl_flush_tables.test: Fetch $SERVER_VERSION from the db server mysql-test/t/rpl_trunc_temp.test: Remove the selection of connection master after it's been disconnected already mysql-test/t/subselect.test: Add missing ; mysql-test/t/type_blob.test: Add missing ;
19 years ago
Update mysqltest to latest version - ie. backport from 5.1 - also update testcase error dected by new version mysql-test/include/show_msg.inc: BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg.inc mysql-test/include/show_msg80.inc: BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg80.inc BitKeeper/deleted/.del-rpl_chain_temp_table.test: Delete: mysql-test/t/rpl_chain_temp_table.test BitKeeper/deleted/.del-rpl_chain_temp_table.result: Delete: mysql-test/r/rpl_chain_temp_table.result BitKeeper/deleted/.del-rpl_failsafe.result: Delete: mysql-test/r/rpl_failsafe.result BitKeeper/deleted/.del-rpl_failsafe.test: Delete: mysql-test/t/rpl_failsafe.test BitKeeper/deleted/.del-rpl_heap.test: Delete: mysql-test/t/rpl_heap.test BitKeeper/deleted/.del-rpl_heap.result: Delete: mysql-test/r/rpl_heap.result BitKeeper/deleted/.del-rpl000018.result: Delete: mysql-test/r/rpl000018.result BitKeeper/deleted/.del-rpl000018.test: Delete: mysql-test/t/rpl000018.test client/Makefile.am: Link mysqltest with mysys/my_copy.c client/mysqltest.c: Update mysqltest to latest version mysql-test/include/have_multi_ndb.inc: Remove old syntax "@filename" in favor of "--require filename" mysql-test/include/master-slave.inc: Remove old syntax "@filename" in favor of "--require filename" mysql-test/include/ps_query.inc: Remove the comment about no output now when it does. mysql-test/r/check.result: Update output from --send mysql-test/r/connect.result: Update result file for connect test after backport form 5.1 mysql-test/r/flush.result: Update output from --send mysql-test/r/flush_block_commit.result: Update output from --send mysql-test/r/func_misc.result: Update output from --send mysql-test/r/grant2.result: Update output from --send mysql-test/r/handler.result: Update output from --send mysql-test/r/kill.result: Update output from --send mysql-test/r/lock_multi.result: Update output from --send mysql-test/r/mix_innodb_myisam_binlog.result: Update output from --send mysql-test/r/mysqltest.result: Update mysqltest.result after backport mysql-test/r/ps_2myisam.result: Update result as the output from query is now printed mysql-test/r/ps_3innodb.result: Update result as the output from query is now printed mysql-test/r/ps_4heap.result: Update result as the output from query is now printed mysql-test/r/ps_5merge.result: Update result as the output from query is now printed mysql-test/r/ps_6bdb.result: Update result as the output from query is now printed mysql-test/r/ps_7ndb.result: Update result as the output from query is now printed mysql-test/r/rename.result: Update output from --send mysql-test/r/rpl000001.result: Update output from --send mysql-test/r/rpl_error_ignored_table.result: Update output from --send mysql-test/r/rpl_master_pos_wait.result: Update output from --send mysql-test/r/subselect.result: Update result file after adding missing ; mysql-test/r/synchronization.result: Update output from --send mysql-test/r/type_blob.result: Update result file after adding missing ; mysql-test/t/connect.test: Backport test from 5.1 mysql-test/t/init_file.test: Update test so something is printed mysql-test/t/mysql_client_test.test: Update test so result is sent to file and something is printed mysql-test/t/mysqltest.test: Backport latest mysqltest.test file mysql-test/t/ps.test: Move the --replace_column statement to just before the statetement it should replace mysql-test/t/ps_1general.test: Move the --replace_column statement to just before the statetement it should replace mysql-test/t/ps_grant.test: Remove the $DB, no other test uses it mysql-test/t/rpl_flush_tables.test: Fetch $SERVER_VERSION from the db server mysql-test/t/rpl_trunc_temp.test: Remove the selection of connection master after it's been disconnected already mysql-test/t/subselect.test: Add missing ; mysql-test/t/type_blob.test: Add missing ;
19 years ago
A fix and test case for Bug#5985 ""prepare stmt from "select rand(?)" crashes server." The fix makes Item_func_rand prepared-statements aware plus it fixes the case when RAND is used in prepared statements and replication is on (as well as several similar issues). Until now we did not reset THD before every execution of a prepared statement, so if some execution had set thd->time_zone_used or thd->rand_used they would not be reset until next mysql_parse. Some of post-review fixes done. mysql-test/r/ps.result: A test case for Bug#5985: test results fixed. mysql-test/t/ps.test: A test case for Bug#5985 "prepare stmt from "select rand(?)" crashes server." sql/item_func.cc: Actual fix for Bug#5985: Item_func_rand rewritten to be prepared statements aware. sql/item_func.h: Actual fix for Bug#5985: Item_func_rand rewritten to be prepared statements aware. sql/mysql_priv.h: We need a separate call to reset THD state before every execute of a prepared statement. Otherwise things like THD->user_var_events are never cleaned up and bloat binary log (as the list of events grows from execution to execution). sql/sql_class.cc: Statement::end_statement -> THD::end_statement() (a leftover from some design change which is not to pushed now, but the leftover is to be pushed). sql/sql_class.h: Statement::end_statement -> THD::end_statement() (a leftover from some design change which is not to pushed now, but the leftover is to be pushed). sql/sql_lex.cc: Move the part responsible for initializing LEX from mysql_init_query to lex_start. sql/sql_lex.h: All lex-related initialization is now in lex_start. Move thd->select_number to lex->select_number to be able to use it easily in lex_start. sql/sql_parse.cc: Split mysql_init_query into two functions: mysql_reset_thd_for_next_query, which is used in PS and conventional execution, and lex_start, used only when we want to parse something. Fix init_connect to use initialized THD. sql/sql_prepare.cc: Deploy mysql_reset_thd_for_next_query to reset THD state before execution of a prepared statement. Normally this should have been added to just one place, but we have to reset thd before assigning placeholders from variables, thus we can't do that in execute_stmt (yuck).
21 years ago
A fix and test case for Bug#5985 ""prepare stmt from "select rand(?)" crashes server." The fix makes Item_func_rand prepared-statements aware plus it fixes the case when RAND is used in prepared statements and replication is on (as well as several similar issues). Until now we did not reset THD before every execution of a prepared statement, so if some execution had set thd->time_zone_used or thd->rand_used they would not be reset until next mysql_parse. Some of post-review fixes done. mysql-test/r/ps.result: A test case for Bug#5985: test results fixed. mysql-test/t/ps.test: A test case for Bug#5985 "prepare stmt from "select rand(?)" crashes server." sql/item_func.cc: Actual fix for Bug#5985: Item_func_rand rewritten to be prepared statements aware. sql/item_func.h: Actual fix for Bug#5985: Item_func_rand rewritten to be prepared statements aware. sql/mysql_priv.h: We need a separate call to reset THD state before every execute of a prepared statement. Otherwise things like THD->user_var_events are never cleaned up and bloat binary log (as the list of events grows from execution to execution). sql/sql_class.cc: Statement::end_statement -> THD::end_statement() (a leftover from some design change which is not to pushed now, but the leftover is to be pushed). sql/sql_class.h: Statement::end_statement -> THD::end_statement() (a leftover from some design change which is not to pushed now, but the leftover is to be pushed). sql/sql_lex.cc: Move the part responsible for initializing LEX from mysql_init_query to lex_start. sql/sql_lex.h: All lex-related initialization is now in lex_start. Move thd->select_number to lex->select_number to be able to use it easily in lex_start. sql/sql_parse.cc: Split mysql_init_query into two functions: mysql_reset_thd_for_next_query, which is used in PS and conventional execution, and lex_start, used only when we want to parse something. Fix init_connect to use initialized THD. sql/sql_prepare.cc: Deploy mysql_reset_thd_for_next_query to reset THD state before execution of a prepared statement. Normally this should have been added to just one place, but we have to reset thd before assigning placeholders from variables, thus we can't do that in execute_stmt (yuck).
21 years ago
21 years ago
A fix and test case for Bug#9096 "select doesn't return all matched records if prepared statements is used". This fix changes equality evaluation method of basic constants from by-name to by-value, thus effectively enabling use of parameter markers in some optimizations (constants propagation, evaluation of possible keys for query). mysql-test/r/ps.result: Test results for the test case for Bug#9096 mysql-test/t/ps.test: A short test case for Bug#9096 "select doesn't return all matched records if prepared statements is used". The is enough to reproduce the glitch in update_ref_and_keys causing the bug to occur. sql/item.cc: Implement by-value equality evaluation of basic constants. This is needed to work with Item_param values. Until now Item_param was compared with other items by its name, which is always "?". The bug at hand showed up when an integer constant was created from one parameter marker (with value 200887 and name "?") and then compared by-name with another parameter marker (with value 860 and name "?"). True returned by this comparison resulted in a wrong table access method used to evaluate the query. Implement Item_param methods needed to emulate "basic constant" mode at full. sql/item.h: Change declaration of basic_const_item(): now it also widens its argument from const Item * to Item * if the argument is a basic constant. Declare eq() for all basic constatns, as long as now they are compared by value, not by name. Each constant needs its own comparison method. Declarations of Item_param methods needed to fully emulate a basic constant when parameter value is set. sql/item_func.cc: Fix wrong casts.
21 years ago
Added end marker for tests to make future merges easier mysql-test/t/alias.test: Added end marker for test to make future merges easier mysql-test/t/alter_table.test: Added end marker for test to make future merges easier mysql-test/t/analyse.test: Added end marker for test to make future merges easier mysql-test/t/analyze.test: Added end marker for test to make future merges easier Fixed length of comment lines mysql-test/t/ansi.test: Added end marker for test to make future merges easier mysql-test/t/archive.test: Added end marker for test to make future merges easier mysql-test/t/auto_increment.test: Added end marker for test to make future merges easier mysql-test/t/backup.test: Added end marker for test to make future merges easier mysql-test/t/bdb-alter-table-1.test: Added end marker for test to make future merges easier mysql-test/t/bdb-alter-table-2.test: Added end marker for test to make future merges easier mysql-test/t/bdb-crash.test: Added end marker for test to make future merges easier mysql-test/t/bdb-deadlock.test: Added end marker for test to make future merges easier mysql-test/t/bdb-deadlock.tminus: Added end marker for test to make future merges easier mysql-test/t/bdb.test: Added end marker for test to make future merges easier mysql-test/t/bdb_cache.test: Added end marker for test to make future merges easier mysql-test/t/bench_count_distinct.test: Added end marker for test to make future merges easier mysql-test/t/bigint.test: Added end marker for test to make future merges easier mysql-test/t/binary.test: Added end marker for test to make future merges easier mysql-test/t/blackhole.test: Added end marker for test to make future merges easier mysql-test/t/bool.test: Added end marker for test to make future merges easier mysql-test/t/bulk_replace.test: Added end marker for test to make future merges easier mysql-test/t/case.test: Added end marker for test to make future merges easier mysql-test/t/cast.test: Added end marker for test to make future merges easier mysql-test/t/check.test: Added end marker for test to make future merges easier mysql-test/t/comments.test: Added end marker for test to make future merges easier mysql-test/t/compare.test: Added end marker for test to make future merges easier mysql-test/t/connect.test: Added end marker for test to make future merges easier mysql-test/t/consistent_snapshot.test: Added end marker for test to make future merges easier mysql-test/t/constraints.test: Added end marker for test to make future merges easier mysql-test/t/count_distinct.test: Added end marker for test to make future merges easier mysql-test/t/count_distinct2.test: Added end marker for test to make future merges easier mysql-test/t/count_distinct3.test: Added end marker for test to make future merges easier mysql-test/t/create.test: Added end marker for test to make future merges easier mysql-test/t/create_select_tmp.test: Added end marker for test to make future merges easier mysql-test/t/csv.test: Added end marker for test to make future merges easier mysql-test/t/ctype_big5.test: Added end marker for test to make future merges easier mysql-test/t/ctype_collate.test: Added end marker for test to make future merges easier mysql-test/t/ctype_cp1250_ch.test: Added end marker for test to make future merges easier mysql-test/t/ctype_cp1251.test: Added end marker for test to make future merges easier mysql-test/t/ctype_cp932.test: Added end marker for test to make future merges easier mysql-test/t/ctype_create.test: Added end marker for test to make future merges easier mysql-test/t/ctype_gbk.test: Added end marker for test to make future merges easier mysql-test/t/ctype_latin1.test: Added end marker for test to make future merges easier mysql-test/t/ctype_latin1_de.test: Added end marker for test to make future merges easier mysql-test/t/ctype_latin2.test: Added end marker for test to make future merges easier mysql-test/t/ctype_many.test: Added end marker for test to make future merges easier mysql-test/t/ctype_mb.test: Added end marker for test to make future merges easier mysql-test/t/ctype_recoding.test: Added end marker for test to make future merges easier mysql-test/t/ctype_sjis.test: Added end marker for test to make future merges easier mysql-test/t/ctype_tis620.test: Added end marker for test to make future merges easier mysql-test/t/ctype_uca.test: Added end marker for test to make future merges easier mysql-test/t/ctype_ucs.test: Added end marker for test to make future merges easier mysql-test/t/ctype_ucs_binlog.test: Added end marker for test to make future merges easier mysql-test/t/ctype_ujis.test: Added end marker for test to make future merges easier mysql-test/t/ctype_utf8.test: Added end marker for test to make future merges easier mysql-test/t/date_formats.test: Added end marker for test to make future merges easier mysql-test/t/delayed.test: Added end marker for test to make future merges easier mysql-test/t/delete.test: Added end marker for test to make future merges easier mysql-test/t/derived.test: Added end marker for test to make future merges easier mysql-test/t/dirty_close.test: Added end marker for test to make future merges easier mysql-test/t/distinct.test: Added end marker for test to make future merges easier mysql-test/t/drop.test: Added end marker for test to make future merges easier mysql-test/t/drop_temp_table.test: Added end marker for test to make future merges easier mysql-test/t/empty_table.test: Added end marker for test to make future merges easier mysql-test/t/endspace.test: Added end marker for test to make future merges easier mysql-test/t/errors.test: Added end marker for test to make future merges easier mysql-test/t/exampledb.test: Added end marker for test to make future merges easier mysql-test/t/explain.test: Added end marker for test to make future merges easier mysql-test/t/flush.test: Added end marker for test to make future merges easier mysql-test/t/flush_block_commit.test: Added end marker for test to make future merges easier mysql-test/t/flush_table.test: Added end marker for test to make future merges easier mysql-test/t/foreign_key.test: Added end marker for test to make future merges easier mysql-test/t/fulltext.test: Added end marker for test to make future merges easier mysql-test/t/fulltext2.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_cache.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_distinct.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_left_join.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_multi.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_order_by.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_update.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_var.test: Added end marker for test to make future merges easier mysql-test/t/func_compress.test: Added end marker for test to make future merges easier mysql-test/t/func_concat.test: Added end marker for test to make future merges easier mysql-test/t/func_crypt.test: Added end marker for test to make future merges easier mysql-test/t/func_date_add.test: Added end marker for test to make future merges easier mysql-test/t/func_default.test: Added end marker for test to make future merges easier mysql-test/t/func_des_encrypt.test: Added end marker for test to make future merges easier mysql-test/t/func_encrypt.test: Added end marker for test to make future merges easier mysql-test/t/func_encrypt_nossl.test: Added end marker for test to make future merges easier mysql-test/t/func_equal.test: Added end marker for test to make future merges easier mysql-test/t/func_gconcat.test: Added end marker for test to make future merges easier mysql-test/t/func_group.test: Added end marker for test to make future merges easier mysql-test/t/func_if.test: Added end marker for test to make future merges easier mysql-test/t/func_in.test: Added end marker for test to make future merges easier mysql-test/t/func_isnull.test: Added end marker for test to make future merges easier mysql-test/t/func_like.test: Added end marker for test to make future merges easier mysql-test/t/func_math.test: Added end marker for test to make future merges easier mysql-test/t/func_misc.test: Added end marker for test to make future merges easier mysql-test/t/func_op.test: Added end marker for test to make future merges easier mysql-test/t/func_regexp.test: Added end marker for test to make future merges easier mysql-test/t/func_sapdb.test: Added end marker for test to make future merges easier mysql-test/t/func_set.test: Added end marker for test to make future merges easier mysql-test/t/func_str.test: Added end marker for test to make future merges easier mysql-test/t/func_system.test: Added end marker for test to make future merges easier mysql-test/t/func_test.test: Added end marker for test to make future merges easier mysql-test/t/func_time.test: Added end marker for test to make future merges easier mysql-test/t/func_timestamp.test: Added end marker for test to make future merges easier mysql-test/t/gcc296.test: Added end marker for test to make future merges easier mysql-test/t/gis-rtree.test: Added end marker for test to make future merges easier mysql-test/t/gis.test: Added end marker for test to make future merges easier mysql-test/t/grant.test: Added end marker for test to make future merges easier mysql-test/t/grant2.test: Added end marker for test to make future merges easier mysql-test/t/grant_cache.test: Added end marker for test to make future merges easier mysql-test/t/group_by.test: Added end marker for test to make future merges easier mysql-test/t/handler.test: Added end marker for test to make future merges easier mysql-test/t/having.test: Added end marker for test to make future merges easier mysql-test/t/heap.test: Added end marker for test to make future merges easier mysql-test/t/heap_auto_increment.test: Added end marker for test to make future merges easier mysql-test/t/heap_btree.test: Added end marker for test to make future merges easier mysql-test/t/heap_hash.test: Added end marker for test to make future merges easier mysql-test/t/help.test: Added end marker for test to make future merges easier mysql-test/t/init_connect.test: Added end marker for test to make future merges easier mysql-test/t/init_file.test: Added end marker for test to make future merges easier mysql-test/t/innodb-deadlock.test: Added end marker for test to make future merges easier mysql-test/t/innodb-lock.test: Added end marker for test to make future merges easier mysql-test/t/innodb-replace.test: Added end marker for test to make future merges easier mysql-test/t/innodb.test: Added end marker for test to make future merges easier mysql-test/t/innodb_cache.test: Added end marker for test to make future merges easier mysql-test/t/innodb_handler.test: Added end marker for test to make future merges easier mysql-test/t/insert.test: Added end marker for test to make future merges easier mysql-test/t/insert_select-binlog.test: Added end marker for test to make future merges easier mysql-test/t/insert_select.test: Added end marker for test to make future merges easier mysql-test/t/insert_update.test: Added end marker for test to make future merges easier mysql-test/t/isam.test: Added end marker for test to make future merges easier mysql-test/t/join.test: Added end marker for test to make future merges easier mysql-test/t/join_crash.test: Added end marker for test to make future merges easier mysql-test/t/join_outer.test: Added end marker for test to make future merges easier mysql-test/t/key.test: Added end marker for test to make future merges easier mysql-test/t/key_cache.test: Added end marker for test to make future merges easier mysql-test/t/key_diff.test: Added end marker for test to make future merges easier mysql-test/t/key_primary.test: Added end marker for test to make future merges easier mysql-test/t/keywords.test: Added end marker for test to make future merges easier mysql-test/t/kill.test: Added end marker for test to make future merges easier mysql-test/t/limit.test: Added end marker for test to make future merges easier mysql-test/t/loaddata.test: Added end marker for test to make future merges easier mysql-test/t/lock.test: Added end marker for test to make future merges easier mysql-test/t/lock_multi.test: Added end marker for test to make future merges easier mysql-test/t/lock_tables_lost_commit.test: Added end marker for test to make future merges easier mysql-test/t/lowercase_table.test: Added end marker for test to make future merges easier mysql-test/t/lowercase_table2.test: Added end marker for test to make future merges easier mysql-test/t/lowercase_table3.test: Added end marker for test to make future merges easier mysql-test/t/lowercase_table_grant.test: Added end marker for test to make future merges easier mysql-test/t/lowercase_table_qcache.test: Added end marker for test to make future merges easier mysql-test/t/merge.test: Added end marker for test to make future merges easier mysql-test/t/metadata.test: Added end marker for test to make future merges easier mysql-test/t/mix_innodb_myisam_binlog.test: Added end marker for test to make future merges easier mysql-test/t/multi_statement.test: Added end marker for test to make future merges easier mysql-test/t/multi_update.test: Added end marker for test to make future merges easier mysql-test/t/myisam-blob.test: Added end marker for test to make future merges easier mysql-test/t/myisam.test: Added end marker for test to make future merges easier mysql-test/t/mysql_client_test.test: Added end marker for test to make future merges easier mysql-test/t/mysql_protocols.test: Added end marker for test to make future merges easier mysql-test/t/mysqlbinlog.test: Added end marker for test to make future merges easier mysql-test/t/mysqlbinlog2.test: Added end marker for test to make future merges easier mysql-test/t/mysqldump.test: Added end marker for test to make future merges easier mysql-test/t/mysqltest.test: Added end marker for test to make future merges easier mysql-test/t/ndb_alter_table.test: Added end marker for test to make future merges easier mysql-test/t/ndb_autodiscover.test: Added end marker for test to make future merges easier mysql-test/t/ndb_autodiscover2.test: Added end marker for test to make future merges easier mysql-test/t/ndb_basic.test: Added end marker for test to make future merges easier mysql-test/t/ndb_blob.test: Added end marker for test to make future merges easier mysql-test/t/ndb_cache.test: Added end marker for test to make future merges easier mysql-test/t/ndb_charset.test: Added end marker for test to make future merges easier mysql-test/t/ndb_config.test: Added end marker for test to make future merges easier mysql-test/t/ndb_database.test: Added end marker for test to make future merges easier mysql-test/t/ndb_grant.later: Added end marker for test to make future merges easier mysql-test/t/ndb_index.test: Added end marker for test to make future merges easier mysql-test/t/ndb_index_ordered.test: Added end marker for test to make future merges easier mysql-test/t/ndb_index_unique.test: Added end marker for test to make future merges easier mysql-test/t/ndb_insert.test: Added end marker for test to make future merges easier mysql-test/t/ndb_limit.test: Added end marker for test to make future merges easier mysql-test/t/ndb_lock.test: Added end marker for test to make future merges easier mysql-test/t/ndb_minmax.test: Added end marker for test to make future merges easier mysql-test/t/ndb_multi.test: Added end marker for test to make future merges easier mysql-test/t/ndb_replace.test: Added end marker for test to make future merges easier mysql-test/t/ndb_restore.test: Added end marker for test to make future merges easier mysql-test/t/ndb_subquery.test: Added end marker for test to make future merges easier mysql-test/t/ndb_transaction.test: Added end marker for test to make future merges easier mysql-test/t/ndb_truncate.test: Added end marker for test to make future merges easier mysql-test/t/ndb_types.test: Added end marker for test to make future merges easier mysql-test/t/ndb_update.test: Added end marker for test to make future merges easier mysql-test/t/negation_elimination.test: Added end marker for test to make future merges easier mysql-test/t/not_embedded_server.test: Added end marker for test to make future merges easier mysql-test/t/null.test: Added end marker for test to make future merges easier mysql-test/t/null_key.test: Added end marker for test to make future merges easier mysql-test/t/odbc.test: Added end marker for test to make future merges easier mysql-test/t/olap.test: Added end marker for test to make future merges easier mysql-test/t/openssl_1.test: Added end marker for test to make future merges easier mysql-test/t/order_by.test: Added end marker for test to make future merges easier mysql-test/t/order_fill_sortbuf.test: Added end marker for test to make future merges easier mysql-test/t/outfile.test: Added end marker for test to make future merges easier mysql-test/t/overflow.test: Added end marker for test to make future merges easier mysql-test/t/packet.test: Added end marker for test to make future merges easier mysql-test/t/preload.test: Added end marker for test to make future merges easier mysql-test/t/ps.test: Added end marker for test to make future merges easier mysql-test/t/ps_10nestset.test: Added end marker for test to make future merges easier mysql-test/t/ps_11bugs.test: Added end marker for test to make future merges easier mysql-test/t/ps_1general.test: Added end marker for test to make future merges easier mysql-test/t/ps_2myisam.test: Added end marker for test to make future merges easier mysql-test/t/ps_3innodb.test: Added end marker for test to make future merges easier mysql-test/t/ps_4heap.test: Added end marker for test to make future merges easier mysql-test/t/ps_5merge.test: Added end marker for test to make future merges easier mysql-test/t/ps_6bdb.test: Added end marker for test to make future merges easier mysql-test/t/ps_7ndb.test: Added end marker for test to make future merges easier mysql-test/t/ps_grant.test: Added end marker for test to make future merges easier mysql-test/t/query_cache.test: Added end marker for test to make future merges easier mysql-test/t/query_cache_merge.test: Added end marker for test to make future merges easier mysql-test/t/raid.test: Added end marker for test to make future merges easier mysql-test/t/range.test: Added end marker for test to make future merges easier mysql-test/t/rename.test: Added end marker for test to make future merges easier mysql-test/t/repair.test: Added end marker for test to make future merges easier mysql-test/t/replace.test: Added end marker for test to make future merges easier mysql-test/t/rollback.test: Added end marker for test to make future merges easier mysql-test/t/row.test: Added end marker for test to make future merges easier mysql-test/t/rpl000001.test: Added end marker for test to make future merges easier mysql-test/t/rpl000002.test: Added end marker for test to make future merges easier mysql-test/t/rpl000004.test: Added end marker for test to make future merges easier mysql-test/t/rpl000005.test: Added end marker for test to make future merges easier mysql-test/t/rpl000006.test: Added end marker for test to make future merges easier mysql-test/t/rpl000008.test: Added end marker for test to make future merges easier mysql-test/t/rpl000009.test: Added end marker for test to make future merges easier mysql-test/t/rpl000010.test: Added end marker for test to make future merges easier mysql-test/t/rpl000011.test: Added end marker for test to make future merges easier mysql-test/t/rpl000012.test: Added end marker for test to make future merges easier mysql-test/t/rpl000013.test: Added end marker for test to make future merges easier mysql-test/t/rpl000015.test: Added end marker for test to make future merges easier mysql-test/t/rpl000017.test: Added end marker for test to make future merges easier mysql-test/t/rpl000018.test: Added end marker for test to make future merges easier mysql-test/t/rpl_EE_error.test: Added end marker for test to make future merges easier mysql-test/t/rpl_alter.test: Added end marker for test to make future merges easier mysql-test/t/rpl_chain_temp_table.test: Added end marker for test to make future merges easier mysql-test/t/rpl_change_master.test: Added end marker for test to make future merges easier mysql-test/t/rpl_charset.test: Added end marker for test to make future merges easier mysql-test/t/rpl_commit_after_flush.test: Added end marker for test to make future merges easier mysql-test/t/rpl_create_database.test: Added end marker for test to make future merges easier mysql-test/t/rpl_ddl.test: Added end marker for test to make future merges easier mysql-test/t/rpl_deadlock.test: Added end marker for test to make future merges easier mysql-test/t/rpl_delete_all.test: Added end marker for test to make future merges easier mysql-test/t/rpl_do_grant.test: Added end marker for test to make future merges easier mysql-test/t/rpl_drop.test: Added end marker for test to make future merges easier mysql-test/t/rpl_drop_temp.test: Added end marker for test to make future merges easier mysql-test/t/rpl_empty_master_crash.test: Added end marker for test to make future merges easier mysql-test/t/rpl_error_ignored_table.test: Added end marker for test to make future merges easier mysql-test/t/rpl_failed_optimize.test: Added end marker for test to make future merges easier mysql-test/t/rpl_failsafe.test: Added end marker for test to make future merges easier mysql-test/t/rpl_flush_log_loop.test: Added end marker for test to make future merges easier mysql-test/t/rpl_flush_tables.test: Added end marker for test to make future merges easier mysql-test/t/rpl_free_items.test: Added end marker for test to make future merges easier mysql-test/t/rpl_get_lock.test: Added end marker for test to make future merges easier mysql-test/t/rpl_heap.test: Added end marker for test to make future merges easier mysql-test/t/rpl_ignore_grant.test: Added end marker for test to make future merges easier mysql-test/t/rpl_init_slave.test: Added end marker for test to make future merges easier mysql-test/t/rpl_innodb.test: Added end marker for test to make future merges easier mysql-test/t/rpl_insert_id.test: Added end marker for test to make future merges easier mysql-test/t/rpl_insert_ignore.test: Added end marker for test to make future merges easier mysql-test/t/rpl_loaddata.test: Added end marker for test to make future merges easier mysql-test/t/rpl_loaddata_rule_m.test: Added end marker for test to make future merges easier mysql-test/t/rpl_loaddata_rule_s.test: Added end marker for test to make future merges easier mysql-test/t/rpl_loaddatalocal.test: Added end marker for test to make future merges easier mysql-test/t/rpl_log.test: Added end marker for test to make future merges easier mysql-test/t/rpl_log_pos.test: Added end marker for test to make future merges easier mysql-test/t/rpl_many_optimize.test: Added end marker for test to make future merges easier mysql-test/t/rpl_master_pos_wait.test: Added end marker for test to make future merges easier mysql-test/t/rpl_max_relay_size.test: Added end marker for test to make future merges easier mysql-test/t/rpl_misc_functions.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_delete.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_delete2.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_query.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_update.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_update2.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_update3.test: Added end marker for test to make future merges easier mysql-test/t/rpl_mystery22.test: Added end marker for test to make future merges easier mysql-test/t/rpl_openssl.test: Added end marker for test to make future merges easier mysql-test/t/rpl_optimize.test: Added end marker for test to make future merges easier mysql-test/t/rpl_ps.test: Added end marker for test to make future merges easier mysql-test/t/rpl_redirect.test: Added end marker for test to make future merges easier mysql-test/t/rpl_relayrotate.test: Added end marker for test to make future merges easier mysql-test/t/rpl_relayspace.test: Added end marker for test to make future merges easier mysql-test/t/rpl_replicate_do.test: Added end marker for test to make future merges easier mysql-test/t/rpl_reset_slave.test: Added end marker for test to make future merges easier mysql-test/t/rpl_rewrite_db.test: Added end marker for test to make future merges easier mysql-test/t/rpl_rotate_logs.test: Added end marker for test to make future merges easier mysql-test/t/rpl_server_id1.test: Added end marker for test to make future merges easier mysql-test/t/rpl_server_id2.test: Added end marker for test to make future merges easier mysql-test/t/rpl_set_charset.test: Added end marker for test to make future merges easier mysql-test/t/rpl_skip_error.test: Added end marker for test to make future merges easier mysql-test/t/rpl_sporadic_master.test: Added end marker for test to make future merges easier mysql-test/t/rpl_start_stop_slave.test: Added end marker for test to make future merges easier mysql-test/t/rpl_temporary.test: Added end marker for test to make future merges easier mysql-test/t/rpl_timezone.test: Added end marker for test to make future merges easier mysql-test/t/rpl_trunc_binlog.test: Added end marker for test to make future merges easier mysql-test/t/rpl_until.test: Added end marker for test to make future merges easier mysql-test/t/rpl_user_variables.test: Added end marker for test to make future merges easier mysql-test/t/rpl_variables.test: Added end marker for test to make future merges easier mysql-test/t/select.test: Added end marker for test to make future merges easier mysql-test/t/select_found.test: Added end marker for test to make future merges easier mysql-test/t/select_safe.test: Added end marker for test to make future merges easier mysql-test/t/show_check.test: Added end marker for test to make future merges easier mysql-test/t/skip_name_resolve.test: Added end marker for test to make future merges easier mysql-test/t/sql_mode.test: Added end marker for test to make future merges easier mysql-test/t/status.test: Added end marker for test to make future merges easier mysql-test/t/subselect.test: Added end marker for test to make future merges easier mysql-test/t/subselect2.test: Added end marker for test to make future merges easier mysql-test/t/subselect_gis.test: Added end marker for test to make future merges easier mysql-test/t/subselect_innodb.test: Added end marker for test to make future merges easier mysql-test/t/symlink.test: Added end marker for test to make future merges easier mysql-test/t/synchronization.test: Added end marker for test to make future merges easier mysql-test/t/system_mysql_db.test: Added end marker for test to make future merges easier mysql-test/t/system_mysql_db_fix.test: Added end marker for test to make future merges easier mysql-test/t/system_mysql_db_refs.test: Added end marker for test to make future merges easier mysql-test/t/tablelock.test: Added end marker for test to make future merges easier mysql-test/t/temp_table.test: Added end marker for test to make future merges easier mysql-test/t/timezone.test: Added end marker for test to make future merges easier mysql-test/t/timezone2.test: Added end marker for test to make future merges easier mysql-test/t/timezone3.test: Added end marker for test to make future merges easier mysql-test/t/timezone_grant.test: Added end marker for test to make future merges easier mysql-test/t/truncate.test: Added end marker for test to make future merges easier mysql-test/t/type_blob.test: Added end marker for test to make future merges easier mysql-test/t/type_date.test: Added end marker for test to make future merges easier mysql-test/t/type_datetime.test: Added end marker for test to make future merges easier mysql-test/t/type_decimal.test: Added end marker for test to make future merges easier mysql-test/t/type_enum.test: Added end marker for test to make future merges easier mysql-test/t/type_float.test: Added end marker for test to make future merges easier mysql-test/t/type_nchar.test: Added end marker for test to make future merges easier mysql-test/t/type_ranges.test: Added end marker for test to make future merges easier mysql-test/t/type_set.test: Added end marker for test to make future merges easier mysql-test/t/type_time.test: Added end marker for test to make future merges easier mysql-test/t/type_timestamp.test: Added end marker for test to make future merges easier mysql-test/t/type_uint.test: Added end marker for test to make future merges easier mysql-test/t/type_year.test: Added end marker for test to make future merges easier mysql-test/t/union.test: Added end marker for test to make future merges easier mysql-test/t/update.test: Added end marker for test to make future merges easier mysql-test/t/user_var-binlog.test: Added end marker for test to make future merges easier mysql-test/t/user_var.test: Added end marker for test to make future merges easier mysql-test/t/varbinary.test: Added end marker for test to make future merges easier mysql-test/t/variables.test: Added end marker for test to make future merges easier mysql-test/t/warnings.test: Added end marker for test to make future merges easier
21 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and a test case for Bug#16365 "Prepared Statements: DoS with too many open statements". The patch adds a new global variable @@max_prepared_stmt_count. This variable limits the total number of prepared statements in the server. The default value of @@max_prepared_stmt_count is 16382. 16382 small statements (a select against 3 tables with GROUP, ORDER and LIMIT) consume 100MB of RAM. Once this limit has been reached, the server will refuse to prepare a new statement and return ER_UNKNOWN_ERROR (unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup and can accept any value from 0 to 1 million. In case the new value of the limit is less than the current statement count, no new statements can be added, while the old still can be used. Additionally, the current count of prepared statements is now available through a global read-only variable @@prepared_stmt_count. mysql-test/r/ps.result: Test results fixed (a test case for Bug#16365) mysql-test/t/ps.test: A test case for Bug#16365 "Prepared Statements: DoS with too many open statements". Also fix statement leaks in other tests. sql/mysql_priv.h: Add declarations for new global variables. sql/mysqld.cc: Add definitions of max_prepared_stmt_count, prepared_stmt_count. sql/set_var.cc: Implement support for @@prepared_stmt_count and @@max_prepared_stmt_count. Currently these variables are queried without acquiring LOCK_prepared_stmt_count due to limitations of the set_var/sys_var class design. Updates are, however, protected with a lock. sql/set_var.h: New declarations to add support for @@max_prepared_stmt_count. Implement a new class, where the lock to be used when updating a variable is a parameter. sql/sql_class.cc: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_class.h: Add accounting of the total number of prepared statements in the server to the methods of Statement_map. sql/sql_prepare.cc: Statement_map::insert will now send a message in case of an error.
20 years ago
A fix and test cases for Bug#4968 "Stored procedure crash if cursor opened on altered table" Bug#19733 "Repeated alter, or repeated create/drop, fails" Bug#19182 "CREATE TABLE bar (m INT) SELECT n FROM foo; doesn't work from stored procedure." Bug#6895 "Prepared Statements: ALTER TABLE DROP COLUMN does nothing" Bug#22060 "ALTER TABLE x AUTO_INCREMENT=y in SP crashes server" Test cases for bugs 4968, 19733, 6895 will be added in 5.0. Re-execution of CREATE DATABASE, CREATE TABLE and ALTER TABLE statements in stored routines or as prepared statements caused incorrect results (and crashes in versions prior to 5.0.25). In 5.1 the problem occured only for CREATE DATABASE, CREATE TABLE SELECT and CREATE TABLE with INDEX/DATA DIRECTOY options). The problem of bugs 4968, 19733, 19282 and 6895 was that functions mysql_prepare_table, mysql_create_table and mysql_alter_table were not re-execution friendly: during their operation they used to modify contents of LEX (members create_info, alter_info, key_list, create_list), thus making the LEX unusable for the next execution. In particular, these functions removed processed columns and keys from create_list, key_list and drop_list. Search the code in sql_table.cc for drop_it.remove() and similar patterns to find evidence. The fix is to supply to these functions a usable copy of each of the above structures at every re-execution of an SQL statement. To simplify memory management, LEX::key_list and LEX::create_list were added to LEX::alter_info, a fresh copy of which is created for every execution. The problem of crashing bug 22060 stemmed from the fact that the above metnioned functions were not only modifying HA_CREATE_INFO structure in LEX, but also were changing it to point to areas in volatile memory of the execution memory root. The patch solves this problem by creating and using an on-stack copy of HA_CREATE_INFO (note that code in 5.1 already creates and uses a copy of this structure in mysql_create_table()/alter_table(), but this approach didn't work well for CREATE TABLE SELECT statement). mysql-test/r/ps.result: Update test results (Bug#19182, Bug#22060) mysql-test/t/ps.test: Add a test case for Bug#19182, Bug#22060 (4.1-only parts) sql/mysql_priv.h: LEX::key_list and LEX::create_list were moved to LEX::alter_info. Update declarations to use LEX::alter_info instead of these two members. sql/sql_class.h: Replace pair<columns, keys> with an instance of Alter_info in select_create constructor. We create a new copy of Alter_info each time we re-execute SELECT .. CREATE prepared statement. sql/sql_insert.cc: Adjust to a new signature of create_table_from_items. sql/sql_lex.cc: Implement Alter_info::Alter_info that would make a "deep" copy of all definition lists (keys, columns). sql/sql_lex.h: Move key_list and create_list to class Alter_info. Implement Alter_info::Alter_info that can be used with PS and SP. sql/sql_list.h: Implement a copy constructor of class List that makes a deep copy of all list nodes. sql/sql_parse.cc: Adjust to new signatures of mysql_create_table, mysql_alter_table, select_create. Functions mysql_create_index and mysql_drop_index has become identical after initialization of alter_info was moved to the parser, and were merged. Flag enable_slow_log was not updated for SQLCOM_DROP_INDEX, which is a bug. Just like CREATE INDEX, DROP INDEX is currently done via complete table rebuild and is rightfully a slow administrative statement. sql/sql_show.cc: Adjust mysqld_show_create_db to a new signature. sql/sql_table.cc: Adjust mysql_alter_table, mysql_recreate_table, mysql_create_table, mysql_prepare_table to new signatures. sql/sql_yacc.yy: LEX::key_list and LEX::create_list moved to class Alter_info
19 years ago
A fix and test cases for Bug#4968 "Stored procedure crash if cursor opened on altered table" Bug#19733 "Repeated alter, or repeated create/drop, fails" Bug#19182 "CREATE TABLE bar (m INT) SELECT n FROM foo; doesn't work from stored procedure." Bug#6895 "Prepared Statements: ALTER TABLE DROP COLUMN does nothing" Bug#22060 "ALTER TABLE x AUTO_INCREMENT=y in SP crashes server" Test cases for bugs 4968, 19733, 6895 will be added in 5.0. Re-execution of CREATE DATABASE, CREATE TABLE and ALTER TABLE statements in stored routines or as prepared statements caused incorrect results (and crashes in versions prior to 5.0.25). In 5.1 the problem occured only for CREATE DATABASE, CREATE TABLE SELECT and CREATE TABLE with INDEX/DATA DIRECTOY options). The problem of bugs 4968, 19733, 19282 and 6895 was that functions mysql_prepare_table, mysql_create_table and mysql_alter_table were not re-execution friendly: during their operation they used to modify contents of LEX (members create_info, alter_info, key_list, create_list), thus making the LEX unusable for the next execution. In particular, these functions removed processed columns and keys from create_list, key_list and drop_list. Search the code in sql_table.cc for drop_it.remove() and similar patterns to find evidence. The fix is to supply to these functions a usable copy of each of the above structures at every re-execution of an SQL statement. To simplify memory management, LEX::key_list and LEX::create_list were added to LEX::alter_info, a fresh copy of which is created for every execution. The problem of crashing bug 22060 stemmed from the fact that the above metnioned functions were not only modifying HA_CREATE_INFO structure in LEX, but also were changing it to point to areas in volatile memory of the execution memory root. The patch solves this problem by creating and using an on-stack copy of HA_CREATE_INFO (note that code in 5.1 already creates and uses a copy of this structure in mysql_create_table()/alter_table(), but this approach didn't work well for CREATE TABLE SELECT statement). mysql-test/r/ps.result: Update test results (Bug#19182, Bug#22060) mysql-test/t/ps.test: Add a test case for Bug#19182, Bug#22060 (4.1-only parts) sql/mysql_priv.h: LEX::key_list and LEX::create_list were moved to LEX::alter_info. Update declarations to use LEX::alter_info instead of these two members. sql/sql_class.h: Replace pair<columns, keys> with an instance of Alter_info in select_create constructor. We create a new copy of Alter_info each time we re-execute SELECT .. CREATE prepared statement. sql/sql_insert.cc: Adjust to a new signature of create_table_from_items. sql/sql_lex.cc: Implement Alter_info::Alter_info that would make a "deep" copy of all definition lists (keys, columns). sql/sql_lex.h: Move key_list and create_list to class Alter_info. Implement Alter_info::Alter_info that can be used with PS and SP. sql/sql_list.h: Implement a copy constructor of class List that makes a deep copy of all list nodes. sql/sql_parse.cc: Adjust to new signatures of mysql_create_table, mysql_alter_table, select_create. Functions mysql_create_index and mysql_drop_index has become identical after initialization of alter_info was moved to the parser, and were merged. Flag enable_slow_log was not updated for SQLCOM_DROP_INDEX, which is a bug. Just like CREATE INDEX, DROP INDEX is currently done via complete table rebuild and is rightfully a slow administrative statement. sql/sql_show.cc: Adjust mysqld_show_create_db to a new signature. sql/sql_table.cc: Adjust mysql_alter_table, mysql_recreate_table, mysql_create_table, mysql_prepare_table to new signatures. sql/sql_yacc.yy: LEX::key_list and LEX::create_list moved to class Alter_info
19 years ago
  1. #
  2. # SQL Syntax for Prepared Statements test
  3. #
  4. --disable_warnings
  5. drop table if exists t1,t2;
  6. --enable_warnings
  7. create table t1
  8. (
  9. a int primary key,
  10. b char(10)
  11. );
  12. insert into t1 values (1,'one');
  13. insert into t1 values (2,'two');
  14. insert into t1 values (3,'three');
  15. insert into t1 values (4,'four');
  16. # basic functionality
  17. set @a=2;
  18. prepare stmt1 from 'select * from t1 where a <= ?';
  19. execute stmt1 using @a;
  20. set @a=3;
  21. execute stmt1 using @a;
  22. # non-existant statement
  23. --error 1243
  24. deallocate prepare no_such_statement;
  25. --error 1210
  26. execute stmt1;
  27. # Nesting ps commands is not allowed:
  28. --error 1064
  29. prepare stmt2 from 'prepare nested_stmt from "select 1"';
  30. --error 1064
  31. prepare stmt2 from 'execute stmt1';
  32. --error 1064
  33. prepare stmt2 from 'deallocate prepare z';
  34. # PS insert
  35. prepare stmt3 from 'insert into t1 values (?,?)';
  36. set @arg1=5, @arg2='five';
  37. execute stmt3 using @arg1, @arg2;
  38. select * from t1 where a>3;
  39. # PS update
  40. prepare stmt4 from 'update t1 set a=? where b=?';
  41. set @arg1=55, @arg2='five';
  42. execute stmt4 using @arg1, @arg2;
  43. select * from t1 where a>3;
  44. # PS create/delete
  45. prepare stmt4 from 'create table t2 (a int)';
  46. execute stmt4;
  47. prepare stmt4 from 'drop table t2';
  48. execute stmt4;
  49. # Do something that will cause error
  50. --error 1051
  51. execute stmt4;
  52. # placeholders in result field names.
  53. prepare stmt5 from 'select ? + a from t1';
  54. set @a=1;
  55. execute stmt5 using @a;
  56. execute stmt5 using @no_such_var;
  57. set @nullvar=1;
  58. set @nullvar=NULL;
  59. execute stmt5 using @nullvar;
  60. set @nullvar2=NULL;
  61. execute stmt5 using @nullvar2;
  62. # Check that multiple SQL statements are disabled inside PREPARE
  63. --error 1064
  64. prepare stmt6 from 'select 1; select2';
  65. --error 1064
  66. prepare stmt6 from 'insert into t1 values (5,"five"); select2';
  67. # This shouldn't parse
  68. --error 1064
  69. explain prepare stmt6 from 'insert into t1 values (5,"five"); select2';
  70. create table t2
  71. (
  72. a int
  73. );
  74. insert into t2 values (0);
  75. # parameter is NULL
  76. set @arg00=NULL ;
  77. prepare stmt1 from 'select 1 FROM t2 where a=?' ;
  78. execute stmt1 using @arg00 ;
  79. # prepare using variables:
  80. --error 1064
  81. prepare stmt1 from @nosuchvar;
  82. set @ivar= 1234;
  83. --error 1064
  84. prepare stmt1 from @ivar;
  85. set @fvar= 123.4567;
  86. --error 1064
  87. prepare stmt1 from @fvar;
  88. drop table t1,t2;
  89. deallocate prepare stmt3;
  90. deallocate prepare stmt4;
  91. deallocate prepare stmt5;
  92. #
  93. # Bug #4105: Server crash on attempt to prepare a statement with character
  94. # set introducer
  95. #
  96. PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?";
  97. set @var='A';
  98. EXECUTE stmt1 USING @var;
  99. DEALLOCATE PREPARE stmt1;
  100. #
  101. # BUG#3486: FOUND_ROWS() fails inside stored procedure [and prepared statement]
  102. #
  103. create table t1 (id int);
  104. prepare stmt1 from "select FOUND_ROWS()";
  105. select SQL_CALC_FOUND_ROWS * from t1;
  106. # Expect 0
  107. execute stmt1;
  108. insert into t1 values (1);
  109. select SQL_CALC_FOUND_ROWS * from t1;
  110. # Expect 1
  111. execute stmt1;
  112. # Expect 0
  113. execute stmt1;
  114. deallocate prepare stmt1;
  115. drop table t1;
  116. #
  117. # prepared EXPLAIN
  118. #
  119. create table t1
  120. (
  121. c1 tinyint, c2 smallint, c3 mediumint, c4 int,
  122. c5 integer, c6 bigint, c7 float, c8 double,
  123. c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
  124. c13 date, c14 datetime, c15 timestamp(14), c16 time,
  125. c17 year, c18 bit, c19 bool, c20 char,
  126. c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
  127. c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
  128. c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
  129. c32 set('monday', 'tuesday', 'wednesday')
  130. ) engine = MYISAM ;
  131. create table t2 like t1;
  132. set @stmt= ' explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25 ' ;
  133. prepare stmt1 from @stmt ;
  134. execute stmt1 ;
  135. execute stmt1 ;
  136. explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25;
  137. deallocate prepare stmt1;
  138. drop tables t1,t2;
  139. #
  140. # parameters from variables (for field creation)
  141. #
  142. set @arg00=1;
  143. prepare stmt1 from ' create table t1 (m int) as select 1 as m ' ;
  144. execute stmt1 ;
  145. select m from t1;
  146. drop table t1;
  147. prepare stmt1 from ' create table t1 (m int) as select ? as m ' ;
  148. execute stmt1 using @arg00;
  149. select m from t1;
  150. deallocate prepare stmt1;
  151. drop table t1;
  152. #
  153. # eq() for parameters
  154. #
  155. create table t1 (id int(10) unsigned NOT NULL default '0',
  156. name varchar(64) NOT NULL default '',
  157. PRIMARY KEY (id), UNIQUE KEY `name` (`name`));
  158. insert into t1 values (1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7');
  159. prepare stmt1 from 'select name from t1 where id=? or id=?';
  160. set @id1=1,@id2=6;
  161. execute stmt1 using @id1, @id2;
  162. select name from t1 where id=1 or id=6;
  163. deallocate prepare stmt1;
  164. drop table t1;
  165. #
  166. # SHOW TABLE STATUS test
  167. #
  168. create table t1 ( a int primary key, b varchar(30)) engine = MYISAM ;
  169. prepare stmt1 from ' show table status from test like ''t1%'' ';
  170. --replace_column 8 4294967295 12 # 13 # 14 #
  171. execute stmt1;
  172. --replace_column 8 4294967295 12 # 13 # 14 #
  173. show table status from test like 't1%' ;
  174. deallocate prepare stmt1 ;
  175. drop table t1;
  176. #
  177. # Bug#4912 "mysqld crashs in case a statement is executed a second time":
  178. # negation elimination should work once and not break prepared statements
  179. #
  180. create table t1(a varchar(2), b varchar(3));
  181. prepare stmt1 from "select a, b from t1 where (not (a='aa' and b < 'zzz'))";
  182. execute stmt1;
  183. execute stmt1;
  184. deallocate prepare stmt1;
  185. drop table t1;
  186. #
  187. # Bug#5034 "prepared "select 1 into @arg15", second execute crashes
  188. # server".
  189. # Check that descendands of select_result can be reused in prepared
  190. # statements or are correctly created and deleted on each execute
  191. #
  192. prepare stmt1 from "select 1 into @var";
  193. execute stmt1;
  194. execute stmt1;
  195. prepare stmt1 from "create table t1 select 1 as i";
  196. execute stmt1;
  197. drop table t1;
  198. execute stmt1;
  199. prepare stmt1 from "insert into t1 select i from t1";
  200. execute stmt1;
  201. execute stmt1;
  202. prepare stmt1 from "select * from t1 into outfile 'f1.txt'";
  203. execute stmt1;
  204. deallocate prepare stmt1;
  205. drop table t1;
  206. #
  207. # BUG#5242 "Prepared statement names are case sensitive"
  208. #
  209. prepare stmt1 from 'select 1';
  210. prepare STMT1 from 'select 2';
  211. execute sTmT1;
  212. deallocate prepare StMt1;
  213. --error 1243
  214. deallocate prepare Stmt1;
  215. # also check that statement names are in right charset.
  216. set names utf8;
  217. prepare `ü` from 'select 1234';
  218. execute `ü` ;
  219. set names latin1;
  220. execute `�`;
  221. deallocate prepare `�`;
  222. set names default;
  223. #
  224. # BUG#4368 "select * from t1 where a like ?" crashes server if a is in utf8
  225. # and ? is in latin1
  226. # Check that Item converting latin1 to utf8 (for LIKE function) is created
  227. # in memory of prepared statement.
  228. #
  229. create table t1 (a varchar(10)) charset=utf8;
  230. insert into t1 (a) values ('yahoo');
  231. set character_set_connection=latin1;
  232. prepare stmt from 'select a from t1 where a like ?';
  233. set @var='google';
  234. execute stmt using @var;
  235. execute stmt using @var;
  236. deallocate prepare stmt;
  237. drop table t1;
  238. #
  239. # BUG#5510 "inserting Null in AutoIncrement primary key Column Fails"
  240. # (prepared statements)
  241. # The cause: misuse of internal MySQL 'Field' API.
  242. #
  243. create table t1 (a bigint(20) not null primary key auto_increment);
  244. insert into t1 (a) values (null);
  245. select * from t1;
  246. prepare stmt from "insert into t1 (a) values (?)";
  247. set @var=null;
  248. execute stmt using @var;
  249. select * from t1;
  250. drop table t1;
  251. #
  252. # check the same for timestamps
  253. #
  254. create table t1 (a timestamp not null);
  255. prepare stmt from "insert into t1 (a) values (?)";
  256. execute stmt using @var;
  257. --disable_result_log
  258. select * from t1;
  259. --enable_result_log
  260. deallocate prepare stmt;
  261. drop table t1;
  262. #
  263. # BUG#5688 "Upgraded 4.1.5 Server seg faults" # (prepared statements)
  264. # The test case speaks for itself.
  265. # Just another place where we used wrong memory root for Items created
  266. # during statement prepare.
  267. #
  268. prepare stmt from "select 'abc' like convert('abc' using utf8)";
  269. execute stmt;
  270. execute stmt;
  271. deallocate prepare stmt;
  272. #
  273. # BUG#5748 "Prepared statement with BETWEEN and bigint values crashes
  274. # mysqld". Just another place where an item tree modification must be
  275. # rolled back.
  276. #
  277. create table t1 ( a bigint );
  278. prepare stmt from 'select a from t1 where a between ? and ?';
  279. set @a=1;
  280. execute stmt using @a, @a;
  281. execute stmt using @a, @a;
  282. execute stmt using @a, @a;
  283. drop table t1;
  284. deallocate prepare stmt;
  285. #
  286. # Bug #5987 subselect in bool function crashes server (prepared statements):
  287. # don't overwrite transformed subselects with old arguments of a bool
  288. # function.
  289. #
  290. create table t1 (a int);
  291. prepare stmt from "select * from t1 where 1 > (1 in (SELECT * FROM t1))";
  292. execute stmt;
  293. execute stmt;
  294. execute stmt;
  295. drop table t1;
  296. deallocate prepare stmt;
  297. #
  298. # Test case for Bug#6042 "constants propogation works only once (prepared
  299. # statements): check that the query plan changes whenever we change
  300. # placeholder value.
  301. #
  302. create table t1 (a int, b int);
  303. insert into t1 (a, b) values (1,1), (1,2), (2,1), (2,2);
  304. prepare stmt from
  305. "explain select * from t1 where t1.a=2 and t1.a=t1.b and t1.b > 1 + ?";
  306. set @v=5;
  307. --replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 -
  308. execute stmt using @v;
  309. set @v=0;
  310. --replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 -
  311. execute stmt using @v;
  312. set @v=5;
  313. --replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 -
  314. execute stmt using @v;
  315. drop table t1;
  316. deallocate prepare stmt;
  317. #
  318. # A test case for Bug#5985 prepare stmt from "select rand(?)" crashes
  319. # server. Check that Item_func_rand is prepared-statements friendly.
  320. #
  321. create table t1 (a int);
  322. insert into t1 (a) values (1), (2), (3), (4);
  323. set @precision=10000000000;
  324. --replace_column 1 - 3 -
  325. select rand(),
  326. cast(rand(10)*@precision as unsigned integer) from t1;
  327. prepare stmt from
  328. "select rand(),
  329. cast(rand(10)*@precision as unsigned integer),
  330. cast(rand(?)*@precision as unsigned integer) from t1";
  331. set @var=1;
  332. --replace_column 1 - 3 -
  333. execute stmt using @var;
  334. set @var=2;
  335. --replace_column 1 -
  336. execute stmt using @var;
  337. set @var=3;
  338. --replace_column 1 -
  339. execute stmt using @var;
  340. drop table t1;
  341. deallocate prepare stmt;
  342. #
  343. # A test case for Bug#6050 "EXECUTE stmt reports ambiguous fieldnames with
  344. # identical tables from different schemata"
  345. # Check that field name resolving in prepared statements works OK.
  346. #
  347. create database mysqltest1;
  348. create table t1 (a int);
  349. create table mysqltest1.t1 (a int);
  350. select * from t1, mysqltest1.t1;
  351. prepare stmt from "select * from t1, mysqltest1.t1";
  352. execute stmt;
  353. execute stmt;
  354. execute stmt;
  355. drop table t1;
  356. drop table mysqltest1.t1;
  357. drop database mysqltest1;
  358. deallocate prepare stmt;
  359. select '1.1' as a, '1.2' as a UNION SELECT '2.1', '2.2';
  360. prepare stmt from
  361. "select '1.1' as a, '1.2' as a UNION SELECT '2.1', '2.2'";
  362. execute stmt;
  363. execute stmt;
  364. execute stmt;
  365. deallocate prepare stmt;
  366. #
  367. # Test CREATE TABLE ... SELECT (Bug #6094)
  368. #
  369. create table t1 (a int);
  370. insert into t1 values (1),(2),(3);
  371. create table t2 select * from t1;
  372. prepare stmt FROM 'create table t2 select * from t1';
  373. drop table t2;
  374. execute stmt;
  375. drop table t2;
  376. execute stmt;
  377. --error 1050
  378. execute stmt;
  379. drop table t2;
  380. execute stmt;
  381. drop table t1,t2;
  382. deallocate prepare stmt;
  383. #
  384. # Bug#6088 "FOUND_ROWS returns wrong values for prepared statements when
  385. # LIMIT is used"
  386. #
  387. create table t1 (a int);
  388. insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
  389. prepare stmt from "select sql_calc_found_rows * from t1 limit 2";
  390. execute stmt;
  391. select found_rows();
  392. execute stmt;
  393. select found_rows();
  394. execute stmt;
  395. select found_rows();
  396. deallocate prepare stmt;
  397. drop table t1;
  398. #
  399. # Bug#6047 "permission problem when executing mysql_stmt_execute with derived
  400. # table"
  401. #
  402. CREATE TABLE t1 (N int, M tinyint);
  403. INSERT INTO t1 VALUES (1,0),(1,0),(2,0),(2,0),(3,0);
  404. PREPARE stmt FROM 'UPDATE t1 AS P1 INNER JOIN (SELECT N FROM t1 GROUP BY N HAVING COUNT(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2';
  405. EXECUTE stmt;
  406. DEALLOCATE PREPARE stmt;
  407. DROP TABLE t1;
  408. #
  409. # Bug#6297 "prepared statement, wrong handling of <parameter> IS NULL"
  410. # Test that placeholders work with IS NULL/IS NOT NULL clauses.
  411. #
  412. prepare stmt from "select ? is null, ? is not null, ?";
  413. select @no_such_var is null, @no_such_var is not null, @no_such_var;
  414. execute stmt using @no_such_var, @no_such_var, @no_such_var;
  415. set @var='abc';
  416. select @var is null, @var is not null, @var;
  417. execute stmt using @var, @var, @var;
  418. set @var=null;
  419. select @var is null, @var is not null, @var;
  420. execute stmt using @var, @var, @var;
  421. #
  422. # Bug#6873 "PS, having with subquery, crash during execute"
  423. # check that if we modify having subtree, we update JOIN->having pointer
  424. #
  425. create table t1 (pnum char(3));
  426. create table t2 (pnum char(3));
  427. prepare stmt from "select pnum from t2 having pnum in (select 'p1' from t1)";
  428. execute stmt;
  429. execute stmt;
  430. execute stmt;
  431. deallocate prepare stmt;
  432. drop table t1, t2;
  433. #
  434. # Bug #6089: FOUND_ROWS returns wrong values when no table/view is used
  435. #
  436. prepare stmt from "SELECT SQL_CALC_FOUND_ROWS 'foo' UNION SELECT 'bar' LIMIT 0";
  437. execute stmt;
  438. SELECT FOUND_ROWS();
  439. execute stmt;
  440. SELECT FOUND_ROWS();
  441. deallocate prepare stmt;
  442. #
  443. # Bug#9096 "select doesn't return all matched records if prepared statements
  444. # is used"
  445. # The bug was is bad co-operation of the optimizer's algorithm which determines
  446. # which keys can be used to execute a query, constants propagation
  447. # part of the optimizer and parameter markers used by prepared statements.
  448. drop table if exists t1;
  449. create table t1 (c1 int(11) not null, c2 int(11) not null,
  450. primary key (c1,c2), key c2 (c2), key c1 (c1));
  451. insert into t1 values (200887, 860);
  452. insert into t1 values (200887, 200887);
  453. select * from t1 where (c1=200887 and c2=200887) or c2=860;
  454. prepare stmt from
  455. "select * from t1 where (c1=200887 and c2=200887) or c2=860";
  456. execute stmt;
  457. prepare stmt from
  458. "select * from t1 where (c1=200887 and c2=?) or c2=?";
  459. set @a=200887, @b=860;
  460. # this query did not return all matching rows
  461. execute stmt using @a, @b;
  462. deallocate prepare stmt;
  463. drop table t1;
  464. #
  465. # Bug#9777 - another occurrence of the problem stated in Bug#9096:
  466. # we can not compare basic constants by their names, because a placeholder
  467. # is a basic constant while his name is always '?'
  468. #
  469. create table t1 (
  470. id bigint(20) not null auto_increment,
  471. code varchar(20) character set utf8 collate utf8_bin not null default '',
  472. company_name varchar(250) character set utf8 collate utf8_bin default null,
  473. setup_mode tinyint(4) default null,
  474. start_date datetime default null,
  475. primary key (id), unique key code (code)
  476. );
  477. create table t2 (
  478. id bigint(20) not null auto_increment,
  479. email varchar(250) character set utf8 collate utf8_bin default null,
  480. name varchar(250) character set utf8 collate utf8_bin default null,
  481. t1_id bigint(20) default null,
  482. password varchar(250) character set utf8 collate utf8_bin default null,
  483. primary_contact tinyint(4) not null default '0',
  484. email_opt_in tinyint(4) not null default '1',
  485. primary key (id), unique key email (email), key t1_id (t1_id),
  486. constraint t2_fk1 foreign key (t1_id) references t1 (id)
  487. );
  488. insert into t1 values
  489. (1, 'demo', 'demo s', 0, current_date()),
  490. (2, 'code2', 'name 2', 0, current_date()),
  491. (3, 'code3', 'name 3', 0, current_date());
  492. insert into t2 values
  493. (2, 'email1', 'name1', 3, 'password1', 0, 0),
  494. (3, 'email2', 'name1', 1, 'password2', 1, 0),
  495. (5, 'email3', 'name3', 2, 'password3', 0, 0);
  496. prepare stmt from 'select t2.id from t2, t1 where (t1.id=? and t2.t1_id=t1.id)';
  497. set @a=1;
  498. execute stmt using @a;
  499. select t2.id from t2, t1 where (t1.id=1 and t2.t1_id=t1.id);
  500. deallocate prepare stmt;
  501. drop table t1, t2;
  502. #
  503. # Bug#11060 "Server crashes on calling stored procedure with INSERT SELECT
  504. # UNION SELECT" aka "Server crashes on re-execution of prepared INSERT ...
  505. # SELECT with UNION".
  506. #
  507. create table t1 (id int);
  508. prepare stmt from "insert into t1 (id) select id from t1 union select id from t1";
  509. execute stmt;
  510. execute stmt;
  511. deallocate prepare stmt;
  512. drop table t1;
  513. #
  514. # Bug#11458 "Prepared statement with subselects return random data":
  515. # drop PARAM_TABLE_BIT from the list of tables used by a subquery
  516. #
  517. create table t1 (
  518. id int(11) unsigned not null primary key auto_increment,
  519. partner_id varchar(35) not null,
  520. t1_status_id int(10) unsigned
  521. );
  522. insert into t1 values ("1", "partner1", "10"), ("2", "partner2", "10"),
  523. ("3", "partner3", "10"), ("4", "partner4", "10");
  524. create table t2 (
  525. id int(11) unsigned not null default '0',
  526. t1_line_id int(11) unsigned not null default '0',
  527. article_id varchar(20),
  528. sequence int(11) not null default '0',
  529. primary key (id,t1_line_id)
  530. );
  531. insert into t2 values ("1", "1", "sup", "0"), ("2", "1", "sup", "1"),
  532. ("2", "2", "sup", "2"), ("2", "3", "sup", "3"),
  533. ("2", "4", "imp", "4"), ("3", "1", "sup", "0"),
  534. ("4", "1", "sup", "0");
  535. create table t3 (
  536. id int(11) not null default '0',
  537. preceeding_id int(11) not null default '0',
  538. primary key (id,preceeding_id)
  539. );
  540. create table t4 (
  541. user_id varchar(50) not null,
  542. article_id varchar(20) not null,
  543. primary key (user_id,article_id)
  544. );
  545. insert into t4 values("nicke", "imp");
  546. prepare stmt from
  547. 'select distinct t1.partner_id
  548. from t1 left join t3 on t1.id = t3.id
  549. left join t1 pp on pp.id = t3.preceeding_id
  550. where
  551. exists (
  552. select *
  553. from t2 as pl_inner
  554. where pl_inner.id = t1.id
  555. and pl_inner.sequence <= (
  556. select min(sequence) from t2 pl_seqnr
  557. where pl_seqnr.id = t1.id
  558. )
  559. and exists (
  560. select * from t4
  561. where t4.article_id = pl_inner.article_id
  562. and t4.user_id = ?
  563. )
  564. )
  565. and t1.id = ?
  566. group by t1.id
  567. having count(pp.id) = 0';
  568. set @user_id = 'nicke';
  569. set @id = '2';
  570. execute stmt using @user_id, @id;
  571. execute stmt using @user_id, @id;
  572. deallocate prepare stmt;
  573. drop table t1, t2, t3, t4;
  574. #
  575. # Bug#9379: make sure that Item::collation is reset when one sets
  576. # a parameter marker from a string variable.
  577. #
  578. prepare stmt from 'select ?=?';
  579. set @a='CHRISTINE ';
  580. set @b='CHRISTINE';
  581. execute stmt using @a, @b;
  582. execute stmt using @a, @b;
  583. set @a=1, @b=2;
  584. execute stmt using @a, @b;
  585. set @a='CHRISTINE ';
  586. set @b='CHRISTINE';
  587. execute stmt using @a, @b;
  588. deallocate prepare stmt;
  589. #
  590. # Bug#11299 "prepared statement makes wrong SQL syntax in binlog which stops
  591. # replication": check that errouneous queries with placeholders are not
  592. # allowed
  593. #
  594. create table t1 (a int);
  595. --error 1064
  596. prepare stmt from "select ??";
  597. --error 1064
  598. prepare stmt from "select ?FROM t1";
  599. --error 1064
  600. prepare stmt from "select FROM t1 WHERE?=1";
  601. --error 1064
  602. prepare stmt from "update t1 set a=a+?WHERE 1";
  603. --disable_ps_protocol
  604. --error 1064
  605. select ?;
  606. --error 1064
  607. select ??;
  608. --error 1064
  609. select ? from t1;
  610. --enable_ps_protocol
  611. drop table t1;
  612. #
  613. # Bug#9359 "Prepared statements take snapshot of system vars at PREPARE
  614. # time"
  615. #
  616. prepare stmt from "select @@time_zone";
  617. execute stmt;
  618. set @@time_zone:='Japan';
  619. execute stmt;
  620. prepare stmt from "select @@tx_isolation";
  621. execute stmt;
  622. set transaction isolation level read committed;
  623. execute stmt;
  624. set transaction isolation level serializable;
  625. execute stmt;
  626. set @@tx_isolation=default;
  627. execute stmt;
  628. deallocate prepare stmt;
  629. #
  630. # Bug#14410 "Crash in Enum or Set type in CREATE TABLE and PS/SP"
  631. #
  632. # Part I. Make sure the typelib for ENUM is created in the statement memory
  633. # root.
  634. prepare stmt from "create temporary table t1 (letter enum('','a','b','c')
  635. not null)";
  636. execute stmt;
  637. drop table t1;
  638. execute stmt;
  639. drop table t1;
  640. execute stmt;
  641. drop table t1;
  642. # Part II. Make sure that when the default value is converted to UTF-8,
  643. # the new item is # created in the statement memory root.
  644. set names latin1;
  645. prepare stmt from "create table t1 (a enum('test') default 'test')
  646. character set utf8";
  647. execute stmt;
  648. drop table t1;
  649. execute stmt;
  650. drop table t1;
  651. execute stmt;
  652. drop table t1;
  653. # Cleanup
  654. set names default;
  655. deallocate prepare stmt;
  656. #
  657. # A test case for Bug#12734 "prepared statement may return incorrect result
  658. # set for a select SQL request": test that canDoTurboBM is reset for each
  659. # execute of a prepared statement.
  660. #
  661. create table t1 (
  662. word_id mediumint(8) unsigned not null default '0',
  663. formatted varchar(20) not null default ''
  664. );
  665. insert into t1 values
  666. (80,'pendant'), (475,'pretendants'), (989,'tendances'),
  667. (1019,'cependant'),(1022,'abondance'),(1205,'independants'),
  668. (13,'lessiver'),(25,'lambiner'),(46,'situer'),(71,'terminer'),
  669. (82,'decrocher');
  670. select count(*) from t1 where formatted like '%NDAN%';
  671. select count(*) from t1 where formatted like '%ER';
  672. prepare stmt from "select count(*) from t1 where formatted like ?";
  673. set @like="%NDAN%";
  674. execute stmt using @like;
  675. set @like="%ER";
  676. execute stmt using @like;
  677. set @like="%NDAN%";
  678. execute stmt using @like;
  679. set @like="%ER";
  680. execute stmt using @like;
  681. deallocate prepare stmt;
  682. drop table t1;
  683. #
  684. # Bug#13134 "Length of VARCHAR() utf8 column is increasing when table is
  685. # recreated with PS/SP"
  686. #
  687. prepare stmt from 'create table t1 (a varchar(10) character set utf8)';
  688. execute stmt;
  689. --disable_warnings
  690. insert into t1 (a) values (repeat('a', 20));
  691. --enable_warnings
  692. select length(a) from t1;
  693. drop table t1;
  694. execute stmt;
  695. --disable_warnings
  696. insert into t1 (a) values (repeat('a', 20));
  697. --enable_warnings
  698. # Check that the data is truncated to the same length
  699. select length(a) from t1;
  700. drop table t1;
  701. deallocate prepare stmt;
  702. #
  703. # Bug#16248 "WHERE (col1,col2) IN ((?,?)) gives wrong results":
  704. # check that ROW implementation is reexecution-friendly.
  705. #
  706. create table t1 (col1 integer, col2 integer);
  707. insert into t1 values(100,100),(101,101),(102,102),(103,103);
  708. prepare stmt from 'select col1, col2 from t1 where (col1, col2) in ((?,?))';
  709. set @a=100, @b=100;
  710. execute stmt using @a,@b;
  711. set @a=101, @b=101;
  712. execute stmt using @a,@b;
  713. set @a=102, @b=102;
  714. execute stmt using @a,@b;
  715. set @a=102, @b=103;
  716. execute stmt using @a,@b;
  717. deallocate prepare stmt;
  718. drop table t1;
  719. #
  720. # Bug#16365 Prepared Statements: DoS with too many open statements
  721. # Check that the limit @@max_prpeared_stmt_count works.
  722. #
  723. # This is also the test for bug#23159 prepared_stmt_count should be
  724. # status variable.
  725. #
  726. # Save the old value
  727. set @old_max_prepared_stmt_count= @@max_prepared_stmt_count;
  728. #
  729. # Disable prepared statement protocol: in this test we set
  730. # @@max_prepared_stmt_count to 0 or 1 and would like to test the limit
  731. # manually.
  732. #
  733. --disable_ps_protocol
  734. #
  735. # A. Check that the new variables are present in SHOW VARIABLES and
  736. # SHOW STATUS lists.
  737. #
  738. show variables like 'max_prepared_stmt_count';
  739. show status like 'prepared_stmt_count';
  740. #
  741. # B. Check that the new system variable is selectable.
  742. #
  743. select @@max_prepared_stmt_count;
  744. #
  745. # C. Check that max_prepared_stmt_count is settable (global only).
  746. #
  747. set global max_prepared_stmt_count=-1;
  748. select @@max_prepared_stmt_count;
  749. set global max_prepared_stmt_count=10000000000000000;
  750. select @@max_prepared_stmt_count;
  751. set global max_prepared_stmt_count=default;
  752. select @@max_prepared_stmt_count;
  753. --error 1229 # ER_GLOBAL_VARIABLE
  754. set @@max_prepared_stmt_count=1;
  755. --error 1229 # ER_GLOBAL_VARIABLE
  756. set max_prepared_stmt_count=1;
  757. --error 1229 # ER_GLOBAL_VARIABLE
  758. set local max_prepared_stmt_count=1;
  759. # set to a reasonable limit works
  760. set global max_prepared_stmt_count=1;
  761. select @@max_prepared_stmt_count;
  762. #
  763. # D. Check that the variables actually work.
  764. #
  765. set global max_prepared_stmt_count=0;
  766. select @@max_prepared_stmt_count;
  767. show status like 'prepared_stmt_count';
  768. --error 1105 # ER_UNKNOWN_ERROR
  769. prepare stmt from "select 1";
  770. show status like 'prepared_stmt_count';
  771. set global max_prepared_stmt_count=1;
  772. prepare stmt from "select 1";
  773. show status like 'prepared_stmt_count';
  774. --error 1105 # ER_UNKNOWN_ERROR
  775. prepare stmt1 from "select 1";
  776. show status like 'prepared_stmt_count';
  777. deallocate prepare stmt;
  778. show status like 'prepared_stmt_count';
  779. #
  780. # E. Check that we can prepare a statement with the same name
  781. # successfully, without hitting the limit.
  782. #
  783. prepare stmt from "select 1";
  784. show status like 'prepared_stmt_count';
  785. prepare stmt from "select 2";
  786. show status like 'prepared_stmt_count';
  787. #
  788. # F. We can set the max below the current count. In this case no new
  789. # statements should be allowed to prepare.
  790. #
  791. show status like 'prepared_stmt_count';
  792. select @@max_prepared_stmt_count;
  793. set global max_prepared_stmt_count=0;
  794. --error 1105 # ER_UNKNOWN_ERROR
  795. prepare stmt from "select 1";
  796. # Result: the old statement is deallocated, the new is not created.
  797. --error 1243 # ER_UNKNOWN_STMT_HANDLER
  798. execute stmt;
  799. show status like 'prepared_stmt_count';
  800. --error 1105 # ER_UNKNOWN_ERROR
  801. prepare stmt from "select 1";
  802. show status like 'prepared_stmt_count';
  803. #
  804. # G. Show that the variables are up to date even after a connection with all
  805. # statements in it was terminated.
  806. #
  807. set global max_prepared_stmt_count=3;
  808. select @@max_prepared_stmt_count;
  809. show status like 'prepared_stmt_count';
  810. prepare stmt from "select 1";
  811. connect (con1,localhost,root,,);
  812. connection con1;
  813. prepare stmt from "select 2";
  814. prepare stmt1 from "select 3";
  815. --error 1105 # ER_UNKNOWN_ERROR
  816. prepare stmt2 from "select 4";
  817. connection default;
  818. --error 1105 # ER_UNKNOWN_ERROR
  819. prepare stmt2 from "select 4";
  820. select @@max_prepared_stmt_count;
  821. show status like 'prepared_stmt_count';
  822. disconnect con1;
  823. connection default;
  824. deallocate prepare stmt;
  825. #
  826. # Restore the old value.
  827. #
  828. set global max_prepared_stmt_count= @old_max_prepared_stmt_count;
  829. --enable_ps_protocol
  830. #
  831. # Bug#19399 "Stored Procedures 'Lost Connection' when dropping/creating
  832. # tables"
  833. # Check that multi-delete tables are also cleaned up before re-execution.
  834. #
  835. --disable_warnings
  836. drop table if exists t1;
  837. create temporary table if not exists t1 (a1 int);
  838. --enable_warnings
  839. # exact delete syntax is essential
  840. prepare stmt from "delete t1 from t1 where (cast(a1/3 as unsigned) * 3) = a1";
  841. drop temporary table t1;
  842. create temporary table if not exists t1 (a1 int);
  843. # the server crashed on the next statement without the fix
  844. execute stmt;
  845. drop temporary table t1;
  846. create temporary table if not exists t1 (a1 int);
  847. # the problem was in memory corruption: repeat the test just in case
  848. execute stmt;
  849. drop temporary table t1;
  850. create temporary table if not exists t1 (a1 int);
  851. execute stmt;
  852. drop temporary table t1;
  853. deallocate prepare stmt;
  854. #
  855. # BUG#22085: Crash on the execution of a prepared statement that
  856. # uses an IN subquery with aggregate functions in HAVING
  857. #
  858. CREATE TABLE t1(
  859. ID int(10) unsigned NOT NULL auto_increment,
  860. Member_ID varchar(15) NOT NULL default '',
  861. Action varchar(12) NOT NULL,
  862. Action_Date datetime NOT NULL,
  863. Track varchar(15) default NULL,
  864. User varchar(12) default NULL,
  865. Date_Updated timestamp NOT NULL default CURRENT_TIMESTAMP on update
  866. CURRENT_TIMESTAMP,
  867. PRIMARY KEY (ID),
  868. KEY Action (Action),
  869. KEY Action_Date (Action_Date)
  870. );
  871. INSERT INTO t1(Member_ID, Action, Action_Date, Track) VALUES
  872. ('111111', 'Disenrolled', '2006-03-01', 'CAD' ),
  873. ('111111', 'Enrolled', '2006-03-01', 'CAD' ),
  874. ('111111', 'Disenrolled', '2006-07-03', 'CAD' ),
  875. ('222222', 'Enrolled', '2006-03-07', 'CAD' ),
  876. ('222222', 'Enrolled', '2006-03-07', 'CHF' ),
  877. ('222222', 'Disenrolled', '2006-08-02', 'CHF' ),
  878. ('333333', 'Enrolled', '2006-03-01', 'CAD' ),
  879. ('333333', 'Disenrolled', '2006-03-01', 'CAD' ),
  880. ('444444', 'Enrolled', '2006-03-01', 'CAD' ),
  881. ('555555', 'Disenrolled', '2006-03-01', 'CAD' ),
  882. ('555555', 'Enrolled', '2006-07-21', 'CAD' ),
  883. ('555555', 'Disenrolled', '2006-03-01', 'CHF' ),
  884. ('666666', 'Enrolled', '2006-02-09', 'CAD' ),
  885. ('666666', 'Enrolled', '2006-05-12', 'CHF' ),
  886. ('666666', 'Disenrolled', '2006-06-01', 'CAD' );
  887. PREPARE STMT FROM
  888. "SELECT GROUP_CONCAT(Track SEPARATOR ', ') FROM t1
  889. WHERE Member_ID=? AND Action='Enrolled' AND
  890. (Track,Action_Date) IN (SELECT Track, MAX(Action_Date) FROM t1
  891. WHERE Member_ID=?
  892. GROUP BY Track
  893. HAVING Track>='CAD' AND
  894. MAX(Action_Date)>'2006-03-01')";
  895. SET @id='111111';
  896. EXECUTE STMT USING @id,@id;
  897. SET @id='222222';
  898. EXECUTE STMT USING @id,@id;
  899. DEALLOCATE PREPARE STMT;
  900. DROP TABLE t1;
  901. #
  902. # BUG#21354: (COUNT(*) = 1) not working in SELECT inside prepared
  903. # statement
  904. #
  905. --disable_warnings
  906. DROP TABLE IF EXISTS t1;
  907. --enable_warnings
  908. CREATE TABLE t1 (i INT, INDEX(i));
  909. INSERT INTO t1 VALUES (1);
  910. PREPARE stmt FROM "SELECT (COUNT(i) = 1), COUNT(i) FROM t1 WHERE i = ?";
  911. SET @a = 0;
  912. EXECUTE stmt USING @a;
  913. SET @a = 1;
  914. EXECUTE stmt USING @a;
  915. SET @a = 0;
  916. EXECUTE stmt USING @a;
  917. PREPARE stmt FROM "SELECT (AVG(i) = 1), AVG(i) FROM t1 WHERE i = ?";
  918. SET @a = 0;
  919. EXECUTE stmt USING @a;
  920. SET @a = 1;
  921. EXECUTE stmt USING @a;
  922. SET @a = 0;
  923. EXECUTE stmt USING @a;
  924. PREPARE stmt FROM "SELECT (VARIANCE(i) = 1), VARIANCE(i) FROM t1 WHERE i = ?";
  925. SET @a = 0;
  926. EXECUTE stmt USING @a;
  927. SET @a = 1;
  928. EXECUTE stmt USING @a;
  929. SET @a = 0;
  930. EXECUTE stmt USING @a;
  931. PREPARE stmt FROM "SELECT (STDDEV(i) = 1), STDDEV(i) FROM t1 WHERE i = ?";
  932. SET @a = 0;
  933. EXECUTE stmt USING @a;
  934. SET @a = 1;
  935. EXECUTE stmt USING @a;
  936. SET @a = 0;
  937. EXECUTE stmt USING @a;
  938. PREPARE stmt FROM "SELECT (BIT_OR(i) = 1), BIT_OR(i) FROM t1 WHERE i = ?";
  939. SET @a = 0;
  940. EXECUTE stmt USING @a;
  941. SET @a = 1;
  942. EXECUTE stmt USING @a;
  943. SET @a = 0;
  944. EXECUTE stmt USING @a;
  945. PREPARE stmt FROM "SELECT (BIT_AND(i) = 1), BIT_AND(i) FROM t1 WHERE i = ?";
  946. SET @a = 0;
  947. EXECUTE stmt USING @a;
  948. SET @a = 1;
  949. EXECUTE stmt USING @a;
  950. SET @a = 0;
  951. EXECUTE stmt USING @a;
  952. PREPARE stmt FROM "SELECT (BIT_XOR(i) = 1), BIT_XOR(i) FROM t1 WHERE i = ?";
  953. SET @a = 0;
  954. EXECUTE stmt USING @a;
  955. SET @a = 1;
  956. EXECUTE stmt USING @a;
  957. SET @a = 0;
  958. EXECUTE stmt USING @a;
  959. DEALLOCATE PREPARE stmt;
  960. DROP TABLE t1;
  961. #
  962. # Bug#19182: CREATE TABLE bar (m INT) SELECT n FROM foo; doesn't work
  963. # from stored procedure.
  964. #
  965. # The cause of a bug was that cached LEX::create_list was modified,
  966. # and then together with LEX::key_list was reset.
  967. #
  968. --disable_warnings
  969. DROP TABLE IF EXISTS t1, t2;
  970. --enable_warnings
  971. CREATE TABLE t1 (i INT);
  972. PREPARE st_19182
  973. FROM "CREATE TABLE t2 (i INT, j INT, KEY (i), KEY(j)) SELECT i FROM t1";
  974. EXECUTE st_19182;
  975. DESC t2;
  976. DROP TABLE t2;
  977. # Check that on second execution we don't loose 'j' column and the keys
  978. # on 'i' and 'j' columns.
  979. EXECUTE st_19182;
  980. DESC t2;
  981. DEALLOCATE PREPARE st_19182;
  982. DROP TABLE t2, t1;
  983. #
  984. # Bug #22060 "ALTER TABLE x AUTO_INCREMENT=y in SP crashes server"
  985. #
  986. # Code which implemented CREATE/ALTER TABLE and CREATE DATABASE
  987. # statement modified HA_CREATE_INFO structure in LEX, making these
  988. # statements PS/SP-unsafe (their re-execution might have resulted
  989. # in incorrect results).
  990. #
  991. --disable_warnings
  992. drop database if exists mysqltest;
  993. drop table if exists t1, t2;
  994. --enable_warnings
  995. # CREATE TABLE and CREATE TABLE ... SELECT
  996. create database mysqltest character set utf8;
  997. prepare stmt1 from "create table mysqltest.t1 (c char(10))";
  998. prepare stmt2 from "create table mysqltest.t2 select 'test'";
  999. execute stmt1;
  1000. execute stmt2;
  1001. show create table mysqltest.t1;
  1002. show create table mysqltest.t2;
  1003. drop table mysqltest.t1;
  1004. drop table mysqltest.t2;
  1005. alter database mysqltest character set latin1;
  1006. execute stmt1;
  1007. execute stmt2;
  1008. show create table mysqltest.t1;
  1009. show create table mysqltest.t2;
  1010. drop database mysqltest;
  1011. deallocate prepare stmt1;
  1012. deallocate prepare stmt2;
  1013. # CREATE TABLE with DATA DIRECTORY option
  1014. --disable_query_log
  1015. eval prepare stmt from "create table t1 (c char(10)) data directory='$MYSQLTEST_VARDIR/tmp'";
  1016. --enable_query_log
  1017. execute stmt;
  1018. --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
  1019. show create table t1;
  1020. drop table t1;
  1021. execute stmt;
  1022. --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
  1023. show create table t1;
  1024. drop table t1;
  1025. deallocate prepare stmt;
  1026. #
  1027. --echo End of 4.1 tests.