disabled warnings because their order is undeterministic
mysql-test/t/func_gconcat.test:
disabled warnings because their order is undeterministic
mysql-test/r/func_gconcat.result:
disabled warnings because their order is undeterministic
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
client/mysqltest.c:
Manual merge
mysql-test/r/mysqltest.result:
Manual merge
Problem: ``SET PASSWORD FOR foo@localhost'' was written into
binary log using double quites: ``SET PASSWORD FOR "foo"@"localhost"...''.
If sql_mode was set to ANSI_QUOTES, parser on slave considered
"foo" and "localhost" as identifiers instead of strigns constants,
so it failed to parse, generated syntax error and slave then stopped.
Fix: changing binary log entries to use single quotes:
``SET PASSWORD FOR 'foo'@'localhost'...'' not to depend on ANSI_QUOTES.
mysql-test/r/rpl_do_grant.result:
Adding test case
mysql-test/t/rpl_do_grant.test:
Adding test case
sql/sql_acl.cc:
Using single quotes instead of double quotes,
not to fails when sql_mode=ANSI_QUOTES.
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
mysql-test/r/mysqltest.result:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
sql/handler.cc:
Auto merged
client/mysqltest.c:
Manual merge
- chmod the saved files from 4.1 to make sure they are writable
mysql-test/t/varbinary.test:
As the files saved from 4.1 has been in bk they muight be readonly
Use "chmod" to make sure they are writable
fixed test to replace port to SLAVE_PORT in result file
federated.result:
new result file
mysql-test/t/federated.test:
fixed test to replace port to SLAVE_PORT in result file
mysql-test/r/federated.result:
new result file
into kpdesk.mysql.com:/home/thek/dev/mysql-5.0-maint
sql/sql_parse.cc:
Auto merged
mysql-test/r/rpl_sp.result:
- merged
mysql-test/t/rpl_sp.test:
-merged
prepared statement and subquery.
When a field of a view from an outer select is resolved the find_field_in_view
function creates an Item_direct_view_ref object that references the
corresponding view underlying field. After that the view_ref is marked
as a dependent one. While resolving view underlying field it also get
marked as a dependent one due to current_select still points to the subselect.
Marking the view underlying field is wrong and lead to attaching conditions
to a wrong table and thus to the wrong result of the whole statement.
Now mark_select_range_as_dependent() function isn't called for fields from a
view underlying table.
sql/sql_base.cc:
Bug#20327: Marking of a wrong field leads to a wrong result on select with view, prepared statement and subquery.
Now mark_select_range_as_dependent() function isn't called for fields from a
view underlying table.
mysql-test/r/ps.result:
Added a test case for bug#20327: Marking of a wrong field leads to a wrong result on select with view, prepared statement and subquery.
mysql-test/t/ps.test:
Added a test case for bug#20327: Marking of a wrong field leads to a wrong result on select with view,prepared statement and subquery.
- The table_priv column of table_privs table was altered to a enum type
with fewer enums causing the SHOW/CREATE VIEW grants to be truncated.
- Improved comments and moved all declarations for table_privs, column_privs
and proc_privs to one section for each table making it easy to see hat alterations
are performed on each table
- Reduced the number of ALTER's slightly, but as this is an upgrade script we need
to take all possibilites into account.
scripts/mysql_fix_privilege_tables.sql:
Collect everything for tables_priv, columns_priv and procs_priv in one section for each table
Remove duplicate ALTERS
Remove the ALTERS that truncated "SHOW VIEW" and "CREATE VIEW" from
the enum type for Table_priv.
mysql-test/r/fix_priv_tables.result:
New BitKeeper file ``mysql-test/r/fix_priv_tables.result''
mysql-test/r/fix_priv_tabs.result:
New BitKeeper file ``mysql-test/r/fix_priv_tabs.result''
mysql-test/t/fix_priv_tables.test:
New BitKeeper file ``mysql-test/t/fix_priv_tables.test''
into mysql.com:/usr/home/ram/work/bug22229/my50-bug22229
mysql-test/r/func_time.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
sql/item_timefunc.cc:
Auto merged
into bodhi.local:/opt/local/work/mysql-5.0-runtime
libmysql/libmysql.c:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
mysql-test/t/func_str.test:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/t/wait_for_socket.sh:
Manual merge.
sql/sql_cache.cc:
Manual merge.
This error is displayed anytime the SELECT statement needs a temp table to
return correct results because the object (select_dumpvar) that represents
variables named in the INTO clause stored the results before the temp
table was considered. The problem was fixed by creating the necessary
Item_func_set_user_var objects once the correct data is ready.
mysql-test/r/distinct.result:
Bug#20836 Selecting into variables results in wrong results being returned
- Added results
mysql-test/t/distinct.test:
Bug#20836 Selecting into variables results in wrong results being returned
- Added various Selects that use the INTO statement and a temp table.
- Added Select Into Outfile variant tests also.
sql/sql_class.cc:
Bug#20836 Selecting into variables results in wrong results being returned
- The select_dumpvar variable created a Item_func_set_user_var too early
and once set, it was not possible to change. The Item_func_set_user_var
is now created once the final results are available.
sql/sql_class.h:
Bug#20836 Selecting into variables results in wrong results being returned
- Removed unnecessary object members.
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
BitKeeper/etc/collapsed:
auto-union
BitKeeper/etc/ignore:
auto-union
Makefile.am:
Auto merged
client/mysqltest.c:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/rpl_deadlock.result:
Auto merged
mysql-test/r/udf.result:
Auto merged
mysql-test/t/limit.test:
Auto merged
mysql-test/t/mysql.test:
Auto merged
mysql-test/t/rpl_deadlock.test:
Auto merged
mysql-test/t/udf.test:
Auto merged
mysql-test/mysql-test-run-shell.sh:
Auto merged
mysql-test/t/view_grant.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql-common/my_time.c:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
include/my_sys.h:
Manual merge, my_getpagesize broken out of "#ifdef HAVE_SYS_MMAN_H"
ALTER TABLE DISABLE KEYS doesn't work when modifying the table
ENABLE|DISABLE KEYS combined with another ALTER TABLE option, different
than RENAME TO did nothing. Also, if the table had disabled keys
and was ALTER-ed then the end table was with enabled keys.
Fixed by checking whether the table had disabled keys and enabling them
in the copied table.
myisam/mi_open.c:
Extend mi_indexes_are_disabled to implement return value
2 - Non-unique indexes are disabled
mysql-test/r/alter_table.result:
update result
mysql-test/t/alter_table.test:
update test
sql/sql_table.cc:
When ENABLE|DISABLE index is combined with another option
different than RENAME TO, we should ENABLE|DISABLE the keys of
the modified table. Also when modifying we should preserve the
previous state of the indices.
(This problem exists in 5.0 and 5.1 but since the codebase has
diverged, this fix won't automerge, but the fix will be quite
similar).
statements
Currently the optimizer evaluates loose index scan only for top-level SELECT
statements
Extend loose index scan applicability by :
- Test the applicability of loose scan for each sub-select, instead of the
whole query. This change enables loose index scan for sub-queries.
- allow non-select statements with SELECT parts (like, e.g.
CREATE TABLE .. SELECT ...) to use loose index scan.
mysql-test/r/group_min_max.result:
Bug#24156: Loose index scan not used with CREATE TABLE ...SELECT and similar
statements
- test case
mysql-test/t/group_min_max.test:
Bug#24156: Loose index scan not used with CREATE TABLE ...SELECT and similar
statements
- test case
sql/opt_range.cc:
Bug#24156: Loose index scan not used with CREATE TABLE ...SELECT and similar
statements
- loose index scan will be tried over the current subselect
(lex->current_select) instead of the whole query (lex->select_lex).
- allow non-select statements with SELECT parts (like, e.g.
CREATE TABLE .. SELECT ...) to use loose index scan.
- CREATE PROCEDURE stores database name based on query context instead
of 'current database' as set by 'USE' according to manual.
The bug reporter interpret the filtering statements as bug for
DROP PROCEDURE based on this behavior.
- Removed the code which changes db context.
- Added code to check that a valid db was supplied.
mysql-test/r/rpl_sp.result:
- Added test case (result)
mysql-test/t/rpl_sp.test:
- Added test case
sql/sp.cc:
- Removed code for changing current db context.
sql/sql_parse.cc:
- Added code to check if a valid db was supplied.
into rakia.gmz:/home/kgeorge/mysql/autopush/B11927-5.0-opt
mysql-test/r/func_gconcat.result:
Auto merged
sql/field.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_func.h:
Auto merged
sql/item_subselect.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/sql_string.h:
Auto merged
When implicitly converting string fields to numbers the
string-to-number conversion error was not sent to the client.
Added code to send the conversion error as warning.
We also need to prevent generation of warnings from the places
where val_xxx() methods are called for the sole purpose of updating
the Item::null_value flag.
To achieve that a special function is added (and called) :
update_null_value(). This function will set the no_errors flag and
will call val_xxx(). The warning generation in Field_string::val_xxx()
will use the flag when generating the conversion warnings.
mysql-test/r/compare.result:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- non-convertible strings in arithmetic operations
mysql-test/r/func_gconcat.result:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- non-convertible strings in arithmetic operations
mysql-test/r/func_group.result:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- non-convertible strings in arithmetic operations
mysql-test/r/type_varchar.result:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- test case
mysql-test/t/type_varchar.test:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- test case
sql/field.cc:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- send conversion warning to the client
sql/item.cc:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- send conversion warning to the client
sql/item.h:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- added a special function to explicitly update the null_value
sql/item_func.h:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- added a special function to explicitly update the null_value
sql/item_subselect.h:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- added a special function to explicitly update the null_value
sql/item_sum.cc:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- added a special function to explicitly update the null_value
sql/item_sum.h:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- added a special function to explicitly update the null_value
sql/sql_string.h:
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
- send conversion warning to the client
Problem: when loading mysqlbinlog dumps, CREATE PROCEDURE having semicolons
in their bodies failed.
Fix: Using safe delimiter "/*!*/;" to dump log entries.
client/mysqlbinlog.cc:
- Adding PRINT_EVENT_INFO argument to dump_xxx_log_entries()
- Setting delimiter to "/*!*/;" before calling dump functions
mysql-test/r/ctype_ucs_binlog.result:
Fixing test results
mysql-test/r/mix_innodb_myisam_binlog.result:
Fixing test results
mysql-test/r/mysqlbinlog.result:
Fixing test results
Adding test case
mysql-test/r/mysqlbinlog2.result:
Fixing test results
mysql-test/r/rpl_charset.result:
Fixing test results
mysql-test/r/rpl_timezone.result:
Fixing test results
mysql-test/r/user_var-binlog.result:
Fixing test results
mysql-test/t/mix_innodb_myisam_binlog.test:
Fixing LIKE expression
mysql-test/t/mysqlbinlog.test:
Adding test case
sql/log_event.cc:
Using print_event_info->delimiter instead of
hard-coded semicolon as a query end marker.
sql/log_event.h:
Adding new member to store delimiter.
Initialize key_part->type on open. This caused key_copy() to fail for bit_fields. (key_copy is used in HANDLER and opt_range)
include/heap.h:
Increased heap max length to > 4G for 64 bit machines
mysql-test/r/show_check.result:
Updated results after heap size change
mysql-test/r/type_bit.result:
Added test for bug in bit field handling (in handler and opt_range.cc)
mysql-test/t/type_bit.test:
Added test for bug in bit field handling (in handler and opt_range.cc)
sql/ha_heap.cc:
Increased heap max length to > 4G for 64 bit machines
sql/item_sum.cc:
Increased heap max length to > 4G for 64 bit machines
sql/mysqld.cc:
Increased heap max length to > 4G for 64 bit machines
sql/set_var.cc:
Increased heap max length to > 4G for 64 bit machines
sql/sql_class.h:
Increased heap max length to > 4G for 64 bit machines
sql/sql_select.cc:
Increased heap max length to > 4G for 64 bit machines
sql/table.cc:
Initialize key_part->type ; This was used for bit fields but only set in temporary tables
sql/uniques.cc:
Increased heap max length to > 4G for 64 bit machines
into shakedown.(none):/home/jpipes/dev/mysql-5.0-maint
BitKeeper/etc/ignore:
auto-union
client/mysql.cc:
Auto merged
mysql-test/r/func_misc.result:
Auto merged
sql/item_func.h:
Auto merged
mysql-test/r/mysql.result:
Manual merge
mysql-test/t/mysql.test:
Manual merge
master_port after a "change master" will be set to the compiled in default value
i.e not always the same as what the master report as it's port number.
mysql-test/mysql-test-run.pl:
Read the master-port value from the mysqld. Used for replacing the
default compiled in port number in for example rpl000015
mysql-test/r/rpl000015.result:
Update result file
mysql-test/t/rpl000015.test:
When changing master without specifying master port, the port for master will
be set to the compiled in default. Replace with that value
When calculating a SEL_TREE for the "c_{i-1} < X < c_i" interval, check if the tree returned for the "-inf < X < c_0" interval is NULL
mysql-test/r/func_in.result:
Added testcase for bug #24261 "crash when WHERE contains NOT IN ('<negative value>') for unsigned column type"
mysql-test/t/func_in.test:
Added testcase for bug #24261 "crash when WHERE contains NOT IN ('<negative value>') for unsigned column type"
sql/opt_range.cc:
When calculating a SEL_TREE for the "c_{i-1} < X < c_i" interval, check if the tree returned for the "-inf < X < c_0" interval is NULL
into dl145s.mysql.com:/data0/bk/team_tree_merge/MERGE/mysql-5.0-opt
libmysql/libmysql.c:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/type_newdecimal.test:
Auto merged
sql/filesort.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.cc:
Auto merged
sql-common/my_time.c:
Auto merged
strings/decimal.c:
Auto merged
If a view was created with the DEFINER security and later the definer user
was dropped then a SELECT from the view throws the error message saying that
there is no definer user is registered. This is ok for a root but too much
for a mere user.
Now the st_table_list::prepare_view_securety_context() function reveals
the absence of the definer only to a superuser and throws the 'access denied'
error to others.
mysql-test/t/view_grant.test:
Added a test case for bug#17254: Error for DEFINER security on VIEW provides too much info
mysql-test/r/view_grant.result:
Added a test case for bug#17254: Error for DEFINER security on VIEW provides too much info
sql/table.cc:
Bug#17254: Error for DEFINER security on VIEW provides too much info
Now the st_table_list::prepare_view_securety_context() function reveals
the absence of the definer only to a superuser and throws the 'access denied'
error to others.
into neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
mysql-test/Makefile.am:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
sql-common/my_time.c:
Auto merged
sql/item_timefunc.cc:
Auto merged
mysql-test/mysql-test-run-shell.sh:
Auto merged
mysql-test/mysql-test-run.pl:
Manual merge of changes for RPM
fails randomly.
The problem was that the test case used command line tool (mysql)
without specifying connect_timeout argument. In some cases,
this lead to hanging of the test case.
The fix is to specify --connect_timeout=1 when starting mysql.
Also, the patch contains polishing and various cleanups to simplify
analyzing of the problems further.
The patch affects only test suite, no server codebase has been
touched.
mysql-test/lib/mtr_im.pl:
Remember PID of the IM-spawner -- a process, that is
used to fork IM-angel.
mysql-test/lib/mtr_io.pl:
Trim \n from the PID.
mysql-test/lib/mtr_process.pl:
Don't complain if it was IM-spawner, who died.
mysql-test/r/im_daemon_life_cycle.result:
Update the result file.
mysql-test/r/im_life_cycle.result:
Update the result file.
mysql-test/t/im_daemon_life_cycle.imtest:
Polishing: add more comments, be more verbose.
mysql-test/t/im_life_cycle.imtest:
Polishing: be more verbose.
mysql-test/t/im_utils.imtest:
Polishing: be more verbose.
mysql-test/t/kill_n_check.sh:
Log messages to the extrenal file so that they can be analyzed
if test case failed.
mysql-test/t/wait_for_process.sh:
Log messages to the extrenal file so that they can be analyzed
if test case failed.
mysql-test/t/wait_for_socket.sh:
Log messages to the extrenal file so that they can be analyzed
if test case failed.
mysql-test/t/log.sh:
Dummy script to facilitate logging from test-scripts.
mysql-test/t/utils.sh:
A bunch of auxilary functions to facilitate logging.
Load shared libraries from zlib (fixed that mysql-test-run.pl didn't work on some Solaris boxes)
Added connect timeout to test to make im_daemon_life_cycle more predictable
mysql-test/mysql-test-run.pl:
Added option --mtr-build-thread
Load shared libraries from zlib (fixed that mysql-test-run.pl didn't work on some Solaris boxes)
mysql-test/t/wait_for_socket.sh:
Added connect timeout (to make test predictable)
into mysql.com:/usr/home/ram/work/bug22029/my41-bug22029
mysql-test/r/date_formats.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
sql/item_timefunc.cc:
Auto merged
into mysql.com:/usr/home/ram/work/bug22029/my50-bug22029
mysql-test/r/date_formats.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
sql/item_timefunc.cc:
Auto merged
- Use more appropriate test case.
mysql-test/r/mysql.result:
Bug#19799 delimiter command not working correctly when sourcing a sql file
- Alt. Result.
mysql-test/t/mysql_delimiter.sql:
Bug#19799 delimiter command not working correctly when sourcing a sql file
- Alt. Test
into mysql.com:/usr/home/ram/work/bug22029/my50-bug22029
mysql-test/r/date_formats.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
sql/item_timefunc.cc:
merging
- Client side readline functions unconditionally search for Unix '\n' line
endings. In this case, the delimiter statement was set to '//\r' instead
of the intended '//'. When removing the '\n' check for and remove
preceeding '\r' character as well.
client/readline.cc:
Bug#19799 delimiter command not working correctly when sourcing a sql file
- When removing the '\n' character, check for and remove preceeding '\r'
character as well.
mysql-test/r/mysql.result:
Bug#19799 delimiter command not working correctly when sourcing a sql file
- Added Results.
mysql-test/t/mysql_delimiter.sql:
Bug#19799 delimiter command not working correctly when sourcing a sql file
- Added Tests.
mysql-test/t/mysql_delimiter_19799.sql:
Bug#19799 delimiter command not working correctly when sourcing a sql file
- File containing delimiter statement followed by '\r\n' line ending.
mysql_fix_privilege_tables.s's ability to convert the system tables as of
3.20 to current system table format
Add similar test for 4.1.23 tables - but use "mysql < mysql_fix_privilege_tables.sql"
so it can be run on any platform.
mysql-test/t/system_mysql_db_fix30020-master.opt:
Rename: mysql-test/t/system_mysql_db_fix-master.opt -> mysql-test/t/system_mysql_db_fix30020-master.opt
mysql-test/mysql-test-run.pl:
Find mysql_fix_privilege_tables.sql and assign it's path and name to $MYSQL_FIX_PRIVILEGE_TABLES
mysql-test/t/system_mysql_db_fix30020.test:
Send output to var/log/system_mysql_db_fix30020.err
Add some more comments
mysql-test/t/system_mysql_db_fix40123-master.opt:
New BitKeeper file ``mysql-test/t/system_mysql_db_fix40123-master.opt''
mysql-test/t/system_mysql_db_fix40123.test:
New BitKeeper file ``mysql-test/t/system_mysql_db_fix40123.test''
mysql-test/r/ps.result:
Fix after manual merge: update for different error message.
mysql-test/t/ps.test:
Fix after manual merge: use right error codes.
Make Prepared_stmt_count a global status variable, accessible via
SHOW STATUS LIKE 'Prepared_stmt_count';. Documentation should be
updated.
mysql-test/r/ps.result:
Update result for bug#16365: Prepared Statements: DoS with too many
open statements, according to bug#23159: prepared_stmt_count should be
status variable.
mysql-test/t/ps.test:
Update test case for bug#16365: Prepared Statements: DoS with too many
open statements, according to bug#23159: prepared_stmt_count should be
status variable.
sql/mysqld.cc:
Add Prepared_stmt_count as global status variable.
sql/set_var.cc:
Remove prepared_stmt_count as system variable.
disable filling of I_S tables for EXPLAIN
mysql-test/r/information_schema.result:
Bug#22413 EXPLAIN SELECT FROM view with ORDER BY yield server crash
test case
mysql-test/t/information_schema.test:
Bug#22413 EXPLAIN SELECT FROM view with ORDER BY yield server crash
test case
This is the 5.0 part of the fix.
Currently TRUNCATE command will not call
delete_all_rows() in the handler (that implements
the "fast" TRUNCATE for InnoDB) when there are
triggers on the table.
As decided by the architecture team TRUNCATE must
use "fast" TRUNCATE even when there are triggers.
Thus it must ignore the triggers.
Made TRUNCATE to ignore the triggers and call
delete_all_rows() for all storage engines
to maintain engine consistency.
mysql-test/r/trigger.result:
Bug#23556: TRUNCATE TABLE still maps to DELETE
- test case
mysql-test/t/trigger.test:
Bug#23556: TRUNCATE TABLE still maps to DELETE
- test case
sql/sql_delete.cc:
Bug#23556: TRUNCATE TABLE still maps to DELETE
- We implemenent fast TRUNCATE for InnoDB even
if triggers are present.
- TRUNCATE ignores triggers.
into mysql.com:/home/my/mysql-5.0
mysql-test/t/ctype_ucs.test:
Auto merged
sql/log_event.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/sql_select.cc:
Auto merged
Do not issue a 'read-only' error in case of DROP TEMPORARY TABLE on a non-existing temporary table.
Instead produce the correct "Unknown table" error or warning (in cases when the IF EXISTS clause was specified).
To a documentor: the part of the manual describing the 'read_only' system variable should be clarified to state the following:
"When the read_only variable is set to ON, all operations which create/update/drop tables are rejected with the exceptions for:
1. Any operation performed by the replication thread on a slave server
2. Any operation performed by a user that have the SUPER privilege
3. Any operation that creates/updates/drops only temporary tables"
mysql-test/r/read_only.result:
Added testcases for bug #22077 "DROP TEMPORARY TABLE fails with wrong error if read_only is set"
mysql-test/t/read_only.test:
Added testcases for bug #22077 "DROP TEMPORARY TABLE fails with wrong error if read_only is set"
sql/sql_parse.cc:
Before issuing the 'read-only' error also check if the operation is not a DROP TEMPORARY TABLE statement
into mysql.com:/usr/home/bar/mysql-5.0.b22646
mysql-test/t/ctype_utf8.test:
Auto merged
mysql-test/r/ctype_utf8.result:
After merge fix
sql/item_timefunc.cc:
After merge fix
limitation)
Note to the reviewer
====================
Warning: reviewing this patch is somewhat involved.
Due to the nature of several issues all affecting the same area,
fixing separately each issue is not practical, since each fix can not be
implemented and tested independently.
In particular, the issues with
- rule recursion
- nested case statements
- forward jump resolution (backpatch list)
are tightly coupled (see below).
Definitions
===========
The expression
CASE expr
WHEN expr THEN expr
WHEN expr THEN expr
...
END
is a "Simple Case Expression".
The expression
CASE
WHEN expr THEN expr
WHEN expr THEN expr
...
END
is a "Searched Case Expression".
The statement
CASE expr
WHEN expr THEN stmts
WHEN expr THEN stmts
...
END CASE
is a "Simple Case Statement".
The statement
CASE
WHEN expr THEN stmts
WHEN expr THEN stmts
...
END CASE
is a "Searched Case Statement".
A "Left Recursive" rule is like
list:
element
| list element
;
A "Right Recursive" rule is like
list:
element
| element list
;
Left and right recursion produces the same language, the difference only
affects the *order* in which the text is parsed.
In a descendant parser (usually written manually), right recursion works
very well, and is typically implemented with a while loop.
In an ascendant parser (yacc/bison) left recursion works very well,
and is implemented naturally by the parser stack.
In both cases, using the wrong type or recursion is very bad and should be
avoided, as it causes technical issues with the parser implementation.
Before this change
==================
The "Simple Case Expression" and "Searched Case Expression" were both
implemented by the "when_list" and "when_list2" rules, which are left
recursive (ok).
These rules, however, used lex->when_list instead of using the parser stack,
which is more complex that necessary, and potentially dangerous because
of other rules using THD::reset_lex.
The "Simple Case Statement" and "Searched Case Statements" were implemented
by the "sp_case", "sp_whens" and in part by "sp_proc_stmt" rules.
Both cases were right recursive (bad).
The grammar involved was convoluted, and is assumed to be the results of
tweaks to get the code generation to work, but is not what someone would
naturally write.
In addition, using a common rule for both "Simple" and "Searched" case
statements was implemented with sp_head::m_flags |= IN_SIMPLE_CASE,
which is a flag and not a stack, and therefore does not take into account
*nested* case statements. This leads to incorrect generated code, and either
a server crash or an incorrect result.
With regards to the backpatch mechanism, a *different* backpatch list was
created for each jump from "WHEN expr THEN stmt" to "END CASE", which
relied on the grammar to be right recursive.
This is a mis-use of the backpatch list, since this list can resolve
multiple references to the same target at once.
The optimizer algorithm used to detect dead code in the "assembly" SQL
instructions, implemented by sp_head::opt_mark(uint ip), was recursive
in some cases (a conditional jump pointing forward to another conditional
jump).
In case of specially crafted code, like
- a long list of "IF expr THEN stmt END IF"
- a long CASE statement
this would actually cause a server crash with a stack overflow.
In general, having a stack that grows proportionally with user data (the
SQL code given by the client in a CREATE PROCEDURE) is to be avoided.
In debug builds only, creating a SP / SF / Trigger which had a significant
amount of code would spend --literally-- several minutes in sp_head::create,
because of the debug code involved with DBUG_PRINT("info", ("Code %s ...
There are several issues with this code:
- in a CASE with 5 000 WHEN, there are 15 000 instructions generated,
which create a sting representation of the code which is 500 000 bytes
long,
- using a String instead of an io stream causes performances to degrade
to a total server freeze, as time is spent doing realloc of a buffer
always too short,
- Printing a 500 000 long string in the debug log is too verbose,
- Generating this string even when DBUG_PRINT is off is useless,
- Having code that potentially can affect the server behavior, used with
#ifdef / #endif is useful in some cases, but is also a bad practice.
After this change
=================
"Case Expressions" (both simple and searched) have been simplified to
not use LEX::when_list, which has been removed.
Considering all the issues affecting case statements, the grammar for these
has been totally re written.
The existing actions, used to generate "assembly" sp_inst* code, have been
preserved but moved in the new grammar, with the following changes:
a) Bison rules are no longer shared between "Simple" and "Searched" case
statements, because a stack instead of a flag is required to handle them.
Nested statements are handled naturally by the parser stack, which by
definition uses the correct rule in the correct context.
Nested statements of the opposite type (simple vs searched) works correctly.
The flag sp_head::IN_SIMPLE_CASE is no longer used.
This is a step towards resolution of WL#2999, which correctly identified
that temporary parsing flags do not belong to sp_head.
The code in the action is shared by mean of the case_stmt_action_xxx()
helpers.
b) The backpatch mechanism, used to resolve forward jumps in the generated
code, has been changed to:
- create a label for the instruction following 'END CASE',
- register each jump at the end of a "WHEN expr THEN stmt" in a *unique*
backpatch list associated with the 'END CASE' label
- resolve all the forward jumps for this label at once.
In addition, the code involving backpatch has been commented, so that a
reader can now understand by reading matching "Registering" and "Resolving"
comments how the forward jumps are resolved and what target they resolve to,
as this is far from evident when reading the code alone.
The implementation of sp_head::opt_mark() has been revised to avoid
recursive calls from jump instructions, and instead add the jump location
to the list of paths to explore during the flow analysis of the instruction
graph, with a call to sp_head::add_mark_lead().
In addition, the flow analysis will stop if an instruction has already
been marked as reachable, which the previous code failed to do in the
recursive case.
sp_head::opt_mark() is now private, to prevent new calls to this method from
being introduced.
The debug code present in sp_head::create() has been removed.
Considering that SHOW PROCEDURE CODE is also available in debug builds,
and can be used anytime regardless of the trace level, as opposed to
"CREATE PROCEDURE" time and only if the trace was on,
removing the code actually makes debugging easier (usable trace).
Tests have been written to cover the parser overflow (big CASE),
and to cover nested CASE statements.
mysql-test/r/sp-code.result:
Test cases for nested CASE statements.
mysql-test/t/sp-code.test:
Test cases for nested CASE statements.
sql/sp_head.cc:
Re factored opt_mark() to avoid recursion, clean up.
sql/sp_head.h:
Re factored opt_mark() to avoid recursion, clean up.
sql/sql_lex.cc:
Removed when_list.
sql/sql_lex.h:
Removed when_list.
sql/sql_yacc.yy:
Minor clean up for case expressions,
Major re write for case statements (Bug#19194).
mysql-test/r/sp_stress_case.result:
New test for massive CASE statements.
mysql-test/t/sp_stress_case.sh:
New test for massive CASE statements.
mysql-test/t/sp_stress_case.test:
New test for massive CASE statements.
into mysql.com:/home/hf/work/mysql-5.0-0mrg
BitKeeper/deleted/.del-mysql_client.test:
Auto merged
include/mysql.h:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
mysql-test/r/order_by.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/type_newdecimal.result:
Auto merged
mysql-test/t/flush.test:
Auto merged
mysql-test/t/flush_block_commit.test:
Auto merged
mysql-test/t/innodb-deadlock.test:
Auto merged
mysql-test/t/innodb-lock.test:
Auto merged
mysql-test/t/lock_multi.test:
Auto merged
mysql-test/t/mysql.test:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
mysql-test/t/rename.test:
Auto merged
mysql-test/t/show_check.test:
Auto merged
mysql-test/t/status.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/type_newdecimal.test:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/handler.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_subselect.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/protocol.cc:
Auto merged
sql/protocol.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql-common/client.c:
Auto merged
sql-common/my_time.c:
Auto merged
Makefile.am:
merging
client/mysqltest.c:
merging
include/my_time.h:
merging
libmysql/libmysql.c:
merging
mysql-test/t/order_by.test:
merging
into mysql.com:/home/hf/work/mysql-4.1-mrg
include/mysql.h:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/rename.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_class.h:
Auto merged
Makefile.am:
merging
client/mysqltest.c:
merging
mysql-test/t/mysql_client.test:
merging
There was an improper order of doing chained operations.
To the documentor: ENABLE|DISABLE KEYS combined with RENAME TO, and no other
ALTER TABLE clause, leads to server crash independent of the presence of
indices and data in the table.
mysql-test/r/alter_table.result:
update result
mysql-test/t/alter_table.test:
add test for bug#24129
sql/sql_table.cc:
If there is operation on the KEYS, first do it
and then do a rename if there is such. Or, we will crash because
the underlying table has changed.
into mysql.com:/usr/home/ram/work/bug23653/my50-bug23653
mysql-test/r/func_time.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
sql/item_timefunc.cc:
Auto merged
mysql-test/r/func_str.result:
Add result for bug#17047: CHAR() and IN() can return NULL without
signaling NULL result.
mysql-test/t/func_str.test:
Add test case for bug#17047: CHAR() and IN() can return NULL without
signaling NULL result.
sql/item_strfunc.cc:
Add Item_str_func::fix_fields() implementation, and set maybe_null to
TRUE if we are in the SQL mode that requires some functions to return
null even if they normally do not.
sql/item_strfunc.h:
Add declaration of Item_str_func::fix_fields().
Do not reset maybe_null in Item_func_char::fix_length_and_dec().
The problem was that some functions (namely IN() starting with 4.1, and
CHAR() starting with 5.0) were returning NULL in certain conditions,
while they didn't set their maybe_null flag. Because of that there could
be some problems with 'IS NULL' check, and statements that depend on the
function value domain, like CREATE TABLE t1 SELECT 1 IN (2, NULL);.
The fix is to set maybe_null correctly.
mysql-test/r/func_in.result:
Add result for bug#17047: CHAR() and IN() can return NULL without
signaling NULL result.
mysql-test/t/func_in.test:
Add test case for bug#17047: CHAR() and IN() can return NULL without
signaling NULL result.
sql/item_cmpfunc.cc:
Remove assignment to maybe_null, as it was already set in fix_fields()
based on all arguments, not only on the first.
- Added 'SET NAMES <charset>" upon ::open
- Added test and results for simple UTF test
federated.test:
BUG #17044 Federated Storage Engine not UTF8 clean
New test. Using hex - pasting various charsets in the terminal doesn't work.
federated.result:
BUG# 17044 Federated Storage Engine not UTF8 clean
New test results
ha_federated.cc:
BUG# 17044 Federated Storage Engine not UTF8 clean
Upon ::open, set names to table's charset
sql/ha_federated.cc:
BUG# 17044 Federated Storage Engine not UTF8 clean
Upon ::open, set names to table's charset
mysql-test/t/federated.test:
BUG #17044 Federated Storage Engine not UTF8 clean
New test. Using hex - pasting various charsets in the terminal doesn't work.
federated.result:
BUG# 17044 Federated Storage Engine not UTF8 clean
New test results
mysql-test/r/federated.result:
BUG# 17044 Federated Storage Engine not UTF8 clean
New test results
Problem: When we have a really large number (between 2^63 and 2^64)
as the left side of the mod operator, it gets improperly corerced
into a signed value.
Solution: Added check to see if the "negative" number is really
positive, and if so, cast it.
mysql-test/r/bigint.result:
Added test case result
mysql-test/t/bigint.test:
Added test case
sql/item_func.cc:
Added check to see if we have an unsigned number that looks like a
signed number.
mending windows test.
mysql-test/r/rpl_packet.result:
results changed
mysql-test/t/rpl_packet.test:
removing because of the connection with windows client can be lost instead of
the error code back (source: manual).
mysql-test/r/init_connect.result:
Restore global variable to the value it's set to when server is started
mysql-test/r/key_cache.result:
Restore global variable values to original
mysql-test/r/mysqldump.result:
Drop the user that was created. Specifying "drop user myDB_user" is equal to "drop user myDB_user@%"
mysql-test/r/rpl_deadlock.result:
Restore global variable values to original
mysql-test/r/rpl_drop_db.result:
Remove the conflicting file and drop database mysqltest1 before test exits
mysql-test/r/rpl_ignore_revoke.result:
As changes to mysql.* are ignored - explicitly delete the user on slave
mysql-test/r/rpl_init_slave.result:
Restore global variable values to original
mysql-test/r/rpl_max_relay_size.result:
Restore global variable values to original
mysql-test/r/rpl_sp.result:
Restore global variable values to original
mysql-test/r/rpl_timezone.result:
Restore global variable values to original
mysql-test/r/rpl_variables.result:
Restore global variable values to original
mysql-test/r/view_grant.result:
Use same user in all places in the same test "readonly" is equal to "readonly@%" not "readonly@localhost"
mysql-test/t/init_connect.test:
Restore global variable to the value it's set to when server is started
mysql-test/t/key_cache.test:
Restore global variable values to original
mysql-test/t/mysqldump.test:
Drop the user that was created. Specifying "drop user myDB_user" is equal to "drop user myDB_user@%"
mysql-test/t/rpl_deadlock.test:
Restore global variable values to original
mysql-test/t/rpl_drop_db.test:
Remove the conflicting file and drop database mysqltest1 before test exits
mysql-test/t/rpl_ignore_revoke.test:
As changes to mysql.* are ignored - explicitly delete the user on slave
mysql-test/t/rpl_init_slave.test:
Restore global variable values to original
mysql-test/t/rpl_max_relay_size.test:
Restore global variable values to original
mysql-test/t/rpl_sp.test:
Restore global variable values to original
mysql-test/t/rpl_timezone.test:
Restore global variable values to original
mysql-test/t/rpl_variables.test:
Restore global variable values to original
mysql-test/t/view_grant.test:
Use same user in all places in the same test "readonly" is equal to "readonly@%" not "readonly@localhost"
mysql-test/r/limit.result:
Add missing drop of table t1
mysql-test/r/lowercase_fs_off.result:
Add missing drop of "sample" user
mysql-test/t/limit.test:
Add missing drop of table t1
mysql-test/t/lowercase_fs_off.test:
Add missing drop of "sample" user
The problem was that THD::row_count_func was zeroed too. It was zeroed
as a fix for bug 4905 "Stored procedure doesn't clear for "Rows affected"
However, the proper solution is not to zero, because THD::row_count_func has
been set to -1 already in mysql_execute_command(), a later fix, which obsoletes
the incorrect fix of #4095
mysql-test/r/sp.result:
update result
mysql-test/t/sp.test:
test for bug#23760 ROW_COUNT() and store procedure not owrking together
sql/sql_parse.cc:
Remove zeroing for thd->row_count_func
The fix for #4905 wasn't right. Now, it's ok without this zeroing
because if there was an error THD::
The regression is caused by the fix for bug 14767. When INSERT ... SELECT
used a view in the SELECT list that was not inlined, and there was an
active transaction, the server could crash in Query_cache::invalidate.
On INSERT ... SELECT only the table being inserted into is invalidated.
Thus views that can't be inlined are skipped from invalidation.
The bug manifests itself in two ways so there is 2 test cases.
One checks that the only the table being inserted into is invalidated.
And the second one checks that there is no crash on INSERT ... SELECT.
mysql-test/t/query_cache.test:
Added a test case for bug#20045: Server crash on INSERT ... SELECT ... FROM non-mergeable view
mysql-test/r/query_cache.result:
Added a test case for bug#20045: Server crash on INSERT ... SELECT ... FROM non-mergeable view
sql/sql_parse.cc:
Bug#20045: Server crash on INSERT ... SELECT ... FROM non-mergeable view
On INSERT ... SELECT only the table being inserted into is invalidated.
This change set implements the DROP TRIGGER IF EXISTS functionality.
This fix is considered a bug and not a feature, because without it,
there is no known method to write a database creation script that can create
a trigger without failing, when executed on a database that may or may not
contain already a trigger of the same name.
Implementing this functionality closes an orthogonality gap between triggers
and stored procedures / stored functions (which do support the DROP IF
EXISTS syntax).
In sql_trigger.cc, in mysql_create_or_drop_trigger,
the code has been reordered to:
- perform the tests that do not depend on the file system (access()),
- get the locks (wait_if_global_read_lock, LOCK_open)
- call access()
- perform the operation
- write to the binlog
- unlock (LOCK_open, start_waiting_global_read_lock)
This is to ensure that all the code that depends on the presence of the
trigger file is executed in the same critical section,
and prevents race conditions similar to the case fixed by Bug 14262 :
- thread 1 executes DROP TRIGGER IF EXISTS, access() returns a failure
- thread 2 executes CREATE TRIGGER
- thread 2 logs CREATE TRIGGER
- thread 1 logs DROP TRIGGER IF EXISTS
The patch itself is based on code contributed by the MySQL community,
under the terms of the Contributor License Agreement (See Bug 18161).
mysql-test/r/rpl_trigger.result:
DROP TRIGGER IF EXISTS
mysql-test/r/trigger.result:
DROP TRIGGER IF EXISTS
mysql-test/t/rpl_trigger.test:
DROP TRIGGER IF EXISTS
mysql-test/t/trigger.test:
DROP TRIGGER IF EXISTS
sql/sql_trigger.cc:
DROP TRIGGER IF EXISTS
sql/sql_yacc.yy:
DROP TRIGGER IF EXISTS
The code that set up data to be passed to user-defined functions was very
old and analyzed the "Type" of the data that was passed into the UDF, when
it really should analyze the "return_type", which is hard-coded for simple
Items and works correctly for complex ones like functions.
---
Added test at Sergei's behest.
mysql-test/r/udf.result:
Verify that various arguments work.
---
Added test at Sergei's behest.
mysql-test/t/udf.test:
Verify that various arguments work.
---
Added test at Sergei's behest.
sql/item_func.cc:
For function-Items, test whether it is constant and set the struct members
for the UDF parameter appropriately.
Replace tabs with spaces in affected code.
sql/udf_example.c:
Include a simple function that is useful in testing.
into mysql.com:/home/bk/MERGE/mysql-5.0-merge
BitKeeper/triggers/post-commit:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_sum.cc:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/log_event.h:
Manual merge
sql/slave.cc:
Manual merge
libmysqld/lib_sql.cc:
check for bootstrap added
mysql-test/include/federated.inc:
disabled in embedded
mysql-test/mysql-test-run.pl:
we disable ssh in embedded server
mysql-test/r/bdb.result:
part moved to bdb_notembedded as it uses binlog
mysql-test/r/flush_block_commit.result:
part moved to flush_block_commit_notembedded
mysql-test/r/insert.result:
part moved to insert_notembedded as delayed works differently in embedded server
mysql-test/r/insert_select.result:
part moved to insert_notembedded as GRANTS usually disabled in embedded server
mysql-test/r/join.result:
access rights hidden in result
mysql-test/t/backup.test:
now available in embedded server
mysql-test/t/bdb.test:
part moved to bdb_notembedded as it uses binlog
mysql-test/t/delayed.test:
code trimmed
mysql-test/t/execution_constants.test:
skipped in embedded-server mode
mysql-test/t/flush_block_commit.test:
moved to flush_block_commit_notembedded
mysql-test/t/information_schema_db.test:
skipped in embedded-server
mysql-test/t/innodb.test:
directories replaced to be embedded-server compliant
mysql-test/t/insert.test:
part moved to insert_notembedded
mysql-test/t/insert_select.test:
part moved to insert_notembedded
mysql-test/t/join.test:
access rights hidden
mysql-test/t/status.test:
skipped in embedded server
mysql-test/t/trigger.test:
directories replaced to be embedded-server compliant
sql/item_strfunc.cc:
extra contexts not needed whan access checks disabled
sql/share/errmsg.txt:
bigger paths reserved to prevent test's fails
mysql-test/r/bdb_notembedded.result:
***MISSING WEAVE***
mysql-test/r/flush_block_commit_notembedded.result:
added
mysql-test/r/insert_notembedded.result:
added
mysql-test/t/bdb_notembedded.test:
***MISSING WEAVE***
mysql-test/t/flush_block_commit_notembedded.test:
added
mysql-test/t/insert_notembedded.test:
added
Add new test file mysql_upgrade.test
BitKeeper/deleted/.del-abi_check.ic:
Rename: include/abi_check.ic -> BitKeeper/deleted/.del-abi_check.ic
client/mysql_upgrade.c:
Make mysql_upgrade search also in "client" dir so it can be run from a source dist.
mysql-test/mysql-test-run.pl:
Make it possible for .test scripts to run "mysql_upgrade"
mysql-test/r/mysql_upgrade.result:
New BitKeeper file ``mysql-test/r/mysql_upgrade.result''
mysql-test/t/mysql_upgrade.test:
New BitKeeper file ``mysql-test/t/mysql_upgrade.test''
The server sends a number of columns to the client.
It uses a limited "fast" function for that instead of the
general one. This fast function cannot send numbers larger
than 2 bytes.
This causes the client to expect smaller number of columns.
The client writes outside of the allocated memory buffer
as a result.
Fixed the server to use the general function to send column
count.
Fixed the client to check the column count before writing
column data.
mysql-test/t/mysql_client.test:
Bug #19216: Client crashes on long SELECT
- test case
sql/protocol.cc:
Bug #19216: Client crashes on long SELECT
- renamed the function for bether comprehention
and made it local
- used the right (non-local) function to transfer
the column count in Protocol::send_fields
sql/protocol.h:
Bug #19216: Client crashes on long SELECT
- made optimized net_store_length local
sql-common/client.c:
Bug #19216: Client crashes on long SELECT
- fixed the client to check for older servers (without the fix).
stored function invoked from different connections".
Invocation of trigger which was using stored function from different
connections caused server crashes (for non-debug server this happened
in highly concurrent environment, but debug server failed on assertion
in relatively simple scenario).
Item_func_sp was not safe to use in triggers (in other words for
re-execution from different threads) as artificial TABLE object
pointed by Item_func_sp::dummy_table referenced incorrect THD
object. To fix the problem we force re-initialization of this
object for each re-execution of statement.
mysql-test/r/trigger.result:
Added test for bug#23651 "Server crashes when trigger which uses
stored function invoked from different connections".
mysql-test/t/trigger.test:
Added test for bug#23651 "Server crashes when trigger which uses
stored function invoked from different connections".
sql/item_func.cc:
To make Item_func_sp safe for usage in triggers (in other words safe
for re-execution in different threads) we need to ensure that artificial
TABLE object pointed by Item_func_sp::dummy_table references correct
THD object. To achieve this we simply force its re-initialization for
each re-execution of statement.
libmysqld/examples/test-run:
mysql_embedded should be run here
libmysqld/lib_sql.cc:
thd->real_id setup added
bootstrap check added
mysql-test/t/innodb.test:
paths can be different in embedded server - replace_result added
sql/item_func.cc:
we should compare real_id-s in embedded server
into bodhi.local:/opt/local/work/mysql-5.0-runtime
configure.in:
Auto merged
include/my_time.h:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/rename.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
Auto merged
sql-common/my_time.c:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/time.cc:
Auto merged
mysql-test/t/rename.test:
Use local (resolve a conflict)
into trift2.:/MySQL/M50/push-5.0
BitKeeper/deleted/.del-gcc.cpp~3d2e013cfac48838:
Auto merged
configure.in:
Auto merged
include/my_time.h:
Auto merged
mysql-test/install_test_db.sh:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/rename.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/rename.test:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql-common/my_time.c:
Auto merged
sql/time.cc:
Auto merged
myisam/sort.c:
Manual merge: "use local" (= 5.0 version).
mysql-test/mysql-test-run.pl:
Manual merge, part of the fix for bug#17194.
- Add printout of "Warning" or "Note" for non error messages in default_reporter
- Add test for the above in new mysqladmin.test
mysql-test/mysql-test-run.pl:
Add support for mysqladmin to mysql-test-run.pl
mysys/my_getopt.c:
Add printout of Warning: or Info: in 'default_reporter', this
will make the user aware of the problem but can filter it
as a warning or note.
mysql-test/r/mysqladmin.result:
New BitKeeper file ``mysql-test/r/mysqladmin.result''
mysql-test/t/mysqladmin.test:
New BitKeeper file ``mysql-test/t/mysqladmin.test''
into outpost.site:/home/cps/mysql/trees/4.1-runtime-bug9191
configure.in:
Auto merged
include/my_time.h:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/rename.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
sql-common/my_time.c:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/time.cc:
Auto merged
mysql-test/t/rename.test:
choose one of the race problem solutions. It was solved
differently in -runtime and mainstream
specifying DEFAULT
This was not specific to datetime. When there is no default value
for a column, and the user inserted DEFAULT, we would write
uninitialized memory to the table.
Now, insist on writing a default value, a zero-ish value, the same
one that comes from inserting NULL into a not-NULL field.
(This is, at best, really strange behavior that comes from allowing
sloppy usage, and serves as a good reason always to run one's server
in a strict SQL mode.)
mysql-test/r/default.result:
Verify that all kinds of types work, even others other than datetime.
mysql-test/t/default.test:
Verify that all kinds of types work, even others other than datetime.
sql/item.cc:
Even if we warn that there is no default value in the table definition,
we have to insert /something/.
When compiling GROUP BY Item_ref instances are dereferenced in
setup_copy_fields(), i.e. replaced with the corresponding Item_field
(if they point to one) or Item_copy_string for the other cases.
Since the Item_ref (in the Item_field case) is no longer used the information
about the aliases stored in it is lost.
Fixed by preserving the column, table and DB alias on dereferencing Item_ref
mysql-test/r/metadata.result:
Bug #20191: getTableName gives wrong or inconsistent result when using VIEWs
- test case
mysql-test/t/metadata.test:
Bug #20191: getTableName gives wrong or inconsistent result when using VIEWs
- test case
sql/item.cc:
Bug #20191: getTableName gives wrong or inconsistent result when using VIEWs
- use the table and db name to fill up the metadata for columns
sql/sql_select.cc:
Bug #20191: getTableName gives wrong or inconsistent result when using VIEWs
- preserve the field, table and DB name on dereferencing an Item_ref
As get_arg0_date() in the Item_func_last_day::get_date() returns
0000-00-00 date sometimes, we have to check ltime->month for 0 after the call.
mysql-test/r/func_time.result:
Fix for bug #23653: Crash if last_day('0000-00-00')
- test result.
mysql-test/t/func_time.test:
Fix for bug #23653: Crash if last_day('0000-00-00')
- test case.
sql/item_timefunc.cc:
Fix for bug #23653: Crash if last_day('0000-00-00')
- return error if month is 0.
- Detect if a table has field of type MYSQL_TYPE_VAR_STRING while running
"CHECK TABLE t FOR UPGRADE" and indicate it need to be fixed
with "REPAIR TABLE t".
- When running a "REPAIR TABLE t" or "ALTER TABLE t FORCE" on the above
table, install a special copy function to trim off the trailing spaces
which we safely can say that the pre 5.0 mysqld didn't put there.
mysql-test/r/varbinary.result:
Add test to see that a table with varbinary from 4.1 can be REPAIRED
mysql-test/t/varbinary.test:
Add test to see that a table with varbinary from 4.1 can be REPAIRED
sql/field_conv.cc:
Add new field copy function 'do_field_varbinary_pre50' used for copying
between MYSQL_TYPE_VAR_STRING and MYSQL_TYPE_VARCHAR. It will remove trailing
spaces from the field as MySQL <= 4.1 never stores the trailing spaces for
a MYSQL_TYPE_VAR_STRING.
Install this new copy function in ALTER TABLEs list of functions to use for
copying data during and alter if from field is a <= 4.1 varbinary and to
field is 5.0 varbinary.
sql/handler.cc:
If the table has a pre 5.0 varbinary, table not to be altered so the field
type is upgraded to 5.0 version and trailing space can be trimmed.
mysql-test/std_data/bug19371.MYD:
New BitKeeper file ``mysql-test/std_data/bug19371.MYD''
mysql-test/std_data/bug19371.MYI:
New BitKeeper file ``mysql-test/std_data/bug19371.MYI''
mysql-test/std_data/bug19371.frm:
New BitKeeper file ``mysql-test/std_data/bug19371.frm''
The problem was that any VIEW columns had always implicit derivation.
Fix: derivation is now copied from the original expression
given in VIEW definition.
For example:
- a VIEW column which comes from a string constant
in CREATE VIEW definition have now coercible derivation.
- a VIEW column having COLLATE clause
in CREATE VIEW definition have now explicit derivation.
mysql-test/r/ctype_utf8.result:
Adding test case
mysql-test/t/ctype_utf8.test:
Adding test case
sql/field.cc:
Copying derivation from item to field.
sql/field.h:
Adding derivation and methods to get/set it into Field.
sql/item.cc:
Copying derivation from field to item.
sql/item.h:
Moving "enum Derivation" declaration from item.h to mysql_priv.h
sql/mysql_priv.h:
Moving "enum Derivation" declaration from item.h to mysql_priv.h
sql/sql_select.cc:
Copying derivation from item to field in
create_tmp_field_from_item() and create_tmp_field().
Problem: when embedding a character string with introducer with charset X
into a SQL query which is generally in character set Y, the string constants
were escaped according to their own character set (i.e.X), then after reading
such a "mixed" query from binlog, the string constants were unescaped
using character set of the query (i.e. Y), instead of X, which gave wrong
results or even syntax errors with tricky charsets (e.g. sjis)
Fix: when embedding a string constant of charset X into a query of charset Y,
the string constant is now escaped according to character Y, instead of
its own character set X.
mysql-test/r/ctype_cp932_binlog.result:
Fixing test results.
sql/log_event.cc:
Using character set "csinfo" instead of the string character set.
sql/sp_head.cc:
- adding "thd" argument to sp_get_item_value()
to have access to thd->variables.character_set_client
- using character_set_client for escaping, instead of
the string character set
mysql-test/r/rpl_charset_sjis.result:
Adding test case
mysql-test/t/rpl_charset_sjis.test:
Adding test case
fixing a flow of the test
mysql-test/r/rpl_packet.result:
results changed
mysql-test/t/rpl_packet.test:
fixing a flaw in the test to create a table in MAX_NAME-sized db indeed.
Upon that the `select to return 1' invariant holds.
on large length
Problem: Most (all) of the numeric inputs were being coerced into
int (32 bit) sized variables. Works OK for sane inputs; any input
larger than 2^32 (or 2^31 for signed vars) exihibited predictable
wrapping behavior (up to about 10^18) and then started having really
strange behaviour past that point (since the conversion to 64 bit int
from the DECIMAL type can do weird things on out of range numbers).
Solution: 1) Add many tests. 2) Convert input from (u)long type to
(u)longlong. 3) Do (sometimes multiple) sanity checks on input,
keeping in mind that sometimes a negative longlong is not a negative
longlong (if the unsigned_flag is set). 4) Emulate existing behavior
w/rt negative and "small" out-of-bounds values.
mysql-test/r/func_str.result:
Additional test results for #10963
mysql-test/t/func_str.test:
Additional test results for #10963
sql/item_func.cc:
Used larger type for counting, to avoid truncation.
sql/item_strfunc.cc:
Fix for #10963, including comments and cleaned up logic
into mysql.com:/usr/home/bar/mysql-5.0.b23451
mysql-test/r/func_gconcat.result:
after merge fix
mysql-test/t/func_gconcat.test:
after merge fix
sql/item_sum.cc:
after merge fix
Problem: After introducing of LC_TIME_NAMES variable, the
function date_format() can return international non-ascii
characters in month and weekday names. Thus, it cannot return
a binary string anymore, because inserting a result of date_format()
into a column with non-utf8 character set produces garbage.
Fix: date_format() now returns a character string, using
"collation_connection" to detect character set and collation
for the returned value. This allows to insert
results of date_format() properly into columns with
various character sets.
mysql-test/r/ctype_utf8.result:
Adding test case.
Fixing old result.
mysql-test/t/ctype_utf8.test:
Adding test case.
sql/item_timefunc.cc:
DATE_FORMAT() now returns a character string
instead of binary string:
- make_date_time() now converts localte data from UTF8 to
the character set of "str" argument, instead of copying as is.
- fix_dec_and_length() now uses "collation_connection"
instead of "binary" for the result, it also now
multiplies to mbmaxlen when calculating max_length
- When returning metadata for scalar subqueries the actual type of the
column was calculated based on the value type, which limits the actual
type of a scalar subselect to the set of (currently) 3 basic types :
integer, double precision or string. This is the reason that columns
of types other then the basic ones (e.g. date/time) are reported as
being of the corresponding basic type.
Fixed by storing/returning information for the column type in addition
to the result type.
mysql-test/r/subselect.result:
Bug #11032: getObject() returns a String for a sub-query of type datetime
- test case
mysql-test/t/subselect.test:
Bug #11032: getObject() returns a String for a sub-query of type datetime
- test case
sql/item_subselect.cc:
Bug #11032: getObject() returns a String for a sub-query of type datetime
- store and return the field type as well in addition to result type for
single row subqueries
sql/item_subselect.h:
Bug #11032: getObject() returns a String for a sub-query of type datetime
- store and return the field type as well in addition to result type for
single row subqueries
into mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
BitKeeper/etc/collapsed:
auto-union
mysql-test/r/ctype_utf8.result:
Auto merged
sql/field.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
into alik.:/mnt/raid/alik/MySQL/devel/5.0-rt
configure.in:
Auto merged
include/my_time.h:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/rename.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
Auto merged
mysql-test/t/rename.test:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql-common/my_time.c:
Auto merged
sql/time.cc:
Auto merged
into alik.:/mnt/raid/alik/MySQL/devel/5.0-merged-5.0-rt
configure.in:
Auto merged
include/my_time.h:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/rename.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
Auto merged
mysql-test/t/rename.test:
Auto merged
sql-common/my_time.c:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/time.cc:
Auto merged
Problem: GROUP_CONCAT on a multi-byte column can truncate
in the middle of a multibyte character when applying
group_concat_max_len limit. It produces an invalid
multi-byte character in the result string.
The second, easier version - reusing old "warning_for_row" flag,
instead of introducing of "result_is_full" - which was
added in the previous commit.
mysql-test/r/func_gconcat.result:
Adding test case
mysql-test/t/func_gconcat.test:
Adding test case
sql/item_sum.cc:
Adding well_formed_len() call not to cut
in the middle of a multi-byte character.
The Item_func_mod objects never had maybe_null set, so users had no reason
to expect that they can be NULL, and may therefore deduce wrong results.
Now, set maybe_null.
mysql-test/r/func_test.result:
Verify that the predictions are true.
mysql-test/t/func_test.test:
Verify that the predictions are true.
sql/item_func.cc:
MOD functions may be NULL.
into outpost.site:/home/cps/mysql/trees/4.1-runtime-bug9191
mysql-test/r/func_time.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
The parser is allocating Item_field for references by name in ORDER BY
expressions. Such expressions however may point not only to Item_field
in the select list (or to a table column) but also to an arbitrary Item.
This causes Item_field::fix_fields to throw an error about missing
column.
The fix substitutes Item_field for the reference with an Item_ref when
not pointing to Item_field.
mysql-test/r/order_by.result:
Bug #22457: Column alias in ORDER BY works, but not if in an expression
- test case
mysql-test/t/order_by.test:
Bug #22457: Column alias in ORDER BY works, but not if in an expression
- test case
sql/item.cc:
Bug #22457: Column alias in ORDER BY works, but not if in an expression
- transform the Item_field made by the parser into Item_ref if it
doesn't point to Item_field and it is in allowed context
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
client/mysql.cc:
Auto merged
mysql-test/lib/mtr_process.pl:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysys/my_lock.c:
Auto merged
sql/handler.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
configure.in:
Manual merge
myisam/sort.c:
Manual merge(double checked)
mysql-test/r/innodb_mysql.result:
Manual merge
mysql-test/t/innodb_mysql.test:
Manual merge
mysys/mf_iocache.c:
Manual merge
mysql-test/r/mysql.result:
Update test result after commenting out the test
mysql-test/t/mysql.test:
Rewrite the test commands so they don't depend on "echo" behaviour
Comment out one as it's a duplicate
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
Auto merged
mysql-test/t/innodb_mysql.test:
Auto merged
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_trigger.cc:
Auto merged
sql/sql_union.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/mysql-test-run.pl:
Manual merge.
mysql-test/r/ps.result:
Manual merge.
mysql-test/t/ps.test:
Manual merge.
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
configure.in:
Auto merged
mysql-test/t/ps.test:
Auto merged
sql/handler.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
myisam/sort.c:
Manual merge.
mysql-test/r/innodb_mysql.result:
Manual merge.
mysql-test/t/innodb_mysql.test:
Manual merge.
mysys/mf_iocache.c:
Manual merge.
into rurik.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug21727
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/subselect.test:
Auto merged
sql/filesort.cc:
Auto merged
sql/item_subselect.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/records.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/table.cc:
Auto merged
into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
sql/item_sum.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_view.cc:
Auto merged
into bodhi.local:/opt/local/work/mysql-4.1-runtime
mysql-test/r/ps.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_update.cc:
Auto merged
into mysql.com:/home/cps/mysql/trees/5.0-runtime-bug9191
configure.in:
Auto merged
include/my_time.h:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/timezone2.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/timezone2.test:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/time.cc:
Auto merged
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
Auto merged
sql-common/my_time.c:
manual merge
sql/item_timefunc.cc:
manual merge
sql/tztime.cc:
manual merge
(4.1 version, with post-review fixes)
The fix for another Bug (6439) limited FROM_UNIXTIME() to
TIMESTAMP_MAX_VALUE which is 2145916799 or 2037-12-01 23:59:59 GMT,
however unix timestamp in general is not considered to be limited
by this value. All dates up to power(2,31)-1 are valid.
This patch extends allowed TIMESTAMP range so, that max
TIMESTAMP value is power(2,31)-1. It also corrects
FROM_UNIXTIME() and UNIX_TIMESTAMP() functions, so that
max allowed UNIX_TIMESTAMP() is power(2,31)-1. FROM_UNIXTIME()
is fixed accordingly to allow conversion of dates up to
2038-01-19 03:14:07 UTC. The patch also fixes CONVERT_TZ()
function to allow extended range of dates.
The main problem solved in the patch is possible overflows
of variables, used in broken-time representation to time_t
conversion (required for UNIX_TIMESTAMP).
acinclude.m4:
Add new macro to check time_t range
configure.in:
Call the macro to check time_t range
include/my_time.h:
Move time-related defines to proper place.
Add a function to perform a rough check if
a TIMESTAMP value fits into the boundaries.
Note: it is defined as "static inline", as
otherwise libmysql won't compile (due to the
way how gcc handles "inline" directive).
mysql-test/r/func_time.result:
Update test result
mysql-test/r/timezone.result:
Update test result
mysql-test/r/timezone2.result:
Update test result
mysql-test/t/func_time.test:
Add test for Bug#9191 and update test to be consistent
with new TIMESTAMP boundaries
mysql-test/t/timezone.test:
Update old tests to be consistent
with new TIMESTAMP boundaries
mysql-test/t/timezone2.test:
Update tests for convert_tz to be consistent with new
TIMESTAMP boundaries
sql/item_timefunc.cc:
Fix convert_tz to allow dates from the new (extended)
TIMESTAMP range
sql/mysql_priv.h:
Move time handling defaults to my_time.h
sql-common/my_time.c:
Because of increased TIMESTAMP_MAX_VALUE overflows in my_system_gmt_sec()
became possible. Here we make it safe against the overflows by stepping
back from the boundary dates which are likely to trigger them.
sql/time.cc:
Update TIME_to_timestamp to allow conversion of
extended date range
sql/tztime.cc:
Fix new (4.1) implementation of broken-down time representation
to time_t conversion routine to avoid overflows during conversion
of boundary dates
mysql-test/r/timezone4.result:
New BitKeeper file ``mysql-test/r/timezone4.result''
mysql-test/t/timezone4-master.opt:
New BitKeeper file ``mysql-test/t/timezone4-master.opt''
mysql-test/t/timezone4.test:
New BitKeeper file ``mysql-test/t/timezone4.test''
into mysql.com:/home/hf/work/mysql-5.0.19491
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sync using replicate-wild-ignore-table
Problem: changes in character set variables
before an action on an replication-ignored table
makes slave to forget new variable values.
Fix: initialize one_shot variables only when
4.1 -> 5.x replication is running.
mysql-test/r/rpl_ignore_table.result:
Adding test case
mysql-test/t/rpl_ignore_table-slave.opt:
Don't replicate tables with names starting with "tmptbl"
mysql-test/t/rpl_ignore_table.test:
Adding test case
sql/sql_parse.cc:
Reset one_shot variables only if we do 4.1->5.x replication.
In other cases we cannot do that: resetting thd->variables out of sync with
st_relay_log_info::cached_charset, which makes
st_relay_log_info::cached_charset_compare() not to notice
character set related variables changes afterwards.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Allocation of memory for the sort buffer at each evaluation of a
subquery may take a significant amount of time if the buffer is rather big.
With the fix we allocate the buffer at the first evaluation of the
subquery and reuse it at each subsequent evaluation.
mysql-test/r/subselect.result:
Added a test case for bug #21727.
mysql-test/t/subselect.test:
Added a test case for bug #21727.
sql/item_subselect.h:
Fixed bug #21727.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Added an implementation for Item_subselect::is_uncacheable()
returning TRUE if the engine if the subselect is uncacheable.
sql/mysql_priv.h:
Fixed bug #21727.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Added a new boolean parameter to the filesort_free_buffers procedure.
If the value of this parameter is TRUE the procedure frees the sort_keys
buffpek buffers.
sql/records.cc:
Fixed bug #21727.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Added a new boolean parameter to the filesort_free_buffers procedure.
If the value of this parameter is TRUE the procedure frees the sort_keys
buffpek buffers.
sql/sql_base.cc:
Fixed bug #21727.
Made sure that st_table::pos_in_table_list would be always initialized.
sql/sql_select.cc:
Fixed bug #21727.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Added a new boolean parameter to the filesort_free_buffers procedure.
If the value of this parameter is TRUE the procedure frees the sort_keys
buffpek buffers.
sql/sql_show.cc:
Fixed bug #21727.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Added a new boolean parameter to the filesort_free_buffers procedure.
If the value of this parameter is TRUE the procedure frees the sort_keys
buffpek buffers.
sql/sql_table.cc:
Fixed bug #21727.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Cleanup.
sql/table.cc:
Fixed bug #21727.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Added st_table_list::in_subselect() returning for a table the subselect that
contains the FROM list this table is taken from (if there is any).
sql/table.h:
Fixed bug #21727.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Added fields for sort_keys and buffpek buffers to the FILESORT_INFO structure.
into shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
client/mysqltest.c:
Auto merged
mysql-test/lib/mtr_io.pl:
Auto merged
mysql-test/lib/mtr_process.pl:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/t/rename.test:
Manual mereg
Evaluate "NULL IN (SELECT ...)" in a special way: Disable pushed-down
conditions and their "consequences":
= Do full table scans instead of unique_[index_subquery] lookups.
= Change appropriate "ref_or_null" accesses to full table scans in
subquery's joins.
Also cache value of NULL IN (SELECT ...) if the SELECT is not correlated
wrt any upper select.
mysql-test/r/subselect.result:
BUG#8804: wrong results for NULL IN (SELECT ...):
- Updated test results
sql/item.h:
BUG#8804: wrong results for NULL IN (SELECT ...):
- Added comments
sql/item_cmpfunc.cc:
BUG#8804: wrong results for NULL IN (SELECT ...):
Made Item_in_optimizer to:
- cache the value of "NULL IN (uncorrelated select)"
- Turn off pushed-down predicates when evaluating "NULL IN (SELECT ...)"
sql/item_cmpfunc.h:
BUG#8804: wrong results for NULL IN (SELECT ...):
- Made Item_in_optimizer cache the value of "NULL IN (uncorrelated select)"
- Added comments
sql/item_subselect.cc:
BUG#8804: wrong results for NULL IN (SELECT ...):
- When needed, wrap the predicates we push into subquery into an
Item_func_trig_cond so we're able to turn them off when evaluating
NULL IN (SELECT ...).
- Added code to evaluate NULL IN (SELECT ...) in a special way:
= In [unique_]index_subquery, do full table scan to see if there
are any rows.
= For other subqueries, change ref[_or_null] to ALL if the
ref[_or_null] was created from pushed-down predicate.
sql/item_subselect.h:
BUG#8804: wrong results for NULL IN (SELECT ...):
- Added Item_subselect::is_correlated
- Added comments
sql/records.cc:
BUG#8804: wrong results for NULL IN (SELECT ...):
- Make rr_sequential() non-static
sql/sql_lex.cc:
BUG#8804: wrong results for NULL IN (SELECT ...):
- Added st_select_lex::is_correlated and Item_subselect::is_correlated.
sql/sql_lex.h:
BUG#8804: wrong results for NULL IN (SELECT ...):
- Added st_select_lex::is_correlated
sql/sql_select.cc:
BUG#8804: wrong results for NULL IN (SELECT ...):
- Added KEY_FIELD::outer_ref to keep track of which ref accesses are
created from predicates that were pushed down into the subquery.
sql/sql_select.h:
BUG#8804: wrong results for NULL IN (SELECT ...):
- Added KEYUSE::outer_ref
mysql-test/r/subselect3.result:
New BitKeeper file ``mysql-test/r/subselect3.result''
mysql-test/t/subselect3.test:
New BitKeeper file ``mysql-test/t/subselect3.test''
remove timeing dependant part of test
mysql-test/r/ndb_multi.result:
remove timeing dependant part of test
mysql-test/t/ndb_multi.test:
remove timeing dependant part of test
into rakia.gmz:/home/kgeorge/mysql/autopush/B21809-5.0-opt
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
Item::val_xxx() may be called by the server several times at execute time
for a single query. Calls to val_xxx() may be very expensive and sometimes
(count(distinct), sum(distinct), avg(distinct)) not possible.
To avoid that problem the results of calculation for these aggregate
functions are cached so that val_xxx() methods just return the calculated
value for the second and subsequent calls.
mysql-test/r/func_group.result:
Bug #23184: SELECT causes server crash
- test case
mysql-test/t/func_group.test:
Bug #23184: SELECT causes server crash
- test case
sql/item_sum.cc:
Bug #23184: SELECT causes server crash
- caching of the aggregate function results so no need to recalculate at val_xxx()
sql/item_sum.h:
Bug #23184: SELECT causes server crash
- caching of the aggregate function results so no need to recalculate at val_xxx()
- Wait in loop with small sleep until tables has been renamed
mysql-test/t/rename.test:
To avoid scheduling effects wait for the tables to be renamed in a loop with small sleeps
before continuing with tests
mysql-test/include/wait_for_query_to_suceed.inc:
New BitKeeper file ``mysql-test/include/wait_for_query_to_suceed.inc''
It's not possible to flush the global status variables in 5.0
Update test case so it works by recording the value of handle_rollback
before and compare it to the value after
mysql-test/r/innodb_mysql.result:
Update result file
mysql-test/t/innodb_mysql.test:
It's not possible to reset the global status variables in 5.0 so intead its value
is recorded and compared to the after value.
It should not have changed.
sql/mysqld.cc:
Improve comments
sql/set_var.cc:
Improve comments
sql/sql_class.cc:
Improve comments
sql/sql_class.h:
Improve comments
Problem: SHOW CREATE TABLE printed garbage in table
name for tables having TURKISH I
(i.e. LATIN CAPITABLE LETTER I WITH DOT ABOVE)
when lower-case-table-name=1.
Reason: In some cases during lower/upper conversion in utf8,
the result string can be shorter the original string
(including the above letter). Old implementation of caseup_str()
and casedn_str() didn't handle the result length properly,
assuming that length cannot change.
This fix changes the result type of cs->cset->casedn_str()
and cs->cset->caseup_str() from VOID to UINT, to return
the result length, as well as put '\0' terminator on a
proper place.
Also, my_caseup_str_utf8() and my_casedn_str_utf8() were
rewritten not to use strlen() for performance purposes.
It was done with help of adding of new functions - my_utf8_uni_no_range()
and my_uni_utf8_no_range() - for null terminated strings.
include/m_ctype.h:
Changeing return type from void to int for caseup_str() and casedn_str()
mysql-test/r/lowercase_table.result:
Adding test case
mysql-test/t/lowercase_table.test:
Adding test case
sql/sql_parse.cc:
Set table->table.length to result of my_casedn_str().
strings/ctype-bin.c:
Changeing return type from void to int for caseup_str() and casedn_str()
strings/ctype-mb.c:
Changeing return type from void to int for caseup_str() and casedn_str()
strings/ctype-simple.c:
Changeing return type from void to int for caseup_str() and casedn_str()
strings/ctype-ucs2.c:
Changeing return type from void to int for caseup_str() and casedn_str()
strings/ctype-utf8.c:
Changeing return type from void to int for caseup_str() and casedn_str().
Optimization, to get rid of strlen():
Adding my_utf8_uni_no_range() and my_uni_utf8_no_range() - for null
terninated strings.
decimal->ulong conversion fixed to assign max possible ULONG if decimal
is bigger
Item_func_unsigned now handles DECIMAL parameter separately as we can't
rely on decimal::val_int result here.
mysql-test/r/type_newdecimal.result:
result fixed
mysql-test/t/type_newdecimal.test:
testcase
sql/item_func.cc:
DECIMAL_RESULT should be handled separately here as it's
always signed.
strings/decimal.c:
here we assign max possible ULONG if the decimal value is bigger
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.cc:
Auto merged
Backport of the fix for bug #8143: A date with value 0 is treated as a NULL value
mysql-test/r/delete.result:
Fix for bug #23412: delete rows with null date field
- test result
mysql-test/t/delete.test:
Fix for bug #23412: delete rows with null date field
- test case
sql/sql_delete.cc:
Fix for bug #23412: delete rows with null date field
- during SELECT queries processing we convert 'date[time]_field is null'
conditions into 'date[time]_field = 0000-00-00[ 00:00:00]' for not null
DATE and DATETIME fields. To be consistent, we have to do the same for DELETE
queries. So we should call remove_eq_conds() in the mysql_delete() as well.
Also it may simplify and speed up DELETE queries execution.
a updatable view.
When there's a VIEW on a base table that have AUTO_INCREMENT column, and
this VIEW doesn't provide an access such column, after INSERT to such
VIEW LAST_INSERT_ID() did not return the value just generated.
This behaviour is intended and correct, because if the VIEW doesn't list
some columns then these columns are effectively hidden from the user,
and so any side effects of inserting default values to them.
However, there was a bug that such statement inserting into a view would
reset LAST_INSERT_ID() instead of leaving it unchanged.
This patch restores the original value of LAST_INSERT_ID() instead of
resetting it to zero.
mysql-test/r/view.result:
Add result for bug#22584: last_insert_id not updated after inserting
a record through a updatable view.
mysql-test/t/view.test:
Add test case for bug#22584: last_insert_id not updated after inserting
a record through a updatable view.
sql/sql_parse.cc:
When we have inserted into a view, and AUTO_INCREMENT column is not
accessed from this view, instead of setting LAST_INSERT_ID to zero set
it to the value it had before this statement was executed.
- Add two null bytes in "buff" variable allowing us to call
get_arg two times also for strings longer than sizeof(buff)
client/mysql.cc:
Make sure there are _two_ zero bytes at the end of buff, to allow 'get_arg' to be
called twice on long strings. The first time it will mark end of string with a
zero and the second time it will "skip ahead" to the first zero, and the find the
second one indicating end of buff.
mysql-test/r/mysql.result:
Update test results
mysql-test/t/mysql.test:
Add tests for "com_connect" function in mysql
Add test reported in bug
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug18819
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/t/innodb_mysql.test:
Auto merged
sql/sql_delete.cc:
Auto merged
If the error happens during DELETE IGNORE, nothing could be send to the
client, thus leaving it frozen expecting the reply.
The problem was that if some error occurred, it wouldn't be reported to
the client because of IGNORE, but neither success would be reported.
MySQL 4.1 would not freeze the client, but will report
ERROR 1105 (HY000): Unknown error
instead, which is also a bug.
The solution is to report success if we are in DELETE IGNORE and some
non-fatal error has happened.
mysql-test/r/innodb_mysql.result:
Add result for bug#18819: DELETE IGNORE hangs on foreign key parent
delete.
mysql-test/t/innodb_mysql.test:
Add test case for bug#18819: DELETE IGNORE hangs on foreign key parent
delete.
sql/sql_delete.cc:
Report success if we have got an error, but we are in DELETE IGNORE, and
the error is not fatal (if it is, it would be reported to the client).
Disable warnings around the create table statements, we want to use innodb when possible but they work just fine without.
mysql-test/t/ctype_utf8.test:
Disable warnings around the create table statements, we want to use innodb when possible but they work just fine without.
into siva.hindu.god:/usr/home/tim/m/bk/50
configure.in:
Auto merged
mysql-test/r/rename.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/view.test:
Auto merged
mysys/mf_iocache.c:
Auto merged
sql/item_func.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/opt_range.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/table.cc:
Auto merged
myisam/sort.c:
Manual merge
mysql-test/r/innodb_mysql.result:
Manual merge
mysql-test/t/innodb_mysql.test:
Manual merge
mysql-test/r/mysqldump-max.result:
Update test result after fix of spelling error
mysql-test/r/rpl_trigger.result:
Update test result after fix of spelling error
mysql-test/r/type_newdecimal.result:
Update test result after fix of spelling error
mysql-test/t/mysqldump-max.test:
Fix spelling error "disable_warnings"
Write shorter "drop table..."
mysql-test/t/rpl_trigger.test:
Fix spelling error, there is no --ignore_warnings
mysql-test/t/type_newdecimal.test:
Fix spelling error
mysql-test/r/ndb_multi.result:
update result file for new behaviour of correcting the 241 error on ha_open
mysql-test/t/ndb_multi.test:
no longer errors on ha_open with 241
select OK.
The SQL parser was using Item::name to transfer user defined function attributes
to the user defined function (udf). It was not distinguishing between user defined
function call arguments and stored procedure call arguments. Setting Item::name
was causing Item_ref::print() method to print the argument as quoted identifiers
and caused views that reference aggregate functions as udf call arguments (and
rely on Item::print() for the text of the view to store) to throw an undefined
identifier error.
Overloaded Item_ref::print to print aggregate functions as such when printing
the references to aggregate functions taken out of context by split_sum_func2()
Fixed the parser to properly detect using AS clause in stored procedure arguments
as an error.
Fixed printing the arguments of udf call to print properly the udf attribute.
mysql-test/r/udf.result:
Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK.
- test cases
mysql-test/t/udf.test:
Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK.
- test cases
sql/item.cc:
Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK.
- Don't print the refs to SUM functions as refs.
sql/item_func.cc:
Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK.
- print the aliases in the udf calls
sql/item_func.h:
Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK.
- print the aliases in the udf calls
sql/sql_lex.cc:
Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK.
- disable aliases for arguments in stored routine calls
sql/sql_lex.h:
Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK.
- disable aliases for arguments in stored routine calls
sql/sql_yacc.yy:
Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK.
- disable aliases for arguments in stored routine calls
- fix bison duplicate symbol warnings
into mysql.com:/home/hf/work/w3475/my50-w3475
mysql-test/t/flush.test:
Auto merged
mysql-test/t/flush_block_commit.test:
Auto merged
mysql-test/t/innodb-deadlock.test:
Auto merged
mysql-test/t/innodb-lock.test:
Auto merged
mysql-test/t/lock_multi.test:
Auto merged
mysql-test/t/rename.test:
Auto merged
mysql-test/t/show_check.test:
Auto merged
mysql-test/t/status.test:
Auto merged
client/mysqltest.c:
merging
libmysql/libmysql.c:
merging
To the documentor: The DEFAULT value in SHOW COLUMNS/SELECT FROM I_S.COLUMNS
was truncated to NAME_LEN (which effectively is 64) characters.
mysql-test/r/information_schema.result:
Update result
Because the length of I_S.COLUMNS.COLUMN_DEFAULT was increased to
65535 the column changed it's type from varchar(64) to longtext
The type is longtext if the length is > 65532 (the max varchar len)
mysql-test/t/information_schema.test:
test case for bug#23037: Bug in field "Default" of
query "SHOW COLUMNS FROM table"
Both SHOW COLUMNS and I_S.COLUMNS is TESTED as well the
value returned by both. Using --replace_regex is unfeasible
as the repetition value cannot be > 255.
--replace_regex /A{256}/VALUE/ doesn't work, not to talk about
/A{65532}/VALUE/
/(A{255}){255}/VALUE/ is awfully slow. Thus, simple function with
cursor is used to extract the value.
sql/sql_show.cc:
Default value can have TIMESTAMP, CHAR, VARCHAR, ENUM
VARCHAR can have the longest value, up to 65535. However, because
of table handler limitations the actual limit is 65532 characters,
latin1 charset. However, here is used MAX_FIELD_VARCHARLENGTH macro,
because there could be a storage engine without such limitation.
Necessary code added to mysqltest.c.
Disabled tests are available now.
client/mysqltest.c:
do_send_query function implemented, so now 'send' command will be
run in separate thread for the embedded server.
Mutex and condition added to the 'connection' struct for syncronisation
purposes. Yes it'd be easier if we had pthread_join() command
libmysql/libmysql.c:
this isn't actually needed and causes problems in embedded server
mysql-test/t/bdb-deadlock.test:
test is available for the embedded server now
mysql-test/t/flush.test:
test is available for the embedded server now
mysql-test/t/flush_block_commit.test:
test is available for the embedded server now
mysql-test/t/innodb-deadlock.test:
test is available for the embedded server now
mysql-test/t/innodb-lock.test:
test is available for the embedded server now
mysql-test/t/lock_multi.test:
test is available for the embedded server now
mysql-test/t/rename.test:
test is available for the embedded server now
mysql-test/t/show_check.test:
test is available for the embedded server now
mysql-test/t/status.test:
test is available for the embedded server now
into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_update.cc:
Auto merged
mysql-test/r/view.result:
Manual merge.
mysql-test/t/view.test:
Manual merge.
into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
mysql-test/r/myisam.result:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_select.cc:
Auto merged
If elements a not top-level IN subquery were accessed by an index and
the subquery result set included a NULL value then the quantified
predicate that contained the subquery was evaluated to NULL when
it should return a non-null value.
mysql-test/r/subselect.result:
Added a test case for bug #23478.
mysql-test/t/subselect.test:
Added a test case for bug #23478.
This patch reverts a change introduced by Bug 6951, which incorrectly
set thd->abort_on_warning for stored procedures.
As per internal discussions about the SQL_MODE=TRADITIONAL,
the correct behavior is to *not* abort on warnings even inside an INSERT/UPDATE
trigger.
Tests for Stored Procedures, Stored Functions, Triggers involving SQL_MODE
have been included or revised, to reflect the intended behavior.
(reposting approved patch, to work around source control issues, no review needed)
mysql-test/include/sp-vars.inc:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/r/sp-vars.result:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/r/sp.result:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/r/trigger.result:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/t/sp-vars.test:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/t/sp.test:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/t/trigger.test:
Tests for SQL_MODE='TRADITIONAL'
sql/sp_head.cc:
For SQL_MODE='TRADITIONAL',
thd->abort_on_warning should be set only when assigning a *column*
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
client/mysqltest.c:
Auto merged
mysql-test/r/mysqltest.result:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
into mysql.com:/home/svoj/devel/mysql/engines/mysql-5.0-engines
myisam/sort.c:
Auto merged
mysql-test/r/repair.result:
Auto merged
mysql-test/t/repair.test:
Auto merged
sql/sql_base.cc:
Use local.
into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
mysql-test/r/merge.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/r/view.result:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/opt_range.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/table.cc:
Auto merged
commands and go directly to result file processing
client/mysqltest.c:
Add command "exit" to mysqltest
mysql-test/r/mysqltest.result:
Add command "exit" to mysqltest
mysql-test/t/mysqltest.test:
Add command "exit" to mysqltest
into mysql.com:/usr/home/ram/work/bug20732/my50-bug20732
sql/opt_range.cc:
Auto merged
sql/opt_range.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.cc:
Auto merged
mysql-test/r/range.result:
SCCS merged
mysql-test/t/range.test:
SCCS merged
When statement to be prepared contained CREATE PROCEDURE, CREATE FUNCTION
or CREATE TRIGGER statements with a syntax error in it, the preparation
would fail with syntax error message, but the memory could be corrupted.
The problem occurred because we switch memroot when parse stored
routine or trigger definitions, and on parse error we restored the
original memroot only after performing some memory operations. In more
detail:
- prepared statement would activate its own memory root to parse
the definition of the stored procedure.
- SP would reset this memory root with its own memory root to
parse SP statements
- a syntax error would happen
- prepared statement would restore the original memory root
- stored procedure would restore what it thinks was the original
memory root, but actually was the statement memory root.
That led to double free - in destruction of the statement and in
a next call to mysql_parse().
The solution is to restore memroot right after the failed parsing.
mysql-test/r/ps.result:
Add result for bug#21856: Prepared Statements: crash if bad create.
mysql-test/t/ps.test:
Add test case for bug#21856: Prepared Statements: crash if bad create.
sql/sql_parse.cc:
On parse error if thd->lex->sphead is set we have to free sp_head object
to restore statement memroot, if it was switched during parsing.
The change here is for safety, currently query_cache_abort() and
lex->unit.cleanup() calls do not use current memroot.
sql/sql_prepare.cc:
On parse error if thd->lex->sphead is set we have to free sp_head object
to restore statement memroot, if it was switched during parsing.
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
client/mysqldump.c:
Auto merged
mysql-test/include/have_lowercase0.inc:
Auto merged
mysql-test/t/lowercase_table3.test:
Auto merged
mysql-test/t/mysql_protocols.test:
Auto merged
mysql-test/t/rpl_change_master.test:
Auto merged
mysql-test/t/rpl_drop_db.test:
Auto merged
mysql-test/t/rpl_error_ignored_table.test:
Auto merged
mysql-test/t/rpl_loaddata.test:
Auto merged
mysql-test/t/rpl_log.test:
Auto merged
mysql-test/t/rpl_max_relay_size.test:
Auto merged
mysql-test/t/rpl_replicate_do.test:
Auto merged
mysys/my_read.c:
Auto merged
sql/sql_class.cc:
Auto merged
mysql-test/r/rpl000015.result:
C
mysql-test/r/rpl_log.result:
ul
mysql-test/r/rpl_max_relay_size.result:
ul
mysql-test/r/rpl_replicate_do.result:
ul
mysql-test/t/rpl000015.test:
ul
client/mysqldump.c:
fflush stderr after printing of error message
mysql-test/include/have_lowercase0.inc:
Remove extra ;
mysql-test/r/rpl000015.result:
Update result
mysql-test/r/rpl_change_master.result:
Update result
mysql-test/r/rpl_error_ignored_table.result:
Update result
mysql-test/r/rpl_loaddata.result:
Update result
mysql-test/r/rpl_log.result:
Update result
mysql-test/r/rpl_max_relay_size.result:
Update result
mysql-test/r/rpl_replicate_do.result:
Update result
mysql-test/t/lowercase_table3.test:
Backport from 5.0
mysql-test/t/mysql_protocols.test:
Backport from 5.0
mysql-test/t/rpl000015.test:
Backport from 5.0
mysql-test/t/rpl_change_master.test:
Backport from 5.0
mysql-test/t/rpl_drop_db.test:
Backport from 5.0
mysql-test/t/rpl_error_ignored_table.test:
Backport from 5.0
mysql-test/t/rpl_loaddata.test:
Backport from 5.0
mysql-test/t/rpl_log-master.opt:
Use --force-restart command in master.opt to force a restart for this test case
mysql-test/t/rpl_log.test:
Backport from 5.0
mysql-test/t/rpl_max_relay_size.test:
Backport from 5.0
mysql-test/t/rpl_replicate_do.test:
Backport from 5.0
We miss some records sometimes using RANGE method if we have
partial key segments.
Example:
Create table t1(a char(2), key(a(1)));
insert into t1 values ('a'), ('xx');
select a from t1 where a > 'x';
We call index_read() passing 'x' key and HA_READ_AFTER_KEY flag
in the handler::read_range_first() wich is wrong because we have
a partial key segment for the field and might miss records like 'xx'.
Fix: don't use open segments in such a case.
mysql-test/r/range.result:
Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes
- test result.
mysql-test/t/range.test:
Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes
- test case.
sql/opt_range.cc:
Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes
- check if we have a partial key segment for a Item_func::GT_FUNC;
if so, don't set NEAR_MIN flag in order to use HA_READ_KEY_OR_NEXT
instead of HA_READ_AFTER_KEY.
sql/opt_range.h:
Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes
- key segment 'flag' slot added.
sql/sql_select.cc:
Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes
- test (HA_PART_KEY_SEG | HA_NULL_PART) as we split it in the sql/table.cc
sql/table.cc:
Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes
- set HA_NULL_PART flag instead of HA_PART_KEY_SEG in order not to mix them.
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/t/innodb_mysql.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/r/create.result:
Merge
mysql-test/t/create.test:
Merge
mysql-test/t/view.test:
Remove the disable_warnings part as engine=innodb has been removed
The mysqldump command with both the --xml and --hex-blob options will output blob data encoded as hexBinary.
The proper XML datatype is xs:hexBinary.
The correct XML datatype is specified be setting the xsi_type attribute equal to xs:hexBinary for each encoded element.
client/mysqldump.c:
Bug#19745: mysqldump --xml produces invalid xml
- Moved hex-blob code to it's own function.
- Rewrote print_xml_tag function to accept zero or more attribute/value
pair(s) which are appended to a separate tag name.
- --xml option respects the --hex-blob option by ouputting blob data in hex
encoded format. Each hex encoded field tag will also contain an xsi:type
attribute with an xs:hexBinary value.
- --extended-insert and --xml are mutually exclusive. Otherwise, the xml file
will contain INSERT commands.
- Minor comment cleanup.
mysql-test/r/mysqldump.result:
Bug#19745: mysqldump --xml produces invalid xml
-Added results.
mysql-test/t/mysqldump.test:
Bug#19745: mysqldump --xml produces invalid xml
-Added test.
Repair table could crash a server if there is not sufficient
memory (myisam_sort_buffer_size) to operate. Affects not only
repair, but also all statements that use create index by sort:
repair by sort, parallel repair, bulk insert.
Return an error if there is not sufficient memory to store at
least one key per BUFFPEK.
Also fixed memory leak if thr_find_all_keys returns an error.
myisam/sort.c:
maxbuffer is number of BUFFPEK-s for repair. It is calculated
as records / keys. keys is number of keys that can be stored
in memory (myisam_sort_buffer_size). There must be sufficient
memory to store both BUFFPEK-s and keys. It was checked
correctly before this patch. However there is another
requirement that wasn't checked: there must be sufficient
memory for at least one key per BUFFPEK, otherwise repair
by sort/parallel repair cannot operate.
Return an error if there is not sufficient memory to store at
least one key per BUFFPEK.
Also fixed memory leak if thr_find_all_keys returns an error.
mysql-test/r/repair.result:
A test case for BUG#23175.
mysql-test/t/repair.test:
A test case for BUG#23175.
into rurik.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug19579
mysql-test/t/select.test:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/select.result:
SCCS merged
Remove table engine qualification where it's unnecessary.
mysql-test/r/view.result:
Remove requirement for innodb where not needed. (Running this test alone
raised warnings that it was using myisam.)
mysql-test/t/view.test:
Remove requirement for innodb where not needed. (Running this test alone
raised warnings that it was using myisam.)
sql/sql_parse.cc:
Fix previous bad re-patch.
sql/sql_view.cc:
Fix previous bad re-patch.
into macbook.gmz:/Users/kgeorge/mysql/work/B21798-5.0-opt-merge
sql/mysql_priv.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
mysql-test/r/subselect.result:
merge fixes for bug 21798
mysql-test/t/subselect.test:
merge fixes for bug 21798
list using a function
When executing dependent subqueries they are re-inited and re-exec() for
each row of the outer context.
The cause for the bug is that during subquery reinitialization/re-execution,
the optimizer reallocates JOIN::join_tab, JOIN::table in make_simple_join()
and the local variable in 'sortorder' in create_sort_index(), which is
allocated by make_unireg_sortorder().
Care must be taken not to allocate anything into the thread's memory pool
while re-initializing query plan structures between subquery re-executions.
All such items mush be cached and reused because the thread's memory pool
is freed at the end of the whole query.
Note that they must be cached and reused even for queries that are not
otherwise cacheable because otherwise it will grow the thread's memory
pool every time a cacheable query is re-executed.
We provide additional members to the JOIN structure to store references
to the items that need to be cached.
mysql-test/r/subselect.result:
Bug#21798: memory leak during query execution with subquery in column
list using a function
- test case
mysql-test/t/subselect.test:
Bug#21798: memory leak during query execution with subquery in column
list using a function
- test case
sql/mysql_priv.h:
Bug#21798: memory leak during query execution with subquery in column
list using a function
- cache the entities allocated in the threads memory pool by
JOIN::exec ().
sql/sql_delete.cc:
Bug#21798: memory leak during query execution with subquery in column
list using a function
- cache the SORT_ORDER, TABLE * and JOIN_TAB allocated in the thread's
memory pool by JOIN::exec ().
sql/sql_select.cc:
Bug#21798: memory leak during query execution with subquery in column
list using a function
- cache the SORT_ORDER, TABLE * and JOIN_TAB allocated in the thread's
memory pool by JOIN::exec ().
sql/sql_select.h:
Bug#21798: memory leak during query execution with subquery in column
list using a function
- cache the SORT_ORDER, TABLE * and JOIN_TAB allocated in the thread's
memory pool by JOIN::exec ().
sql/sql_table.cc:
Bug#21798: memory leak during query execution with subquery in column
list using a function
- cache the SORT_ORDER, TABLE * and JOIN_TAB allocated in the thread's
memory pool by JOIN::exec ().
sql/sql_update.cc:
Bug#21798: memory leak during query execution with subquery in column
list using a function
- cache the SORT_ORDER, TABLE * and JOIN_TAB allocated in the thread's
memory pool by JOIN::exec ().
From the manual:
date arithmetic operations require complete dates and do not work with
incomplete dates such as '2006-07-00' or badly malformed dates.
mysql-test/r/func_time.result:
Fix for bug #22229: Bug in DATE_ADD()
- test result.
mysql-test/t/func_time.test:
Fix for bug #22229: Bug in DATE_ADD()
- test case.
sql/item_timefunc.cc:
Fix for bug #22229: Bug in DATE_ADD()
- Item_func_str_to_date::get_date() should return NULL if TIME_NO_ZERO_DATE
flag is set and year||month||day is 0.
into macbook.gmz:/Users/kgeorge/mysql/work/B22367-5.0-opt-merge
include/my_base.h:
Auto merged
mysql-test/r/select.result:
merge of 5.0-opt to 22367
mysql-test/t/select.test:
merge of 5.0-opt to 22367
into siva.hindu.god:/usr/home/tim/m/bk/tmp/mrgOct16/50
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
mysql-test/r/ps.result:
Manual merge
mysql-test/t/ps.test:
Manual merge
account predicates that become sargable after reading const tables.
In some cases this resulted in choosing non-optimal execution plans.
Now info of such potentially saragable predicates is saved in
an array and after reading const tables we check whether this
predicates has become saragable.
mysql-test/r/select.result:
Added a test case for bug #19579.
mysql-test/t/select.test:
Added a test case for bug #19579.
sql/item_cmpfunc.cc:
Fixed bug #19579: at range analysis optimizer did not take into
account predicates that become sargable after reading const tables.
Added a counter of between predicates.
sql/sql_base.cc:
Fixed bug #19579: at range analysis optimizer did not take into
account predicates that become sargable after reading const tables.
Added a counter of between predicates.
sql/sql_lex.cc:
Fixed bug #19579: at range analysis optimizer did not take into
account predicates that become sargable after reading const tables.
Added a counter of between predicates.
sql/sql_lex.h:
Fixed bug #19579: at range analysis optimizer did not take into
account predicates that become sargable after reading const tables.
Added a counter of between predicates.
sql/sql_select.cc:
Fixed bug #19579: at range analysis optimizer did not take into
account predicates that become sargable after reading const tables.
Now info of such potentially saragable predicates is saved in
an array and after reading const tables we check whether this
predicates has become saragable.
When using index for group by and range access the server isolates
a set of ranges based on the conditions over the key parts of the
index used. Then it uses only the ranges over the GROUP BY fields to
jump from one group to another. Since the GROUP BY fields may form a
prefix over the index, we may use only a prefix of the ranges produced
by the range optimizer.
Each range contains a notion on whether it includes its border values.
The problem is that when using a range prefix, the last range is open
because it assumes that there is a range on the next keypart. Thus when
we use a prefix range as it is, it excludes all border values.
The solution is when ignoring the suffix of the range conditions
(to jump over the GROUP BY prefix only) the server must change the
remaining intervals so they always contain their borders, e.g.
if the whole range was :
(1,-inf) <= (<group_by_col>,<min_max_arg_col>) < (1, 3) we must make
(1) <= (<group_by_col>) <= (1) because (a,b) < (c1,c2) means :
a < c1 OR (a = c1 AND b < c2).
mysql-test/r/group_min_max.result:
Bug #22342: No results returned for query using max and group by
- test case
mysql-test/t/group_min_max.test:
Bug #22342: No results returned for query using max and group by
- test case
sql/opt_range.cc:
Bug #22342: No results returned for query using max and group by
- open the intervals for prefix select when there are more conditions
than used for the prefix search.
sql/opt_range.h:
Bug #22342: No results returned for query using max and group by
- open the intervals for prefix select when there are more conditions
than used for the prefix search.
strings
MySQL is setting the flag HA_END_SPACE_KEYS for all the keys that reference
text or varchar columns with collation different than binary.
This was done to handle correctly the situation where a lookup on such a key
may return more than 1 row because of the presence of many rows that differ
only by the amount of trailing space in the table's string column.
Inserting such values however appears to violate the unique checks on
INSERT/UPDATE. Thus that flag must not be set as it will prevent the optimizer
from choosing a faster access method.
This fix removes the setting of the HA_END_SPACE_KEYS flag.
include/my_base.h:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- disabled HA_END_SPACE_KEY as it's no longer needed
mysql-test/r/func_str.result:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- fixed explain in an existing case
mysql-test/r/merge.result:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- fixed explain in an existing case
mysql-test/r/select.result:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- test case
mysql-test/r/subselect.result:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- fixed explain in an existing case
mysql-test/t/select.test:
Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on
strings
- test case
into macbook.gmz:/Users/kgeorge/mysql/work/B14019-5.0-opt
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/sql_base.cc:
Auto merged
mysql-test/r/group_by.result:
merge 4.1->5.0
mysql-test/t/group_by.test:
merge 4.1->5.0
When resolving unqualified name references MySQL was not
checking what is the item type for the reference. Thus
e.g a string literal item that has by convention a name
equal to its string value will also work as a reference to
a SELECT list item or a table field.
Fixed by allowing only Item_ref or Item_field to referenced by
(unqualified) name.
mysql-test/r/func_gconcat.result:
Bug #14019: group by converts literal string to column name
- removed undeterministic testcase : order by a constant
means no order.
mysql-test/r/group_by.result:
Bug #14019: group by converts literal string to column name
- test case
mysql-test/t/func_gconcat.test:
Bug #14019: group by converts literal string to column name
- removed undeterministic testcase : order by a constant
means no order.
mysql-test/t/group_by.test:
Bug #14019: group by converts literal string to column name
- test case
sql/sql_base.cc:
Bug #14019: group by converts literal string to column name
- resolve unqualified by name refs only for real references
into shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
client/mysql.cc:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
include/my_dbug.h:
Auto merged
mysql-test/lib/mtr_cases.pl:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/csv.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/t/csv.test:
Auto merged
sql/field.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
mysql-test/r/innodb_mysql.result:
Manual merge
mysql-test/t/func_time.test:
Manual merge, test already there
mysql-test/t/innodb_mysql.test:
Manual merge
The mysql_alter_table() was able to rename only a table.
The view/table renaming code is moved from the function rename_tables
to the new function called do_rename().
The mysql_alter_table() function calls it when it needs to rename a view.
mysql-test/t/rename.test:
Added a test case for bug#14959: ALTER TABLE isn't able to rename a view
mysql-test/r/rename.result:
Added a test case for bug#14959: ALTER TABLE isn't able to rename a view
sql/mysql_priv.h:
Bug#14959: ALTER TABLE isn't able to rename a view
Added the prototype of the do_rename() function.
sql/sql_rename.cc:
Bug#14959: ALTER TABLE isn't able to rename a view
The view/table renaming code is moved from the function rename_tables
to the new function called do_rename().
sql/sql_table.cc:
Bug#14959: ALTER TABLE isn't able to rename a view
Added handling of a view rename to the mysql_alter_table() function.
We don't set null_value to 0 in the Item_func_compress::val_str() for
not-NULL results.
mysql-test/r/func_compress.result:
Fix for bug #23254: COMPRESS(NULL) makes all futher COMPRESS() calls on same Item return NULL
- test result.
mysql-test/t/func_compress.test:
Fix for bug #23254: COMPRESS(NULL) makes all futher COMPRESS() calls on same Item return NULL
- test case.
sql/item_strfunc.cc:
Fix for bug #23254: COMPRESS(NULL) makes all futher COMPRESS() calls on same Item return NULL
- set null_value.
Do not consider SHOW commands slow queries, just because they don't use proper indexes.
This bug fix is not needed in 5.1, and the code changes will be null merged. However, the test cases will be propogated up to 5.1.
mysql-test/t/show_check-master.opt:
Rename: BitKeeper/deleted/.del-show_check-master.opt -> mysql-test/t/show_check-master.opt
mysql-test/r/ps.result:
Add test case for bug 19764
mysql-test/r/show_check.result:
Add test case for bug 19764
mysql-test/r/union.result:
Adjust test case results based on bug #19764 changes
mysql-test/t/ps.test:
Add test case for bug 19764
mysql-test/t/show_check.test:
Add test case for bug 19764
sql/sql_parse.cc:
Do not log SHOW commands as slow queries just because they don't use indexes.
sql/sql_prepare.cc:
Save stmt_backup.lex->orig_sql_command for use in log_slow_statement()
mysql-test/t/ps-master.opt:
Add log-slow-queries and --log-queries-not-using indexes, to test bug #19764
into shellback.(none):/home/msvensson/mysql/mysql-5.0-maint-new
mysql-test/r/mysql.result:
Auto merged
mysql-test/t/mysql.test:
Auto merged
sql/sql_parse.cc:
Auto merged
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug20953
mysql-test/r/view.result:
Auto merged
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_view.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/sp-error.result:
Manual merge.
should fail to create
The problem was that this type of errors was checked during view
creation, which doesn't happen when CREATE VIEW is a statement of
a created stored routine.
The solution is to perform the checks at parse time. The idea of the
fix is that the parser checks if a construction just parsed is allowed
in current circumstances by testing certain flags, and this flags are
reset for VIEWs.
The side effect of this change is that if the user already have
such bogus routines, it will now get a error when trying to do
SHOW CREATE PROCEDURE proc;
(and some other) and when trying to execute such routine he will get
ERROR 1457 (HY000): Failed to load routine test.p5. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
However there should be very few such users (if any), and they may
(and should) drop these bogus routines.
mysql-test/r/sp-error.result:
Add result for bug#20953: create proc with a create view that uses
local vars/params should fail to create.
mysql-test/r/view.result:
Update results.
mysql-test/t/sp-error.test:
Add test case for bug#20953: create proc with a create view that uses
local vars/params should fail to create.
mysql-test/t/view.test:
Add second test for variable in a view.
Remove SP variable in a view test, as it tests wrong behaviour.
Add test for derived table in a view.
sql/sql_lex.cc:
Remove LEX::variables_used.
sql/sql_lex.h:
Remove LEX::variables_used and add st_parsing_options structure and
LEX::parsing_options member.
sql/sql_view.cc:
Move some error checking to sql/sql_yacc.yy.
sql/sql_yacc.yy:
Check for disallowed syntax in a CREATE VIEW at parse time to rise a
error when it is used inside CREATE PROCEDURE and CREATE FUNCTION, as
well as by itself.
into mysql.com:/home/hf/mysql-5.0.mrg
include/m_ctype.h:
Auto merged
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/r/type_enum.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.cc:
Auto merged
sql/unireg.cc:
Auto merged
strings/ctype-mb.c:
SCCS merged
strings/ctype-utf8.c:
SCCS merged
into polly.local:/home/kaa/src/maint/mysql-5.0-maint
sql-common/my_time.c:
Auto merged
sql/field.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/time.cc:
Auto merged
mysql-test/r/func_time.result:
Manually merged
mysql-test/t/func_time.test:
Manually merged
The Cached_item_decimal::cmp() method wasn't checking for null pointer
returned from the val_decimal() of the item being cached.
This leads to server crash.
The Cached_item_decimal::cmp() method now check for null values.
sql/item_buff.cc:
Bug#22138: Unhandled NULL caused server crash
The Cached_item_decimal::cmp() method now check for null values.
mysql-test/r/type_decimal.result:
Added the test case for bug#22138: Unhandled NULL caused server crash
mysql-test/t/type_decimal.test:
Added the test case for bug#22138: Unhandled NULL caused server crash
hangs on Linux
If REPAIR TABLE ... USE_FRM is issued for table that is located in different
than default database server crash could happen.
In reopen_name_locked_table take database name from table_list (user specified
or default database) instead of from thd (default database).
Affects 4.1 only.
mysql-test/r/repair.result:
A test case for BUG#22562.
mysql-test/t/repair.test:
A test case for BUG#22562.
sql/sql_base.cc:
In reopen_name_locked_table take database name from table_list (user specified
or default database) instead of from thd (default database).
'run_testcase_need_master/slave_restart'
Remove the faulty qw
Only look for mysql_fix_privilege_tables if not windows
mysql-test/lib/mtr_cases.pl:
Move all code to determine when to restart into 'run_testcase_need_master/slave_restart'
Add possibility to wite --force-restart in -master.opt file, this will force a restart and
since master is not started with any special options there is no need to restart
again afterwards.
mysql-test/mysql-test-run.pl:
Remove the qw surrounding ENV{'LD_LIBRARY_PATH'}
Only look for the sh script mysql_fix_privileges when not on windows
Remove warnings about using unitialized variables
Improve the restart logic, eall code to determine when to restart is
now in run_testcase_need_master_restart and run_testcase_need_slave_restart
mysql-test/t/bdb-alter-table-2-master.opt:
Use --force-restart
mysql-test/t/not_embedded_server-master.opt:
Use --force-restart
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_view.cc:
Auto merged
sql/table.cc:
Auto merged
into polly.local:/home/kaa/src/maint/m41-maint--07OGk
sql/field.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
mysql-test/r/func_time.result:
Manually merged
mysql-test/t/func_time.test:
Manually merged
The bug is present only in 4.1, will be null-merged to 5.0
For InnoDB, check value of thd->transaction.all.innodb_active_trans instead of thd->transaction.stmt.innobase_tid to see if we really need to rollback.
mysql-test/r/innodb_mysql.result:
Added testcase for bug #22728 "Handler_rollback value is growing"
mysql-test/t/innodb_mysql.test:
Added testcase for bug #22728 "Handler_rollback value is growing"
sql/handler.cc:
For InnoDB, check value of thd->transaction.all.innodb_active_trans instead of thd->transaction.stmt.innobase_tid to see if we really need to rollback.
Transaction on the slave sql thread got blocked against a slave's mysqld local ta's
lock. Since the default, slave-transaction-retries=10, there was replaying of the
replicated ta. That failed because of a new started from 5.0.13 policy not to rollback
a timed-out transaction. Effectively the first round of a timed-out ta becomes committed
by the replaying's first "BEGIN".
It was decided to backport already existed method working in 5.1 implemented in
bug #16228 for handling symmetrical deadlock problem. That patch introduced end_trans
execution whenever a replicated ta deadlocks or timed-out.
Note, that this solution can be practically suboptimal - in the light of the changed behavior
due to timeout we still could replay only the last statement - only with a high rate of timeouting
replicated transactions.
mysql-test/r/rpl_deadlock.result:
results changed
mysql-test/t/rpl_deadlock.test:
Refining the timeout part of the test to display that the timed-out transaction
is rolled back prior its replaying by slave sql.
Non-zero select's count would mean the first round work became persistent - wrong.
sql/slave.cc:
applying bug#16228 fix, approbated for deadlock use case in 5.1, almost verbatim.
Another alternative to replay only the offending statement requires significant
efforts, incl design work.
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21354
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_sum.cc:
Auto merged
mysql-test/r/ps.result:
Manual merge.
mysql-test/t/ps.test:
Manual merge.
statement.
The problem was that during statement re-execution if the result was
empty the old result could be returned for group functions.
The solution is to implement proper cleanup() method in group
functions.
mysql-test/r/ps.result:
Add result for bug#21354: (COUNT(*) = 1) not working in SELECT inside
prepared statement.
mysql-test/t/func_gconcat.test:
Add a comment that the test case is from bug#836.
mysql-test/t/ps.test:
Add test case for bug#21354: (COUNT(*) = 1) not working in SELECT inside
prepared statement.
sql/item_sum.cc:
Call clear() in Item_sum_count::cleanup().
sql/item_sum.h:
Add comments.
Add proper cleanup() methods.
Change Item_sum::no_rows_in_result() to call clear() instead of reset(),
as the latter also issues add(), and there is nothing to add when there
are no rows in result.
In a trigger or a function used in a statement it is possible to do
SELECT from a table being modified by the statement. However,
encapsulation of such SELECT into a view and selecting from a view
instead of direct SELECT was not possible.
This happened because tables used by views (which in their turn
were used from functions/triggers) were not excluded from checks
in unique_table() routine as it happens for the rest of tables
added to the statement table list for prelocking.
With this fix we ignore all such tables in unique_table(), thus
providing consistency: inside a trigger or a functions SELECT from
a view may be used where plain SELECT is allowed. Modification of
the same table from function or trigger is still disallowed. Also,
this patch doesn't affect the case where SELECT from the table being
modified is done outside of function of trigger, such SELECTs are
still disallowed (this limitation and visibility problem when function
select from a table being modified are subjects of bug 21326). See
also bug 22427.
mysql-test/r/view.result:
Add result for bug#19111: TRIGGERs selecting from a VIEW on the
firing base table fail.
mysql-test/t/view.test:
Add test case for bug#19111: TRIGGERs selecting from a VIEW on the
firing base table fail.
sql/sql_base.cc:
In unique_table() do not check tables that are used in a stored
function or a trigger ('prelocking_placeholder' is set). If such
function or a trigger will attempt to modify a table, the error will
be given, however select is allowed there.
Porting forward tests to replacement files.
mysql-test/r/mysql.result:
Ported changes from previous commit to new file.
mysql-test/t/mysql.test:
Ported changes from previous commit to new file.
When the client program had its stdout file descriptor closed by the calling
shell, after some amount of work (enough to fill a socket buffer) the server
would complain about a packet error and then disconnect the client.
This is a serious security problem. If stdout is closed before the mysql is
exec()d, then the first socket() call allocates file number 1 to communicate
with the server. Subsequent write()s to that file number (as when printing
results that come back from the database) go back to the server instead in
the command channel. So, one should be able to craft data which, upon being
selected back from the server to the client, and injected into the command
stream become valid MySQL protocol to do something nasty when sent /back/ to
the server.
The solution is to close explicitly the file descriptor that we *printf() to,
so that the libc layer and the OS layer both agree that the file is closed.
BitKeeper/etc/collapsed:
BitKeeper file /home/cmiller/work/mysql/bug17583/my41-bug17583/BitKeeper/etc/collapsed
client/mysql.cc:
If standard output is not open (specifically, if dup() of its file number
fails) then we explicitly close it so that future uses of the file descriptor
behave correctly for a closed file.
mysql-test/r/mysql_client.result:
Prove that the problem of writing SQL output to the command socket no longer
exists.
mysql-test/t/mysql_client.test:
Prove that the problem of writing SQL output to the command socket no longer
exists.
into chilla.local:/home/mydev/mysql-5.0-bug8283
include/my_sys.h:
Auto merged
include/myisam.h:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_open.c:
Auto merged
myisam/mi_packrec.c:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/t/myisam.test:
Auto merged
myisam/myisamdef.h:
Bug#8283 - OPTIMIZE TABLE causes data loss
Merge from 4.1
mysql-test/r/myisam.result:
Bug#8283 - OPTIMIZE TABLE causes data loss
Merge from 4.1
mysys/mf_iocache.c:
Bug#8283 - OPTIMIZE TABLE causes data loss
Merge from 4.1
into chilla.local:/home/mydev/mysql-4.1-bug8283-one
myisam/mi_check.c:
Auto merged
myisam/mi_packrec.c:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/r/myisam.result:
Bug#8283 - OPTIMIZE TABLE causes data loss
Manual merge
mysql-test/t/myisam.test:
Bug#8283 - OPTIMIZE TABLE causes data loss
Manual merge
OPTIMIZE TABLE with myisam_repair_threads > 1 performs a non-quick
parallel repair. This means that it does not only rebuild all
indexes, but also the data file.
Non-quick parallel repair works so that there is one thread per
index. The first of the threads rebuilds also the new data file.
The problem was that all threads shared the read io cache on the
old data file. If there were holes (deleted records) in the table,
the first thread skipped them, writing only contiguous, non-deleted
records to the new data file. Then it built the new index so that
its entries pointed to the correct record positions. But the other
threads didn't know the new record positions, but put the positions
from the old data file into the index.
The new design is so that there is a shared io cache which is filled
by the first thread (the data file writer) with the new contiguous
records and read by the other threads. Now they know the new record
positions.
Another problem was that for the parallel repair of compressed
tables a common bit_buff and rec_buff was used. I changed it so
that thread specific buffers are used for parallel repair.
A similar problem existed for checksum calculation. I made this
multi-thread safe too.
include/my_sys.h:
Bug#8283 - OPTIMIZE TABLE causes data loss
Redesign of io_cache_share.
include/myisam.h:
Bug#8283 - OPTIMIZE TABLE causes data loss
Redesign of checksum calculation in mi_check.c.
'calc_checksum' is now in myisamdef.h:st_mi_sort_param.
myisam/mi_check.c:
Bug#8283 - OPTIMIZE TABLE causes data loss
Implemented a new parallel repair design.
Using a synchronized shared read/write cache.
Allowed for thread specific bit_buff, rec_buff, and calc_checksum.
myisam/mi_open.c:
Bug#8283 - OPTIMIZE TABLE causes data loss
Added DBUG output.
myisam/mi_packrec.c:
Bug#8283 - OPTIMIZE TABLE causes data loss
Allowed for thread specific bit_buff and rec_buff.
myisam/myisamdef.h:
Bug#8283 - OPTIMIZE TABLE causes data loss
Commented on checksum calculation variables.
Allowed for thread specific bit_buff.
Added DBUG output for better table crash detection.
myisam/sort.c:
Bug#8283 - OPTIMIZE TABLE causes data loss
Added implications of the new parallel repair design.
Renamed 'info' -> 'sort_param'.
Added DBUG output.
mysql-test/r/myisam.result:
Bug#8283 - OPTIMIZE TABLE causes data loss
Added test results.
mysql-test/t/myisam.test:
Bug#8283 - OPTIMIZE TABLE causes data loss
Added test cases.
mysys/mf_iocache.c:
Bug#8283 - OPTIMIZE TABLE causes data loss
Redesign of io_cache_share.
We do now allow a writer to synchronize himself with the
readers of a shared cache. When all threads join in the lock,
the writer copies the data from his write buffer to the shared
read buffer.
The syntax of the CALL statement, to invoke a stored procedure, has been
changed to make the use of parenthesis optional in the argument list.
With this change, "CALL p;" is equivalent to "CALL p();".
While the SQL spec does not explicitely mandate this syntax, supporting it
is needed for practical reasons, for integration with JDBC / ODBC connectors.
Also, warnings in the sql/sql_yacc.yy file, which were not reported by Bison 2.1
but are now reported by Bison 2.2, have been fixed.
The warning found were:
bison -y -p MYSQL -d --debug --verbose sql_yacc.yy
sql_yacc.yy:653.9-18: warning: symbol UNLOCK_SYM redeclared
sql_yacc.yy:656.9-17: warning: symbol UNTIL_SYM redeclared
sql_yacc.yy:658.9-18: warning: symbol UPDATE_SYM redeclared
sql_yacc.yy:5169.11-5174.11: warning: unused value: $2
sql_yacc.yy:5208.11-5220.11: warning: unused value: $5
sql_yacc.yy:5221.11-5234.11: warning: unused value: $5
conflicts: 249 shift/reduce
"unused value: $2" correspond to the $$=$1 assignment in the 1st {} block
in table_ref -> join_table {} {},
which does not procude a result ($$) for the rule but an intermediate $2
value for the action instead.
"unused value: $5" are similar, with $$ assignments in {} actions blocks
which are not for the final reduce.
mysql-test/r/sp.result:
New test case for Bug#21462
mysql-test/t/sp.test:
New test case for Bug#21462
sql/sql_yacc.yy:
"CALL p;" syntax for calling a stored procedure
Fixed bison 2.2 warnings.
Currently SQL_BIG_RESULT is checked only at compile time.
However, additional optimizations may take place after
this check that change the sort method from 'filesort'
to sorting via index. As a result the actual plan
executed is not the one specified by the SQL_BIG_RESULT
hint. Similarly, there is no such test when executing
EXPLAIN, resulting in incorrect output.
The patch corrects the problem by testing for
SQL_BIG_RESULT both during the explain and execution
phases.
mysql-test/r/bdb.result:
Bug #22781: SQL_BIG_RESULT fails to influence sort plan
- updated sql_big_result testcase
mysql-test/r/group_by.result:
Bug #22781: SQL_BIG_RESULT fails to influence sort plan
- test case with MyISAM
mysql-test/r/innodb.result:
Bug #22781: SQL_BIG_RESULT fails to influence sort plan
- updated sql_big_result testcase
mysql-test/r/innodb_mysql.result:
Bug #22781: SQL_BIG_RESULT fails to influence sort plan
- test case with InnoDB
mysql-test/r/myisam.result:
Bug #22781: SQL_BIG_RESULT fails to influence sort plan
- updated sql_big_result testcase
mysql-test/t/group_by.test:
Bug #22781: SQL_BIG_RESULT fails to influence sort plan
- test case with MyISAM
mysql-test/t/innodb_mysql.test:
Bug #22781: SQL_BIG_RESULT fails to influence sort plan
- test case with InnoDB
sql/sql_select.cc:
Bug #22781: SQL_BIG_RESULT fails to influence sort plan
- When SQL_BIG_RESULT is specified, disable the optimization performed
at execution/explain time that decides to use an index instead
of filesort.
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
client/mysqltest.c:
Auto merged
mysql-test/t/rpl_slave_status.test:
Auto merged
mysql-test/t/system_mysql_db_fix.test:
Auto merged
into neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
mysql-test/r/mysqltest.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
BitKeeper/deleted/.del-mtr_stress.pl:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
BitKeeper/deleted/.del-mtr_im.pl:
Delete: mysql-test/lib/mtr_im.pl
client/mysqltest.c:
Use remote
mysql-test/mysql-test-run.pl:
Use remote
mysql-test/lib/mtr_process.pl:
Use remote
Note: bug#21726 does not directly apply to 4.1, as it doesn't have stored
procedures. However, 4.1 had some bugs that were fixed in 5.0 by the
patch for bug#21726, and this patch is a backport of those fixes.
Namely, in 4.1 it fixes:
- LAST_INSERT_ID(expr) didn't return value of expr (4.1 specific).
- LAST_INSERT_ID() could return the value generated by current
statement if the call happens after the generation, like in
CREATE TABLE t1 (i INT AUTO_INCREMENT PRIMARY KEY, j INT);
INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
- Redundant binary log LAST_INSERT_ID_EVENTs could be generated.
mysql-test/r/rpl_insert_id.result:
Add result for bug#21726: Incorrect result with multiple invocations
of LAST_INSERT_ID.
mysql-test/t/rpl_insert_id.test:
Add test case for bug#21726: Incorrect result with multiple invocations
of LAST_INSERT_ID.
sql/item_func.cc:
Add implementation of Item_func_last_insert_id::fix_fields(), where we
set THD::last_insert_id_used when statement calls LAST_INSERT_ID().
In Item_func_last_insert_id::val_int(), return THD::current_insert_id
if called like LAST_INSERT_ID(), otherwise return value of argument if
called like LAST_INSERT_ID(expr).
sql/item_func.h:
Add declaration of Item_func_last_insert_id::fix_fields().
sql/log_event.cc:
Do not set THD::last_insert_id_used on LAST_INSERT_ID_EVENT. Though we
know the statement will call LAST_INSERT_ID(), it wasn't called yet.
sql/set_var.cc:
In sys_var_last_insert_id::value_ptr(), set THD::last_insert_id_used,
and return THD::current_insert_id for @@LAST_INSERT_ID.
sql/sql_class.h:
Update comments.
Remove THD::insert_id(), as it has lost its purpose now.
sql/sql_insert.cc:
Now it is OK to read THD::last_insert_id directly.
sql/sql_load.cc:
Now it is OK to read THD::last_insert_id directly.
sql/sql_parse.cc:
In mysql_execute_command(), remember THD::last_insert_id (first
generated value of the previous statement) in THD::current_insert_id,
which then will be returned for LAST_INSERT_ID() and @@LAST_INSERT_ID.
sql/sql_select.cc:
If "IS NULL" is replaced with "= <LAST_INSERT_ID>", use right value,
which is THD::current_insert_id, and also set THD::last_insert_id_used
to issue binary log LAST_INSERT_ID_EVENT.
sql/sql_update.cc:
Now it is OK to read THD::last_insert_id directly.
tests/mysql_client_test.c:
Add test case for bug#21726: Incorrect result with multiple invocations
of LAST_INSERT_ID.
mysql-test/mysql-test-run.pl:
Use same location for slave-load-tmpdir in all versions
mysql-test/mysql-test-run.sh:
Use same location for slave-load-tmpdir in all versions
mysql-test/r/rpl_loaddata.result:
Update result after changing slave-load-tmpdir to use a shorter path
mysql-test/r/rpl_loaddatalocal.result:
Update result after changing slave-load-tmpdir to use a shorter path
mysql-test/r/rpl_log.result:
Update result after changing slave-load-tmpdir to use a shorter path
mysql-test/t/rpl_loaddatalocal.test:
Use MYSQLTEST_VARDIR when specifying path to load from(backport from 5.0)
Use new command "remove_file" instead of s"ystem rm"
into mysql.com:/home/svoj/devel/mysql/BUG21381/mysql-5.0-engines
mysql-test/r/ndb_update.result:
Auto merged
mysql-test/t/ndb_update.test:
Auto merged
sql/sql_update.cc:
Manual merge.
Though this is not storage engine specific problem, I was able to
repeat this problem with BDB and NDB engines only. That was the
reason to add a test case into ndb_update.test. As a result
different bad things could happen.
BDB has removed duplicate rows which is not expected.
NDB returns an error.
For multi table update notify storage engine about UPDATE IGNORE
as it is done in single table UPDATE.
mysql-test/r/ndb_update.result:
A test case for bug#21381.
mysql-test/t/ndb_update.test:
A test case for bug#21381.
sql/sql_update.cc:
For multi table update notify storage engine about UPDATE IGNORE
as it is done in single table UPDATE.
into mysql.com:/home/gluh/MySQL/Merge/4.1-kt
include/m_ctype.h:
Auto merged
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
sql/table.cc:
Auto merged
sql/unireg.cc:
Auto merged
into neptunus.(none):/home/msvensson/mysql/same_tools/my50-same_tools
client/mysqltest.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/mysqltest.result:
Auto merged
The problem appears when we have a space followed by a non-format symbol.
Fix: properly skip spaces.
mysql-test/r/date_formats.result:
Fix for bug #22029: str_to_date returning NULL, while date_format works using identical format.
- test result.
mysql-test/t/date_formats.test:
Fix for bug #22029: str_to_date returning NULL, while date_format works using identical format.
- test case.
sql/item_timefunc.cc:
Fix for bug #22029: str_to_date returning NULL, while date_format works using identical format.
- skipping pre-spaces between each argument moved.
I.e take advantage of the fact that a # comment is always terminated by a new line
Add tests for the above
client/mysqltest.c:
Improve "check_eol_junk" to detect junk although there are multi line comments in the way.
I.e take advantage of the fact that a # comment is always terminated by a new line
mysql-test/r/mysqltest.result:
Update resut file
mysql-test/t/mysqltest.test:
Add test for improved check_eol_junk