Bug#35220: ALTER TABLE too picky on reserved word "foreign"
In ALTER TABLE, change the internal parser to search for
``FOREIGN[[:space:]]'' instead of only ``FOREIGN'' when parsing
ALTER TABLE ... DROP FOREIGN KEY ...; otherwise it could be mistaken
with ALTER TABLE ... DROP foreign_col;
(This fix is already present in MySQL 5.1 and higher.)
running on Windows
We used two OS-specific methods of looking up the executable
name, which don't work outside of those two kinds of OSes
(Linux+Solaris and Windows).
We assume that if the user ran this program with a certain
name, we can run the other sibling programs with a similar name.
(re-patch in bzr)
Post-merge fix: remove spurious semicolon that caused the function
to return failure regardless of the outcome.
sql/sql_parse.cc:
Remove spurious semicolon.
are not created {Netware}
The init and test sql files were not created at cross-compilation time.
Now, make them in the default build rule. Additionally, remove the "fix"
SQL instructions, which are unnecessary for newly initialized databases.
Also, clean up the english in an error message, and BZRify nwbootstrap.
Post-merge fix: Alter linking order so that the thread linking
flags appear last in the list. This needs to be done this way
because some linkers will not search the thread archive again
if a undefined symbol (pthread_kill in this case) appears later.
client/Makefile.am:
Link mysys before thread libs.
innodb-5.0-ss2475.
Bug #34286 Assertion failure in thread 2816 in file .\row\row0sel.c line 3500
Since autoinc init performs a MySQL SELECT query to determine the auto-inc
value, set prebuilt->sql_stat_start = TRUE so that it is performed like any
normal SELECT, regardless of the context in which it was invoked.
Bug #35352 If InnoDB crashes with UNDO slots full error the error persists on restart
We've added a heuristic that checks the size of the UNDO slots cache lists
(insert and upate). If either of cached lists has more than 500 entries then we
add any UNDO slots that are freed, to the common free list instead of the cache
list, this is to avoid the case where all the free slots end up in only one of
the lists on startup after a crash.
Tested with test case for 26590 and passes all mysql-test(s).
Bug #36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number
Fixed by removing the Innodb_buffer_pool_pages_latched variable from SHOW
STATUS output in non-UNIV_DEBUG compilation.
Reset session sql_mode before creating system tables as it
is done in the mysql_fix_privilege_tables.sql script.
scripts/mysql_system_tables.sql:
reset sql mode
min() and max() functions are implemented in MySQL as macros.
This means that max(a,b) is expanded to: ((a) > (b) ? (a) : (b))
Note how 'a' is quoted two times.
Now imagine 'a' is a recursive function call that's several 10s of levels deep.
And the recursive function does max() with a function arg as well to dive into
recursion.
This means that simple function call can take most of the clock time.
Identified and fixed several such calls to max()/min() : including the IF()
sql function implementation.
mysql-test/r/func_if.result:
Bug#37662 test case
mysql-test/t/func_if.test:
Bug#37662 test case
sql/item.cc:
Bug#37662 don't call expensive functions as arguments to min/max
sql/item_cmpfunc.cc:
Bug#37662 don't call expensive functions as arguments to min/max
sql/item_func.cc:
Bug#37662 don't call expensive functions as arguments to min/max
Post-push fix: updated some result files that were affected
by the previous fix to this bug.
mysql-test/suite/binlog/r/binlog_killed_simulate.result:
Updated result file.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Updated result file.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Updated result file.
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
Updated result file.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Updated result file.
mysql-test/suite/rpl/r/rpl_stm_log.result:
Updated result file.
Problem: Extra new line appeared in jisx0208_sjis2.dat in a mistake, which
broke jp_convert_sjis and jp_select_sjis tests.
Fix: removing extra line
mysql-test/suite/jp/std_data/jisx0208_sjis2.dat:
removing wrong extra new line
mysql-test/suite/jp/t/disabled.def:
activating disabled tests
Calling List<Cached_item>::delete_elements for the same list twice
caused a crash of the server in the function JOIN::cleaunup.
Ensured that delete_elements() in JOIN::cleanup would be called only once.
mysql-test/r/subselect.result:
Added a test case for bug #38191.
mysql-test/t/subselect.test:
Added a test case for bug #38191.
sql/sql_select.cc:
Fixed bug #38191.
Ensured that delete_elements() in JOIN::cleanup would be called only once.
Tables in the table definition cache are keeping a cache buffer for blob
fields which can consume a lot of memory.
This patch introduces a maximum size threshold for these buffers.
sql/sql_base.cc:
Added function free_field_buffers_larger_than to reclaim memory from blob
field buffers too large to be cached.
sql/table.cc:
Added function free_field_buffers_larger_than
Problem: binlog_stm_binlog runs INSERT DELAYED queries, and
then prints the contents of the binlog. Before checking the
contents of the binlog, the test waits until the rows have
appeared in the table. However, this is not enough, since
INSERT DELAYED does not write rows to the binlog at the same
time as it writes them to the table. So there is a race.
Fix: Add a FLUSH TABLES before SHOW BINLOG EVENTS. That
waits until the insert_delayed thread is done.
mysql-test/extra/binlog_tests/binlog_insert_delayed.test:
- Added FLUSH TABLES, so that SHOW BINLOG EVENTS becomes
deterministic.
- Added comments.
- Removed unnecessary 'set @@session.auto_increment_increment'
statements.
- Removed unnecessary check that the number of rows inserted
to the table is 11.
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
updated result file
BUG#37884: rpl_row_basic_2myisam and rpl_row_basic_3innodb fail sporadically in pushbuild
These have been fixed in 5.1-rpl. Re-applying fix for BUG#37884
in 5.1-bugteam, and disabling rpl_flushlog_loop for BUG#37733 in
5.1-bugteam.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Missing sync_slave_with_master added.
mysql-test/suite/rpl/t/disabled.def:
Disabling rpl_flushlog_loop until the fixed version gets
merged from 5.1-rpl
Range scan in descending order for c <= <col> <= c type of
ranges was ignoring the DESC flag.
However some engines like InnoDB have the primary key parts
as a suffix for every secondary key.
When such primary key suffix is used for ordering ignoring
the DESC is not valid.
But we generally would like to do this because it's faster.
Fixed by performing only reverse scan if the primary key is used.
Removed some dead code in the process.
mysql-test/r/innodb_mysql.result:
Bug#37830 : test case
mysql-test/t/innodb_mysql.test:
Bug#37830 : test case
sql/opt_range.cc:
Bug#37830 :
- preserve and use used_key_parts to
distinguish when a primary key suffix is used
- removed some dead code
sql/opt_range.h:
Bug#37830 :
- preserve used_key_parts
- dead code removed
sql/sql_select.cc:
Bug#37830 : Do only reverse order traversal
if the primary key suffix is used.
Problem: the test waits for a 'DROP TEMPORARY TABLE' event to
appear in the master's binlog, then checks on the slave whether
the number of temporary tables has decreased. The slave does
not sync, causing a race.
Fix: check for the 'DROP TEMPORARY TABLE' event on slave
instead of on master.
mysql-test/suite/rpl/t/rpl_trunc_temp.test:
- Fixed BUG#37493 by waiting for the event on the slave
instead of on the master.
- Added comments.