names with ident. tables fr. diff. schemata": revise all uses of
Item_field and make them prepared-statements friendly when necessary.
mysql-test/r/ps.result:
Test results fixed: the test case for Bug#6050
mysql-test/r/ps_1general.result:
Test results fixed: in prepared statements we expand '*' to a list
of fully qualified fields (db.table.column).
mysql-test/t/ps.test:
A test for Bug#6050 "EXECUTE stmt reports ambiguous fieldnames with
ident. tables fr. diff. schemata"
sql/item.cc:
Revise all Item_field constructors: we need to make sure that no Item_field
object points to unaccessible memory in prepared statements.
sql/item.h:
Revise all Item_field constructors: we need to make sure that no Item_field
object points to unaccessible memory in prepared statements.
sql/sql_base.cc:
Item_field use changed to be prepared statements friendly.
sql/sql_class.h:
New check of Item_arena state.
sql/sql_union.cc:
Fixing the problem with name resolving in UNION and prepared statements:
In case of SELECT a, b, c FROM t1 UNION SELECT a, b, c FROM t2 the list of
selected items is represented as a List<Item_field>, where each
Item_field points to a field of temporary table.
But the temporary table is created anew on each execution of the prepared
statement. So on each subsequent execution we should reset Item_field
items to point to fields from freshly-created temporary table.
sql/table.h:
Comment TABLE member.
Added SQLSTATE matching support to test engine
mysqltest.result, mysqltest.test:
new file
mysql-test/t/mysqltest.test:
Added SQLSTATE matching support to test engine
mysql-test/r/mysqltest.result:
Added SQLSTATE matching support to test engine
client/mysqltest.c:
Added SQLSTATE matching support to test engine
mysql.time_zone* tables".
We are excluding implicitly used time zone tables from privilege
checking.
mysql-test/r/timezone2.result:
Added test for bug #6116 "SET time_zone := ... requires access to
mysql.time_zone tables"
mysql-test/t/timezone2.test:
Added test for bug #6116 "SET time_zone := ... requires access to
mysql.time_zone tables"
sql/sql_parse.cc:
check_table_access(): we should avoid privilege checking for implicitly
used time zone tables.
sql/tztime.cc:
Indicated dependancy between my_tz_get_table_list() function and
my_tz_check_n_skip_implicit_tables() function.
sql/tztime.h:
Added my_tz_check_n_skip_implicit_tables() function which allows easily
determine whenever we have found beggining of the list of implicitly used
time zone tables and fast-forward to its end.
mysql-test/r/ps_10nestset.result:
Correct the expected protocol according to the test changes.
mysql-test/t/ps_10nestset.test:
Improve comments; adapt to standard test style:
disable warnings around 'drop table', use 't#' table name scheme.
mysql-test/t/ps_11bugs.test:
Corrected a typing error in the bug number comment.
BitKeeper/etc/logging_ok:
auto-union
Docs/Support/texi2html:
Auto merged
innobase/trx/trx0rec.c:
Auto merged
libmysql/libmysql.c:
Auto merged
myisam/myisampack.c:
Auto merged
mysql-test/t/innodb-lock.test:
Auto merged
mysys/thr_lock.c:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/sql_acl.cc:
Keep old code
mysql-test/r/innodb-lock.result:
Fix test case (old one didn't test things correctly)
mysql-test/t/innodb-lock.test:
Fix test case (old one didn't test things correctly)
mysys/thr_lock.c:
More debugging information
sql/mysqld.cc:
Enable innodb_table_locks as default, as otherwise there is a possibility for deadlocks
sql/sql_base.cc:
More debug information
into mysql.com:/home/dlenev/src/mysql-4.1-secfix
sql/mysql_priv.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
he has SELECT and INSERT privileges for table with primary key"
Now we set lex->duplicates= DUP_UPDATE right in parser if INSERT has
ON DUPLICATE KEY UPDATE clause, this simplifies insert_precheck()
function (this also fixes a bug) and some other code.
mysql-test/r/grant2.result:
Added test for bug #6173 "One can circumvent missing UPDATE privilege if
he has SELECT and INSERT privileges for table with primary key"
mysql-test/t/grant2.test:
Added test for bug #6173 "One can circumvent missing UPDATE privilege if
he has SELECT and INSERT privileges for table with primary key"
sql/mysql_priv.h:
insert_precheck() don't need "update" parameter any longer since
now we set lex->duplicates to DUP_UPDATE if INSERT has ON DUPLICATE
KEY UPDATE clause.
sql/sql_parse.cc:
insert_precheck() don't need "update" parameter any longer since
now we set lex->duplicates to DUP_UPDATE if INSERT has ON DUPLICATE
KEY UPDATE clause, so it can determine whenever it is needed to
require UPDATE_ACL by itself. Also calling of mysql_insert() is
simplified.
sql/sql_prepare.cc:
insert_precheck() don't need "update" parameter any longer since
now we set lex->duplicates to DUP_UPDATE if INSERT has ON DUPLICATE
KEY UPDATE clause, so it can determine whenever it is needed to
require UPDATE_ACL by itself. Also calling of mysql_insert() is
simplified.
sql/sql_yacc.yy:
It is better to set Lex->duplicates= DUP_UPDATE right in parser if we
have INSERT with ON DUPLICATE KEY UPDATE clause, rather doing this later.
Rename innodb_table_locks_old_behavior -> innodb_table_locks
Set innodb_table_locks to off by default to get same behaviour as in MySQL 4.0.20
(This means that Innodb ignore table locks by default, which makes it easier to combine MyISAM and InnoDB to simulate a transaction)
libmysql/libmysql.c:
Use ulong instead of unsigned long
Reuse _dig_vec()
myisam/myisampack.c:
Simplify code
mysql-test/r/innodb-lock.result:
new test case
mysql-test/t/innodb-lock.test:
new test case
sql/ha_innodb.cc:
Rename innodb_table_locks_old_behavior -> innodb_table_locks
sql/mysqld.cc:
Rename innodb_table_locks_old_behavior -> innodb_table_locks
Set this off by default to get same behaviour as in MySQL 4.0.20
sql/set_var.cc:
Rename innodb_table_locks_old_behavior -> innodb_table_locks
sql/sql_class.h:
Rename innodb_table_locks_old_behavior -> innodb_table_locks
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.
when one connection had done FLUSH TABLES WITH READ LOCK, some updates, and then COMMIT,
it was accepted but my_error() was called and so, while client got no error, error was logged in binlog.
We now don't call my_error() in this case; we assume the connection know what it does.
This problem was specific to 4.0.21. The change is needed to make replication work with existing versions of innobackup.
sql/lock.cc:
If a connection has done FLUSH TABLES WITH READ LOCK and now is doing COMMIT, don't give error
(applies only if it's the same connection; others' COMMITs are still blocked).