test for bug#1180 changed to table naming scheme 't#'.
mysql-test/r/ps_11bugs.result:
Expected results of new tests for bug#1644 and bug#1676,
test for bug#1180 changed to table naming scheme 't#'.
mysql-test/t/ps_11bugs.test:
New tests to check bug#1644 and bug#1676,
test for bug#1180 changed to table naming scheme 't#'.
X-locks on duplicates also on LOAD DATA...REPLACE clause and
fixes a bug #6086 adding --disable_warnings and --enable_warnings around
the create table clauses in ctype_utf8 tests for InnoDB.
innobase/dict/dict0dict.c:
Remove static.
innobase/include/dict0dict.h:
Add prototype for a function dict_scan_to
innobase/row/row0ins.c:
Add support for a LOAD DATA INFILE 'xxx' REPLACE INTO TABLE x. We should
take X-locks on both REPLACE and LOAD DATA...REPLACE queries to duplicate
records.
innobase/row/row0sel.c:
If innodb_locks_unsafe_for_binlog options is used we do not lock
gaps. Supremum record is really a dummy record i.e. gap, therefore
we do set locks there.
mysql-test/t/ctype_utf8.test:
Fix bug #6086: Add --disable_warnings and --enable_warnings around the
create table where engine=innodb.
mysql-test/r/ps_11bugs.result:
Expected results of the added tests for bug#1644 and bug#1676.
mysql-test/t/ps_11bugs.test:
Added tests for bug#1644 and bug#1676,
also minor comments.
Bug#6086 "ctype_utf8" test fails when MySQL does not include InnoDB support
mysql-test/t/ctype_utf8.test:
Bug#6086 "ctype_utf8" test fails when MySQL does not include InnoDB support
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).
propogation works only once (prepared statements)".
mysql-test/r/ps.result:
Test case for Bug#6042: test results fixed
mysql-test/t/ps.test:
A test case for Bug#6042 "constants propogation works only once
(prepared statements).
- 'ps_10nestset' uses a "nested set" approach for an employee
hierarchy, then does arithmetic on the "salary" field;
(soon) to be extended by inserts / deletes which imply
mass updates on the "l"/"r" fields showing the set inclusion,
- 'ps_11bugs' will get (some of ?) those bug DB entries which
refer to prepared statements, but whose number does not appear
in a test file comment - so it will also be extended.
added blob to test to see that blob tables don't show up in show tables
auto increment setting need not fetch blob tables (will otherwise generate error during table creation)
moved addBlobTables out of fetchGlobalTableImpl to get_local_table_info
changed addBlobTables to start from last column and break if all blobs added
also addBlobTables will return -1 if failed (typically getTable)
changed to using get_local_table_info with internal table name where applicable for efficiency
added option to get_local_table_info wether to fetch blob tables or not
getTable always fetches the blobtables
moved addBlobTables to get_local_table_info to always be called, even if main table goes to cache only
mysql-test/r/ndb_autodiscover.result:
added blob to test to see that blob tables don't show up in show tables
mysql-test/t/ndb_autodiscover.test:
added blob to test to see that blob tables don't show up in show tables
ndb/src/ndbapi/Ndb.cpp:
auto increment setting need not fetch blob tables (will otherwise generate error during table creation)
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
moved addBlobTables out of fetchGlobalTableImpl to get_local_table_info
changed addBlobTables to start from last column and break if all blobs added
also addBlobTables will return -1 if failed (typically getTable)
changed to using get_local_table_info with internal table name where applicable for efficiency
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
added option to get_local_table_info wether to fetch blob tables or not
getTable always fetches the blobtables
moved addBlobTables to get_local_table_info to always be called, even if main table goes to cache only
(Bug #4315: GROUP_CONCAT with ORDER BY returns strange results for TEXT fields
Bug #5564: Strange behaviour with group_concat and distinct
Bug #5970: group_concat doesn't print warnings)
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.
Look for 'client_test' in tests/ not bin/
make_binary_distribution.sh:
Copy 'client_test' into the dist
scripts/make_binary_distribution.sh:
Copy 'client_test' into the dist
mysql-test/mysql-test-run.sh:
Look for 'client_test' in tests/ not bin/
mysql-test/r/ndb_autodiscover.result:
Added test cases to check that SHOW TABLES only show tables in the selected db.
mysql-test/t/ndb_autodiscover.test:
Added test cases to check that SHOW TABLES only show tables in the selected db.
sql/ha_ndbcluster.cc:
Only find files for the current db
Only add files to files list which can be created i.e has a valid frm blob. This prevents NDB$BLOB tables and tables created from NdbApi to show up.
To make client_test work as mysql-test-run test case, needs to install it
mysql-test/mysql-test-run.sh:
To make client_test work as mysql-test-run test case, needs to install it
mysql-test/t/client_test.test:
To make client_test work as mysql-test-run test case, needs to install it
tests/Makefile.am:
To make client_test work as mysql-test-run test case, needs to install it
into mysql.com:/media/sda1/mysql/mysql-4.1-5748-anew
sql/item_cmpfunc.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
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.
mysql-test/r/ndb_index_ordered.result:
Another test to check the use of "sorted" in combination with reset_bounds()
mysql-test/t/ndb_index_ordered.test:
Another test to check the use of "sorted" in combination with reset_bounds()
sql/ha_ndbcluster.cc:
Check that sorted is set to 0 or 1.
sql/opt_range.cc:
Initialise the sorted variable to zero QUICK_SELECT constructor.