merge from 5.5 repo.

This commit is contained in:
Andrei Elkin 2012-01-31 17:07:44 +02:00
commit f12b33e22d
84 changed files with 1710 additions and 173 deletions

View File

@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5 MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=21 MYSQL_VERSION_PATCH=22
MYSQL_VERSION_EXTRA= MYSQL_VERSION_EXTRA=

View File

@ -1018,7 +1018,7 @@ static int find_plugin(char *tp_path)
Build the boostrap file. Build the boostrap file.
Create a new file and populate it with SQL commands to ENABLE or DISABLE Create a new file and populate it with SQL commands to ENABLE or DISABLE
the plugin via INSERT and DELETE operations on the mysql.plugin table. the plugin via REPLACE and DELETE operations on the mysql.plugin table.
param[in] operation The type of operation (ENABLE or DISABLE) param[in] operation The type of operation (ENABLE or DISABLE)
param[out] bootstrap A FILE* pointer param[out] bootstrap A FILE* pointer
@ -1035,12 +1035,16 @@ static int build_bootstrap_file(char *operation, char *bootstrap)
Perform plugin operation : ENABLE or DISABLE Perform plugin operation : ENABLE or DISABLE
The following creates a temporary bootstrap file and populates it with The following creates a temporary bootstrap file and populates it with
the appropriate SQL commands for the operation. For ENABLE, INSERT the appropriate SQL commands for the operation. For ENABLE, REPLACE
statements are created. For DISABLE, DELETE statements are created. The statements are created. For DISABLE, DELETE statements are created. The
values for these statements are derived from the plugin_data read from the values for these statements are derived from the plugin_data read from the
<plugin_name>.ini configuration file. Once the file is built, a call to <plugin_name>.ini configuration file. Once the file is built, a call to
mysqld is made in read only, bootstrap modes to read the SQL statements mysqld is made in read only, bootstrap modes to read the SQL statements
and execute them. and execute them.
Note: Replace was used so that if a user loads a newer version of a
library with a different library name, the new library name is
used for symbols that match.
*/ */
if ((error= make_tempfile(bootstrap, "sql"))) if ((error= make_tempfile(bootstrap, "sql")))
{ {
@ -1057,7 +1061,7 @@ static int build_bootstrap_file(char *operation, char *bootstrap)
if (strcasecmp(operation, "enable") == 0) if (strcasecmp(operation, "enable") == 0)
{ {
int i= 0; int i= 0;
fprintf(file, "INSERT IGNORE INTO mysql.plugin VALUES "); fprintf(file, "REPLACE INTO mysql.plugin VALUES ");
for (i= 0; i < (int)array_elements(plugin_data.components); i++) for (i= 0; i < (int)array_elements(plugin_data.components); i++)
{ {
/* stop when we read the end of the symbol list - marked with NULL */ /* stop when we read the end of the symbol list - marked with NULL */

View File

@ -66,6 +66,8 @@ typedef struct unicase_info_st
extern MY_UNICASE_INFO *my_unicase_default[256]; extern MY_UNICASE_INFO *my_unicase_default[256];
extern MY_UNICASE_INFO *my_unicase_turkish[256]; extern MY_UNICASE_INFO *my_unicase_turkish[256];
extern MY_UNICASE_INFO *my_unicase_mysql500[256];
typedef struct uni_ctype_st typedef struct uni_ctype_st
{ {
@ -337,6 +339,7 @@ extern CHARSET_INFO my_charset_tis620_bin;
extern CHARSET_INFO my_charset_ucs2_general_ci; extern CHARSET_INFO my_charset_ucs2_general_ci;
extern CHARSET_INFO my_charset_ucs2_bin; extern CHARSET_INFO my_charset_ucs2_bin;
extern CHARSET_INFO my_charset_ucs2_unicode_ci; extern CHARSET_INFO my_charset_ucs2_unicode_ci;
extern CHARSET_INFO my_charset_ucs2_general_mysql500_ci;
extern CHARSET_INFO my_charset_ujis_japanese_ci; extern CHARSET_INFO my_charset_ujis_japanese_ci;
extern CHARSET_INFO my_charset_ujis_bin; extern CHARSET_INFO my_charset_ujis_bin;
extern CHARSET_INFO my_charset_utf16_bin; extern CHARSET_INFO my_charset_utf16_bin;
@ -349,6 +352,7 @@ extern CHARSET_INFO my_charset_utf32_unicode_ci;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci; extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci;
extern CHARSET_INFO my_charset_utf8_unicode_ci; extern CHARSET_INFO my_charset_utf8_unicode_ci;
extern CHARSET_INFO my_charset_utf8_bin; extern CHARSET_INFO my_charset_utf8_bin;
extern CHARSET_INFO my_charset_utf8_general_mysql500_ci;
extern CHARSET_INFO my_charset_utf8mb4_bin; extern CHARSET_INFO my_charset_utf8mb4_bin;
extern CHARSET_INFO my_charset_utf8mb4_general_ci; extern CHARSET_INFO my_charset_utf8mb4_general_ci;
extern CHARSET_INFO my_charset_utf8mb4_unicode_ci; extern CHARSET_INFO my_charset_utf8mb4_unicode_ci;

View File

@ -25,6 +25,8 @@ INCLUDE_DIRECTORIES(
ADD_DEFINITIONS(${SSL_DEFINES}) ADD_DEFINITIONS(${SSL_DEFINES})
SET(CLIENT_API_FUNCTIONS SET(CLIENT_API_FUNCTIONS
get_tty_password
handle_options
load_defaults load_defaults
mysql_thread_end mysql_thread_end
mysql_thread_init mysql_thread_init

View File

@ -200,7 +200,7 @@ START SLAVE;
--let $slave_param_value=1236 --let $slave_param_value=1236
--source include/wait_for_slave_param.inc --source include/wait_for_slave_param.inc
--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ --let $slave_field_result_replace= / at [0-9]*/ at XXX/
--let $status_items= Last_IO_Errno, Last_IO_Error --let $status_items= Last_IO_Errno, Last_IO_Error
--source include/show_slave_status.inc --source include/show_slave_status.inc

View File

@ -15,7 +15,7 @@ if (!$EXAMPLE_PLUGIN) {
# #
# Check if --plugin-dir was setup for exampledb # Check if --plugin-dir was setup for exampledb
# #
if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$EXAMPLE_PLUGIN_OPT'`) { if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$EXAMPLE_PLUGIN_OPT/'`) {
--skip Example plugin requires that --plugin-dir is set to the example plugin dir (either the .opt file does not contain \$EXAMPLE_PLUGIN_OPT or another plugin is in use) --skip Example plugin requires that --plugin-dir is set to the example plugin dir (either the .opt file does not contain \$EXAMPLE_PLUGIN_OPT or another plugin is in use)
} }
enable_query_log; enable_query_log;

View File

@ -16,6 +16,6 @@ if (!$SEMISYNC_MASTER_PLUGIN)
# #
# Check if --plugin-dir was setup for semisync # Check if --plugin-dir was setup for semisync
# #
if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SEMISYNC_PLUGIN_OPT'`) { if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$SEMISYNC_PLUGIN_OPT/'`) {
--skip SEMISYNC plugin requires that --plugin-dir is set to the semisync plugin dir (either the .opt file does not contain \$SEMISYNC_PLUGIN_OPT or another plugin is in use) --skip SEMISYNC plugin requires that --plugin-dir is set to the semisync plugin dir (either the .opt file does not contain \$SEMISYNC_PLUGIN_OPT or another plugin is in use)
} }

View File

@ -15,6 +15,6 @@ if (!$SIMPLE_PARSER) {
# #
# Check if --plugin-dir was setup for simple parser # Check if --plugin-dir was setup for simple parser
# #
if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SIMPLE_PARSER_OPT'`) { if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$SIMPLE_PARSER_OPT/'`) {
--skip simple parser requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use) --skip simple parser requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use)
} }

View File

@ -15,6 +15,6 @@ if (!$UDF_EXAMPLE_LIB) {
# #
# Check if --plugin-dir was setup for udf # Check if --plugin-dir was setup for udf
# #
if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$UDF_EXAMPLE_LIB_OPT'`) { if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$UDF_EXAMPLE_LIB_OPT/'`) {
--skip UDF requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use) --skip UDF requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use)
} }

View File

@ -0,0 +1,9 @@
#
# Plugin configuration file. Place the following on a separate line:
#
# library binary file name (without .so or .dll)
# component_name
# [component_name] - additional components in plugin
#
liblibdaemon_example
daemon_example

View File

@ -56,10 +56,17 @@
# #
# --let $status_items= Master_Log_File, Relay_Master_Log_File # --let $status_items= Master_Log_File, Relay_Master_Log_File
# #
# $slave_io_error_replace # $slave_field_result_replace
# If set, one or more regex patterns for replacing variable # If set, one or more regex patterns for replacing variable
# text in the error message. Syntax as --replace-regex # text in the error message. Syntax as --replace-regex
# #
# $slave_sql_mode
# If set, change the slave sql mode during this macro, reverting
# to the previous on exit. Default sql_mode is NO_BACKSLASH_ESCAPES
# to allow replace '\' by '/' making paths OS independent. Example:
#
# --let $slave_sql_mode= NO_BACKSLASH_ESCAPES
#
--let $_show_slave_status_items=$status_items --let $_show_slave_status_items=$status_items
@ -69,13 +76,30 @@ if (!$status_items)
} }
--let $_slave_sql_mode= NO_BACKSLASH_ESCAPES
if ($slave_sql_mode)
{
--let $_slave_sql_mode= $slave_sql_mode
}
--let $_previous_slave_sql_mode = `SELECT @@sql_mode`
--disable_query_log
eval SET sql_mode= '$_slave_sql_mode';
--enable_query_log
while ($_show_slave_status_items) while ($_show_slave_status_items)
{ {
--let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)` --let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)`
--let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))` --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))`
--let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1) --let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1)
--replace_regex $slave_io_error_replace --let $_slave_field_result_replace= /[\\]/\// $slave_field_result_replace
--replace_regex $_slave_field_result_replace
--let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')` --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')`
--echo $_show_slave_status_name = '$_show_slave_status_value' --echo $_show_slave_status_name = '$_show_slave_status_value'
} }
--disable_query_log
eval SET sql_mode= '$_previous_slave_sql_mode';
--enable_query_log

View File

@ -1,13 +1,11 @@
# ==== Purpose ==== # ==== Purpose ====
# #
# Several test primitives from mysql-test/extra/rpl_tests # Several test primitives from mysql-test/extra/rpl_tests
# shared for test cases for MyISAM, InnoDB, NDB and other # are shared for test cases for MyISAM, InnoDB, NDB and
# engines. But for NDB all events will be added by NDB # other engines.
# injector and now there are no way to detect the state of # For NDB engine all events will be added by NDB injector
# NDB injector therefore this primitive waits 5 sec # so tests only can continue after injector is ready,
# if engine type is NDB. # this test waits for proper injector thread state.
# In future that should be fixed by waiting of proper
# state of NDB injector.
# #
# ==== Usage ==== # ==== Usage ====
# #
@ -17,25 +15,12 @@
# ==== Parameters ===== # ==== Parameters =====
# #
# $engine_type # $engine_type
# Type of engine. If type is NDB then it waits $wait_time sec # Type of engine. If type is NDB then it waits for injector
# # thread proper state.
# $wait_time
# Test will wait $wait_time seconds
let $_wait_time= 5;
if (!$wait_time) {
let $_wait_time= $wait_time;
}
if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) { if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) {
while (!$_wait_time) { let $show_statement= SHOW PROCESSLIST;
let $_wait_time_internal= 10; let $field= State;
while (!$_wait_time_internal) { let $condition= = 'Waiting for event from ndbcluster';
sleep 0.1; source include/wait_show_condition.inc;
dec $_wait_time_internal;
}
dec $_wait_time;
}
} }

View File

@ -76,6 +76,7 @@ if ($show_slave_io_error)
{ {
--let $_wait_for_slave_io_error_old_status_items= $status_items --let $_wait_for_slave_io_error_old_status_items= $status_items
--let $status_items= Last_IO_Error --let $status_items= Last_IO_Error
--let $slave_field_result_replace= $slave_io_error_replace
--source include/show_slave_status.inc --source include/show_slave_status.inc
--let $status_items= $_wait_for_slave_io_error_old_status_items --let $status_items= $_wait_for_slave_io_error_old_status_items
} }

View File

@ -438,3 +438,67 @@ Level Code Message
Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 0) and ('0' = `test`.`t1`.`b`)) Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 0) and ('0' = `test`.`t1`.`b`))
DROP TABLE t1; DROP TABLE t1;
# End of 5.1 tests # End of 5.1 tests
#
# Bug#13463415 63502: INCORRECT RESULTS OF BIGINT AND DECIMAL COMPARISON
#
CREATE TABLE t_bigint(id BIGINT);
INSERT INTO t_bigint VALUES (1), (2);
SELECT id, id >= 1.1 FROM t_bigint;
id id >= 1.1
1 0
2 1
SELECT id, 1.1 <= id FROM t_bigint;
id 1.1 <= id
1 0
2 1
SELECT id, id = 1.1 FROM t_bigint;
id id = 1.1
1 0
2 0
SELECT id, 1.1 = id FROM t_bigint;
id 1.1 = id
1 0
2 0
SELECT * from t_bigint WHERE id = 1.1;
id
SELECT * from t_bigint WHERE id = 1.1e0;
id
SELECT * from t_bigint WHERE id = '1.1';
id
SELECT * from t_bigint WHERE id = '1.1e0';
id
SELECT * from t_bigint WHERE id IN (1.1, 2.2);
id
SELECT * from t_bigint WHERE id IN (1.1e0, 2.2e0);
id
SELECT * from t_bigint WHERE id IN ('1.1', '2.2');
id
SELECT * from t_bigint WHERE id IN ('1.1e0', '2.2e0');
id
SELECT * from t_bigint WHERE id BETWEEN 1.1 AND 1.9;
id
SELECT * from t_bigint WHERE id BETWEEN 1.1e0 AND 1.9e0;
id
SELECT * from t_bigint WHERE id BETWEEN '1.1' AND '1.9';
id
SELECT * from t_bigint WHERE id BETWEEN '1.1e0' AND '1.9e0';
id
DROP TABLE t_bigint;
#
# Bug#11758543 50756: BIGINT '100' MATCHES 1.001E2
#
CREATE TABLE t1 (a BIGINT);
INSERT INTO t1 VALUES (1);
SELECT * FROM t1 WHERE coalesce(a) BETWEEN 0 and 0.9;
a
SELECT * FROM t1 WHERE coalesce(a)=0.9;
a
SELECT * FROM t1 WHERE coalesce(a) in (0.8,0.9);
a
SELECT * FROM t1 WHERE a BETWEEN 0 AND 0.9;
a
SELECT * FROM t1 WHERE a=0.9;
a
SELECT * FROM t1 WHERE a IN (0.8,0.9);
a
DROP TABLE t1;

View File

@ -1928,6 +1928,30 @@ D120
SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)); SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20));
HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)) HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20))
D120D18E D120D18E
#
# Bug#11752408 - 43593: DUMP/BACKUP/RESTORE/UPGRADE TOOLS FAILS BECAUSE OF UTF8_GENERAL_CI
#
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci);
INSERT INTO t1 VALUES ('a'),('r'),('s'),(_latin1 0xDF),(_latin1 0xF7),('t'),('z');
SELECT * FROM t1 ORDER BY a;
a
a
r
s
t
z
ß
÷
SELECT a, COUNT(*) FROM t1 GROUP BY a;
a COUNT(*)
a 1
r 1
s 1
t 1
z 1
ß 1
÷ 1
DROP TABLE t1;
End of 5.1 tests End of 5.1 tests
Start of 5.4 tests Start of 5.4 tests
SET NAMES utf8mb3; SET NAMES utf8mb3;

View File

@ -469,6 +469,8 @@ SELECT HEX(a) FROM t2 WHERE a IN
HEX(a) HEX(a)
7FFFFFFFFFFFFFFE 7FFFFFFFFFFFFFFE
7FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'abc'
CREATE TABLE t3 (a BIGINT UNSIGNED); CREATE TABLE t3 (a BIGINT UNSIGNED);
INSERT INTO t3 VALUES (9223372036854775551); INSERT INTO t3 VALUES (9223372036854775551);
SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42); SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);

View File

@ -2826,5 +2826,41 @@ SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc));
((0xf3) * (rpad(1.0,2048,1)) << (0xcc)) ((0xf3) * (rpad(1.0,2048,1)) << (0xcc))
0 0
# #
# Bug#13359121 LARGE NUMBERS, /STRINGS/DTOA.C:662:
# BALLOC: ASSERTION `K <= 15' FAILED.
# Bug#12985021 SIMPLE QUERY WITH DECIMAL NUMBERS TAKE AN
# EXTRAORDINARY LONG TIME TO EXECUTE
SELECT @tmp_max:= @@global.max_allowed_packet;
@tmp_max:= @@global.max_allowed_packet
1048576
SET @@global.max_allowed_packet=1024*1024*1024;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
do
format(rpad('111111111.1',
1111111,
'999999999999999999999999999999999999999999'),0,'be_BY')
;
DO
round(
concat( (
coalesce( (
linefromwkb('2147483648',
-b'1111111111111111111111111111111111111111111')),
( convert('[.DC2.]',decimal(30,30)) ),
bit_count('')
) ),
( lpad( ( elt('01','}:K5')),
sha1('P'),
( ( select '-9223372036854775808.1' > all (select '')))
)
)
)
);
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: '[.DC2.]'
SET @@global.max_allowed_packet:= @tmp_max;
#
# End of 5.5 tests # End of 5.5 tests
# #

View File

@ -1402,8 +1402,220 @@ NULL
# Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0, # Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0,
# #
DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5); DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5);
#
# BUG#13458237 INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY
# SIMILAR TO '2009-10-00'
#
SELECT
DATE('20091000'),
STR_TO_DATE('200910','%Y%m'),
LAST_DAY('2009-10-00'),
LAST_DAY(DATE('2009-10-00')),
LAST_DAY(DATE'2009-10-00'),
LAST_DAY(STR_TO_DATE('200910','%Y%m')),
WEEK('2009-10-00'),
WEEK(DATE('2009-10-00')),
WEEK(DATE'2009-10-00'),
WEEK(STR_TO_DATE('200910','%Y%m')),
WEEKOFYEAR('2009-10-00'),
WEEKOFYEAR(DATE('2009-10-00')),
WEEKOFYEAR(DATE'2009-10-00'),
WEEKOFYEAR(STR_TO_DATE('200910','%Y%m')),
DAYOFYEAR('2009-10-00'),
DAYOFYEAR(DATE('2009-10-00')),
DAYOFYEAR(DATE'2009-10-00'),
DAYOFYEAR(STR_TO_DATE('200910','%Y%m')),
WEEKDAY('2009-10-00'),
WEEKDAY(DATE('2009-10-00')),
WEEKDAY(DATE'2009-10-00'),
WEEKDAY(STR_TO_DATE('200910','%Y%m')),
TO_DAYs('2009-10-00'),
TO_DAYs(DATE('2009-10-00')),
TO_DAYs(DATE'2009-10-00'),
TO_DAYs(STR_TO_DATE('200910','%Y%m'));
DATE('20091000') 2009-10-00
STR_TO_DATE('200910','%Y%m') 2009-10-00
LAST_DAY('2009-10-00') NULL
LAST_DAY(DATE('2009-10-00')) 2009-10-31
LAST_DAY(DATE'2009-10-00') NULL
LAST_DAY(STR_TO_DATE('200910','%Y%m')) 2009-10-31
WEEK('2009-10-00') NULL
WEEK(DATE('2009-10-00')) 39
WEEK(DATE'2009-10-00') NULL
WEEK(STR_TO_DATE('200910','%Y%m')) NULL
WEEKOFYEAR('2009-10-00') NULL
WEEKOFYEAR(DATE('2009-10-00')) 40
WEEKOFYEAR(DATE'2009-10-00') NULL
WEEKOFYEAR(STR_TO_DATE('200910','%Y%m')) NULL
DAYOFYEAR('2009-10-00') NULL
DAYOFYEAR(DATE('2009-10-00')) 273
DAYOFYEAR(DATE'2009-10-00') NULL
DAYOFYEAR(STR_TO_DATE('200910','%Y%m')) NULL
WEEKDAY('2009-10-00') NULL
WEEKDAY(DATE('2009-10-00')) 2
WEEKDAY(DATE'2009-10-00') NULL
WEEKDAY(STR_TO_DATE('200910','%Y%m')) NULL
TO_DAYs('2009-10-00') NULL
TO_DAYs(DATE('2009-10-00')) 734045
TO_DAYs(DATE'2009-10-00') NULL
TO_DAYs(STR_TO_DATE('200910','%Y%m')) NULL
Warnings: Warnings:
Warning 1292 Incorrect datetime value: '0' Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1411
Message Incorrect datetime value: '200910' for function str_to_date
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1411
Message Incorrect datetime value: '200910' for function str_to_date
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1411
Message Incorrect datetime value: '200910' for function str_to_date
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1411
Message Incorrect datetime value: '200910' for function str_to_date
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1292
Message Incorrect datetime value: '2009-10-00'
Level Warning
Code 1411
Message Incorrect datetime value: '200910' for function str_to_date
SELECT
DATE('00000100'),
STR_TO_DATE('000001','%Y%m'),
LAST_DAY('0000-01-00'),
LAST_DAY(DATE('0000-01-00')),
LAST_DAY(DATE'0000-01-00'),
LAST_DAY(STR_TO_DATE('000001','%Y%m')),
WEEK('0000-01-00'),
WEEK(DATE('0000-01-00')),
WEEK(DATE'0000-01-00'),
WEEK(STR_TO_DATE('000001','%Y%m')),
WEEKOFYEAR('0000-01-00'),
WEEKOFYEAR(DATE('0000-01-00')),
WEEKOFYEAR(DATE'0000-01-00'),
WEEKOFYEAR(STR_TO_DATE('000001','%Y%m')),
DAYOFYEAR('0000-01-00'),
DAYOFYEAR(DATE('0000-01-00')),
DAYOFYEAR(DATE'0000-01-00'),
DAYOFYEAR(STR_TO_DATE('000001','%Y%m')),
WEEKDAY('0000-01-00'),
WEEKDAY(DATE('0000-01-00')),
WEEKDAY(DATE'0000-01-00'),
WEEKDAY(STR_TO_DATE('000001','%Y%m')),
TO_DAYs('0000-01-00'),
TO_DAYs(DATE('0000-01-00')),
TO_DAYs(DATE'0000-01-00'),
TO_DAYs(STR_TO_DATE('000001','%Y%m'));
DATE('00000100') 0000-01-00
STR_TO_DATE('000001','%Y%m') 0000-01-00
LAST_DAY('0000-01-00') NULL
LAST_DAY(DATE('0000-01-00')) 0000-01-31
LAST_DAY(DATE'0000-01-00') NULL
LAST_DAY(STR_TO_DATE('000001','%Y%m')) 0000-01-31
WEEK('0000-01-00') NULL
WEEK(DATE('0000-01-00')) 52
WEEK(DATE'0000-01-00') NULL
WEEK(STR_TO_DATE('000001','%Y%m')) NULL
WEEKOFYEAR('0000-01-00') NULL
WEEKOFYEAR(DATE('0000-01-00')) 52
WEEKOFYEAR(DATE'0000-01-00') NULL
WEEKOFYEAR(STR_TO_DATE('000001','%Y%m')) NULL
DAYOFYEAR('0000-01-00') NULL
DAYOFYEAR(DATE('0000-01-00')) 0
DAYOFYEAR(DATE'0000-01-00') NULL
DAYOFYEAR(STR_TO_DATE('000001','%Y%m')) NULL
WEEKDAY('0000-01-00') NULL
WEEKDAY(DATE('0000-01-00')) 5
WEEKDAY(DATE'0000-01-00') NULL
WEEKDAY(STR_TO_DATE('000001','%Y%m')) NULL
TO_DAYs('0000-01-00') NULL
TO_DAYs(DATE('0000-01-00')) 0
TO_DAYs(DATE'0000-01-00') NULL
TO_DAYs(STR_TO_DATE('000001','%Y%m')) NULL
Warnings:
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1411
Message Incorrect datetime value: '000001' for function str_to_date
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1411
Message Incorrect datetime value: '000001' for function str_to_date
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1411
Message Incorrect datetime value: '000001' for function str_to_date
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1411
Message Incorrect datetime value: '000001' for function str_to_date
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1292
Message Incorrect datetime value: '0000-01-00'
Level Warning
Code 1411
Message Incorrect datetime value: '000001' for function str_to_date
End of 5.1 tests End of 5.1 tests
# #
# Bug#57039: constant subtime expression returns incorrect result. # Bug#57039: constant subtime expression returns incorrect result.

View File

@ -23,12 +23,24 @@ wacky libdaemon_example.so
wicky libdaemon_example.so wicky libdaemon_example.so
wonky libdaemon_example.so wonky libdaemon_example.so
# #
# Ensure the plugin is loaded.
#
SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
name dl
daemon_example libdaemon_example.so
#
# Ensure the plugin is replaced.
#
SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
name dl
daemon_example liblibdaemon_example.so
#
# Disable the plugin... # Disable the plugin...
# #
# #
# Ensure the plugin isn't loaded. # Ensure the plugin isn't loaded.
# #
SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name; SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
name dl name dl
# #
# Attempt to load non-existant plugin # Attempt to load non-existant plugin

View File

@ -671,6 +671,9 @@ The following options may be given as the first argument:
replication. replication.
--sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual
for the complete list of valid sql modes for the complete list of valid sql modes
--stored-program-cache=#
The soft upper limit for number of cached stored routines
for one connection.
-s, --symbolic-links -s, --symbolic-links
Enable symbolic link support. Enable symbolic link support.
--sync-binlog=# Synchronously flush binary log to disk after every #th --sync-binlog=# Synchronously flush binary log to disk after every #th
@ -935,6 +938,7 @@ slow-query-log FALSE
sort-buffer-size 2097152 sort-buffer-size 2097152
sporadic-binlog-dump-fail FALSE sporadic-binlog-dump-fail FALSE
sql-mode sql-mode
stored-program-cache 256
symbolic-links FALSE symbolic-links FALSE
sync-binlog 0 sync-binlog 0
sync-frm TRUE sync-frm TRUE

View File

@ -679,6 +679,9 @@ The following options may be given as the first argument:
--sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual
for the complete list of valid sql modes for the complete list of valid sql modes
--standalone Dummy option to start as a standalone program (NT). --standalone Dummy option to start as a standalone program (NT).
--stored-program-cache=#
The soft upper limit for number of cached stored routines
for one connection.
-s, --symbolic-links -s, --symbolic-links
Enable symbolic link support. Enable symbolic link support.
--sync-binlog=# Synchronously flush binary log to disk after every #th --sync-binlog=# Synchronously flush binary log to disk after every #th
@ -946,6 +949,7 @@ slow-start-timeout 15000
sort-buffer-size 2097152 sort-buffer-size 2097152
sporadic-binlog-dump-fail FALSE sporadic-binlog-dump-fail FALSE
sql-mode sql-mode
stored-program-cache 256
symbolic-links FALSE symbolic-links FALSE
sync-binlog 0 sync-binlog 0
sync-frm TRUE sync-frm TRUE

View File

@ -8,6 +8,6 @@ name TINYBLOB NOT NULL,
modified TIMESTAMP DEFAULT '0000-00-00 00:00:00', modified TIMESTAMP DEFAULT '0000-00-00 00:00:00',
INDEX namelocs (name(255))) ENGINE = MyISAM INDEX namelocs (name(255))) ENGINE = MyISAM
PARTITION BY HASH(id) PARTITIONS 2; PARTITION BY HASH(id) PARTITIONS 2;
LOAD DATA LOCAL INFILE 'init_file.txt' LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/init_file.txt'
INTO TABLE t1 (name); INTO TABLE t1 (name);
DROP TABLE t1; DROP TABLE t1;

View File

@ -1767,4 +1767,121 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk; SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
pk i4 pk i4 pk i4 pk i4
DROP TABLE t1; DROP TABLE t1;
#
# BUG#13519696 - 62940: SELECT RESULTS VARY WITH VERSION AND
# WITH/WITHOUT INDEX RANGE SCAN
#
create table t1 (id int unsigned not null auto_increment primary key);
insert into t1 values (null);
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
create table t2 (
id int unsigned not null auto_increment,
val decimal(5,3) not null,
primary key (id,val),
unique key (val,id),
unique key (id));
insert into t2 select null,id*0.0009 from t1;
select count(val) from t2 ignore index (val) where val > 0.1155;
count(val)
128
select count(val) from t2 force index (val) where val > 0.1155;
count(val)
128
drop table t2, t1;
#
# BUG#13453382 - REGRESSION SINCE 5.1.39, RANGE OPTIMIZER WRONG
# RESULTS WITH DECIMAL CONVERSION
#
create table t1 (a int,b int,c int,primary key (a,c));
insert into t1 values (1,1,2),(1,1,3),(1,1,4);
select convert(3, signed integer) > 2.9;
convert(3, signed integer) > 2.9
1
select * from t1 force index (primary) where a=1 and c>= 2.9;
a b c
1 1 3
1 1 4
select * from t1 ignore index (primary) where a=1 and c>= 2.9;
a b c
1 1 3
1 1 4
select * from t1 force index (primary) where a=1 and c> 2.9;
a b c
1 1 3
1 1 4
select * from t1 ignore index (primary) where a=1 and c> 2.9;
a b c
1 1 3
1 1 4
drop table t1;
#
# BUG#13463488 - 63437: CHAR & BETWEEN WITH INDEX RETURNS WRONG
# RESULT AFTER MYSQL 5.1.
#
CREATE TABLE t1(
F1 CHAR(5) NOT NULL,
F2 CHAR(5) NOT NULL,
F3 CHAR(5) NOT NULL,
PRIMARY KEY(F1),
INDEX IDX_F2(F2)
);
INSERT INTO t1 VALUES
('A','A','A'),('AA','AA','AA'),('AAA','AAA','AAA'),
('AAAA','AAAA','AAAA'),('AAAAA','AAAAA','AAAAA');
SELECT * FROM t1 WHERE F1 = 'A ';
F1 F2 F3
A A A
SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 = 'A ';
F1 F2 F3
A A A
SELECT * FROM t1 WHERE F1 >= 'A ';
F1 F2 F3
A A A
AA AA AA
AAA AAA AAA
AAAA AAAA AAAA
AAAAA AAAAA AAAAA
SELECT * FROM t1 WHERE F1 > 'A ';
F1 F2 F3
AA AA AA
AAA AAA AAA
AAAA AAAA AAAA
AAAAA AAAAA AAAAA
SELECT * FROM t1 WHERE F1 BETWEEN 'A ' AND 'AAAAA';
F1 F2 F3
A A A
AA AA AA
AAA AAA AAA
AAAA AAAA AAAA
AAAAA AAAAA AAAAA
SELECT * FROM t1 WHERE F2 BETWEEN 'A ' AND 'AAAAA';
F1 F2 F3
A A A
AA AA AA
AAA AAA AAA
AAAA AAAA AAAA
AAAAA AAAAA AAAAA
SELECT * FROM t1 WHERE F3 BETWEEN 'A ' AND 'AAAAA';
F1 F2 F3
A A A
AA AA AA
AAA AAA AAA
AAAA AAAA AAAA
AAAAA AAAAA AAAAA
SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 BETWEEN 'A ' AND
'AAAAA';
F1 F2 F3
A A A
AA AA AA
AAA AAA AAA
AAAA AAAA AAAA
AAAAA AAAAA AAAAA
DROP TABLE t1;
End of 5.1 tests End of 5.1 tests

View File

@ -206,8 +206,8 @@ DROP TABLE t1;
# FAILED # FAILED
# #
DROP TABLE IF EXISTS t1, t2; DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a INT); CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT); CREATE TABLE t2 (a INT) ENGINE=InnoDB;
START TRANSACTION; START TRANSACTION;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
# Connection con2 # Connection con2
@ -217,12 +217,14 @@ INSERT INTO t2 SELECT a FROM t1;
# Connection default # Connection default
# Waiting until INSERT ... is blocked # Waiting until INSERT ... is blocked
DELETE FROM t1; DELETE FROM t1;
COMMIT;
# Connection con2 # Connection con2
# Reaping: INSERT INTO t2 SELECT a FROM t1 # Reaping: INSERT INTO t2 SELECT a FROM t1
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
XA COMMIT 'xid1'; XA COMMIT 'xid1';
ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
# Connection default
COMMIT;
# Connection con2
XA START 'xid1'; XA START 'xid1';
XA END 'xid1'; XA END 'xid1';
XA PREPARE 'xid1'; XA PREPARE 'xid1';

View File

@ -11,7 +11,7 @@ reset slave;
start slave; start slave;
include/wait_for_slave_param.inc [Last_IO_Errno] include/wait_for_slave_param.inc [Last_IO_Errno]
Last_IO_Errno = '1236' Last_IO_Errno = '1236'
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event '' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event '' at XXX, the last event read from './master-bin.000001' at XXX, the last byte read from './master-bin.000001' at XXX.''
reset master; reset master;
stop slave; stop slave;
reset slave; reset slave;

View File

@ -270,6 +270,7 @@ Heartbeat event received
include/rpl_reset.inc include/rpl_reset.inc
include/stop_slave.inc include/stop_slave.inc
include/rpl_change_topology.inc [new topology=1->2->1] include/rpl_change_topology.inc [new topology=1->2->1]
CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=1;
include/start_slave.inc include/start_slave.inc
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)); CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
INSERT INTO t1 VALUES(1, 'on master'); INSERT INTO t1 VALUES(1, 'on master');

View File

@ -9,7 +9,7 @@ change master to master_log_pos=MASTER_LOG_POS;
Read_Master_Log_Pos = '75' Read_Master_Log_Pos = '75'
start slave; start slave;
include/wait_for_slave_io_error.inc [errno=1236] include/wait_for_slave_io_error.inc [errno=1236]
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event 'master-bin.000001' at XXX, the last event read from './master-bin.000001' at XXX, the last byte read from './master-bin.000001' at XXX.''
include/stop_slave_sql.inc include/stop_slave_sql.inc
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB

View File

@ -5,7 +5,7 @@ CREATE TABLE t1(c1 INT);
FLUSH LOGS; FLUSH LOGS;
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log');
include/wait_for_slave_io_error.inc [errno=1236] include/wait_for_slave_io_error.inc [errno=1236]
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000002' at XXX, the last byte read from 'master-bin.000002' at XXX.'' Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the first event 'master-bin.000001' at XXX, the last event read from './master-bin.000002' at XXX, the last byte read from './master-bin.000002' at XXX.''
CREATE TABLE t2(c1 INT); CREATE TABLE t2(c1 INT);
FLUSH LOGS; FLUSH LOGS;
CREATE TABLE t3(c1 INT); CREATE TABLE t3(c1 INT);

View File

@ -37,7 +37,7 @@ DROP TABLE t1;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
include/wait_for_slave_io_error.inc [errno=1236] include/wait_for_slave_io_error.inc [errno=1236]
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event '' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event '' at XXX, the last event read from './master-bin.000001' at XXX, the last byte read from './master-bin.000001' at XXX.''
STOP SLAVE; STOP SLAVE;
RESET SLAVE; RESET SLAVE;
RESET MASTER; RESET MASTER;

View File

@ -0,0 +1,10 @@
include/master-slave.inc
[connection master]
set @time_before_kill := (select CURRENT_TIMESTAMP);
[Time before the query]
[Connection ID of the slave I/O thread found]
kill <connection_id>;
set @time_after_kill := (select CURRENT_TIMESTAMP);
[Time after the query]
[Killing of the slave IO thread was successful]
include/rpl_end.inc

View File

@ -75,7 +75,7 @@ CHANGE MASTER TO master_log_pos=MASTER_POS;
START SLAVE; START SLAVE;
include/wait_for_slave_param.inc [Last_IO_Errno] include/wait_for_slave_param.inc [Last_IO_Errno]
Last_IO_Errno = '1236' Last_IO_Errno = '1236'
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'master-bin.000001' at XXX, the last event read from './master-bin.000001' at XXX, the last byte read from './master-bin.000001' at XXX.''
include/stop_slave.inc include/stop_slave.inc
RESET SLAVE; RESET SLAVE;
RESET MASTER; RESET MASTER;

View File

@ -14,11 +14,6 @@
--source include/master-slave.inc --source include/master-slave.inc
--source include/have_binlog_format_mixed.inc --source include/have_binlog_format_mixed.inc
#
# Bug#13050593 swallows `\' from Last_IO_Error
# todo: uncomment the filter once the bug is fixed.
#
--source include/not_windows.inc
call mtr.add_suppression("Error in Log_event::read_log_event()"); call mtr.add_suppression("Error in Log_event::read_log_event()");
@ -51,7 +46,7 @@ start slave;
--let $slave_param_value=1236 --let $slave_param_value=1236
--source include/wait_for_slave_param.inc --source include/wait_for_slave_param.inc
--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ --let $slave_field_result_replace= / at [0-9]*/ at XXX/
--let $status_items= Last_IO_Errno, Last_IO_Error --let $status_items= Last_IO_Errno, Last_IO_Error
--source include/show_slave_status.inc --source include/show_slave_status.inc

View File

@ -480,6 +480,12 @@ let $status_var_comparsion= >;
--connection master --connection master
#--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG #--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG
#eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog'; #eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog';
# BUG#12403008 RPL_HEARTBEAT_BASIC FAILS SPORADICALLY ON PUSHBUILD
# MASTER_HEARTBEAT_PERIOD had the default value (slave_net_timeout/2)
# so wait on "Heartbeat event received on master", that only waits for
# 1 minute, sometimes timeout before heartbeat arrives.
CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=1;
--source include/start_slave.inc --source include/start_slave.inc
# Insert data on master and on slave and make sure that it replicated for both directions # Insert data on master and on slave and make sure that it replicated for both directions

View File

@ -23,8 +23,8 @@ source include/show_slave_status.inc;
start slave; start slave;
let $slave_io_errno= 1236; let $slave_io_errno= 1236;
--let $show_slave_io_error= 1 --let $show_slave_io_error= 1
# Mask line numbers, and whether master-bin is preceded by "./" or "." # Mask line numbers
--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ --let $slave_io_error_replace= / at [0-9]*/ at XXX/
source include/wait_for_slave_io_error.inc; source include/wait_for_slave_io_error.inc;
source include/stop_slave_sql.inc; source include/stop_slave_sql.inc;

View File

@ -61,8 +61,8 @@ connection slave;
# 1236 = ER_MASTER_FATAL_ERROR_READING_BINLOG # 1236 = ER_MASTER_FATAL_ERROR_READING_BINLOG
--let $slave_io_errno= 1236 --let $slave_io_errno= 1236
--let $show_slave_io_error= 1 --let $show_slave_io_error= 1
# Mask line numbers, and whether master-bin is preceded by "./" or "." # Mask line numbers
--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ --let $slave_io_error_replace= / at [0-9]*/ at XXX/
--source include/wait_for_slave_io_error.inc --source include/wait_for_slave_io_error.inc
connection master; connection master;

View File

@ -126,8 +126,8 @@ connection slave;
# 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master. # 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master.
--let $slave_io_errno= 1236 --let $slave_io_errno= 1236
# Mask line numbers, and whether master-bin is preceded by "./" or "." # Mask line numbers
--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ --let $slave_io_error_replace= / at [0-9]*/ at XXX/
--source include/wait_for_slave_io_error.inc --source include/wait_for_slave_io_error.inc
# Remove the bad binlog and clear error status on slave. # Remove the bad binlog and clear error status on slave.

View File

@ -0,0 +1,44 @@
#
#BUG#11752315 : STOP SLAVE UNABLE TO COMPLETE WHEN SLAVE THREAD IS TRYING
# TO RECONNECT TO
#
# ==== Purpose ====
#
#Tests that the slave does not go to a sleep for a long duration after the
#master is killed and we do a START_SLAVE and STOP_SLAVE.
#
# ==== Method ====
#
#This is a new functionality of having an interruptable sleep of the slave.
#We find the thread id for the slave thread. On finding the thread ID of the
#slave thread we kill the slave thread. A successful kill in less than 60 sec
#should serve the purpose of checking the functionality.
#
--source include/have_log_bin.inc
--source include/master-slave.inc
connection slave;
--let $connection_id=`SELECT id FROM information_schema.processlist where state LIKE 'Waiting for master to send event'`
set @time_before_kill := (select CURRENT_TIMESTAMP);
--echo [Time before the query]
--echo [Connection ID of the slave I/O thread found]
--replace_regex /kill [0-9]*/kill <connection_id>/
--eval kill $connection_id
set @time_after_kill := (select CURRENT_TIMESTAMP);
--echo [Time after the query]
if(`select TIMESTAMPDIFF(SECOND,@time_after_kill, @time_before_kill) > 60`)
{
--echo # assert : The difference between the timestamps 'time_after_kill' and 'time_before_kill' should be less than 60sec.
--die
}
--echo [Killing of the slave IO thread was successful]
# End of test
--source include/rpl_end.inc

View File

@ -0,0 +1,59 @@
# Saving initial value of stored_program_cache in a temporary variable
SET @start_value = @@global.stored_program_cache;
SELECT @start_value;
@start_value
256
# Display the DEFAULT value of stored_program_cache
SET @@global.stored_program_cache = DEFAULT;
SELECT @@global.stored_program_cache;
@@global.stored_program_cache
256
# Verify default value of variable
SELECT @@global.stored_program_cache = 256;
@@global.stored_program_cache = 256
1
# Change the value of stored_program_cache to a valid value
SET @@global.stored_program_cache = 512;
SELECT @@global.stored_program_cache;
@@global.stored_program_cache
512
# Change the value of stored_program_cache to invalid value
SET @@global.stored_program_cache = -1;
Warnings:
Warning 1292 Truncated incorrect stored_program_cache value: '-1'
SELECT @@global.stored_program_cache;
@@global.stored_program_cache
256
SET @@global.stored_program_cache =100000000000;
Warnings:
Warning 1292 Truncated incorrect stored_program_cache value: '100000000000'
SELECT @@global.stored_program_cache;
@@global.stored_program_cache
524288
SET @@global.stored_program_cache = 0;
Warnings:
Warning 1292 Truncated incorrect stored_program_cache value: '0'
SELECT @@global.stored_program_cache;
@@global.stored_program_cache
256
SET @@global.stored_program_cache = 10000.01;
ERROR 42000: Incorrect argument type to variable 'stored_program_cache'
SET @@global.stored_program_cache = ON;
ERROR 42000: Incorrect argument type to variable 'stored_program_cache'
SET @@global.stored_program_cache= 'test';
ERROR 42000: Incorrect argument type to variable 'stored_program_cache'
SET @@global.stored_program_cache = '';
ERROR 42000: Incorrect argument type to variable 'stored_program_cache'
# Test if accessing session stored_program_cache gives error
SET @@session.stored_program_cache = 0;
ERROR HY000: Variable 'stored_program_cache' is a GLOBAL variable and should be set with SET GLOBAL
# Check if accessing variable without SCOPE points to same global variable
SET @@global.stored_program_cache = 512;
SELECT @@stored_program_cache = @@global.stored_program_cache;
@@stored_program_cache = @@global.stored_program_cache
1
# Restore initial value
SET @@global.stored_program_cache = @start_value;
SELECT @@global.stored_program_cache;
@@global.stored_program_cache
256

View File

@ -0,0 +1,59 @@
# Variable Name: stored_program_cache
# Scope: GLOBAL
# Access Type: Dynamic
# Data Type: numeric
# Default Value: 256
# Range: 256-524288
--source include/load_sysvars.inc
--echo # Saving initial value of stored_program_cache in a temporary variable
SET @start_value = @@global.stored_program_cache;
SELECT @start_value;
--echo # Display the DEFAULT value of stored_program_cache
SET @@global.stored_program_cache = DEFAULT;
SELECT @@global.stored_program_cache;
--echo # Verify default value of variable
SELECT @@global.stored_program_cache = 256;
--echo # Change the value of stored_program_cache to a valid value
SET @@global.stored_program_cache = 512;
SELECT @@global.stored_program_cache;
--echo # Change the value of stored_program_cache to invalid value
SET @@global.stored_program_cache = -1;
SELECT @@global.stored_program_cache;
SET @@global.stored_program_cache =100000000000;
SELECT @@global.stored_program_cache;
SET @@global.stored_program_cache = 0;
SELECT @@global.stored_program_cache;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.stored_program_cache = 10000.01;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.stored_program_cache = ON;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.stored_program_cache= 'test';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.stored_program_cache = '';
--echo # Test if accessing session stored_program_cache gives error
--Error ER_GLOBAL_VARIABLE
SET @@session.stored_program_cache = 0;
--echo # Check if accessing variable without SCOPE points to same global variable
SET @@global.stored_program_cache = 512;
SELECT @@stored_program_cache = @@global.stored_program_cache;
--echo # Restore initial value
SET @@global.stored_program_cache = @start_value;
SELECT @@global.stored_program_cache;

View File

@ -361,4 +361,51 @@ DROP TABLE t1;
--echo # End of 5.1 tests --echo # End of 5.1 tests
--echo #
--echo # Bug#13463415 63502: INCORRECT RESULTS OF BIGINT AND DECIMAL COMPARISON
--echo #
CREATE TABLE t_bigint(id BIGINT);
INSERT INTO t_bigint VALUES (1), (2);
SELECT id, id >= 1.1 FROM t_bigint;
SELECT id, 1.1 <= id FROM t_bigint;
SELECT id, id = 1.1 FROM t_bigint;
SELECT id, 1.1 = id FROM t_bigint;
SELECT * from t_bigint WHERE id = 1.1;
SELECT * from t_bigint WHERE id = 1.1e0;
SELECT * from t_bigint WHERE id = '1.1';
SELECT * from t_bigint WHERE id = '1.1e0';
SELECT * from t_bigint WHERE id IN (1.1, 2.2);
SELECT * from t_bigint WHERE id IN (1.1e0, 2.2e0);
SELECT * from t_bigint WHERE id IN ('1.1', '2.2');
SELECT * from t_bigint WHERE id IN ('1.1e0', '2.2e0');
SELECT * from t_bigint WHERE id BETWEEN 1.1 AND 1.9;
SELECT * from t_bigint WHERE id BETWEEN 1.1e0 AND 1.9e0;
SELECT * from t_bigint WHERE id BETWEEN '1.1' AND '1.9';
SELECT * from t_bigint WHERE id BETWEEN '1.1e0' AND '1.9e0';
DROP TABLE t_bigint;
--echo #
--echo # Bug#11758543 50756: BIGINT '100' MATCHES 1.001E2
--echo #
CREATE TABLE t1 (a BIGINT);
INSERT INTO t1 VALUES (1);
# a. These queries correctly return 0 rows:
SELECT * FROM t1 WHERE coalesce(a) BETWEEN 0 and 0.9;
SELECT * FROM t1 WHERE coalesce(a)=0.9;
SELECT * FROM t1 WHERE coalesce(a) in (0.8,0.9);
# b. These queries mistakenely returned 1 row:
SELECT * FROM t1 WHERE a BETWEEN 0 AND 0.9;
SELECT * FROM t1 WHERE a=0.9;
SELECT * FROM t1 WHERE a IN (0.8,0.9);
DROP TABLE t1;

View File

@ -1455,6 +1455,14 @@ SELECT HEX(LPAD(_utf8 0xD18F, 3, 0x20));
SELECT HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20)); SELECT HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20));
SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)); SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20));
--echo #
--echo # Bug#11752408 - 43593: DUMP/BACKUP/RESTORE/UPGRADE TOOLS FAILS BECAUSE OF UTF8_GENERAL_CI
--echo #
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci);
INSERT INTO t1 VALUES ('a'),('r'),('s'),(_latin1 0xDF),(_latin1 0xF7),('t'),('z');
SELECT * FROM t1 ORDER BY a;
SELECT a, COUNT(*) FROM t1 GROUP BY a;
DROP TABLE t1;
--echo End of 5.1 tests --echo End of 5.1 tests

View File

@ -1459,6 +1459,45 @@ SELECT stddev_samp(rpad(1.0,2048,1));
SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1))); SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)));
SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc)); SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc));
--echo #
--echo # Bug#13359121 LARGE NUMBERS, /STRINGS/DTOA.C:662:
--echo # BALLOC: ASSERTION `K <= 15' FAILED.
--echo # Bug#12985021 SIMPLE QUERY WITH DECIMAL NUMBERS TAKE AN
--echo # EXTRAORDINARY LONG TIME TO EXECUTE
SELECT @tmp_max:= @@global.max_allowed_packet;
SET @@global.max_allowed_packet=1024*1024*1024;
# switching connection to allow the new max_allowed_packet take effect
--connect (newconn, localhost, root,,)
SELECT @@global.max_allowed_packet;
do
format(rpad('111111111.1',
1111111,
'999999999999999999999999999999999999999999'),0,'be_BY')
;
DO
round(
concat( (
coalesce( (
linefromwkb('2147483648',
-b'1111111111111111111111111111111111111111111')),
( convert('[.DC2.]',decimal(30,30)) ),
bit_count('')
) ),
( lpad( ( elt('01','}:K5')),
sha1('P'),
( ( select '-9223372036854775808.1' > all (select '')))
)
)
)
);
--connection default
SET @@global.max_allowed_packet:= @tmp_max;
--disconnect newconn
--echo # --echo #
--echo # End of 5.5 tests --echo # End of 5.5 tests

View File

@ -915,6 +915,67 @@ SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5); DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5);
--echo #
--echo # BUG#13458237 INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY
--echo # SIMILAR TO '2009-10-00'
--echo #
query_vertical SELECT
DATE('20091000'),
STR_TO_DATE('200910','%Y%m'),
LAST_DAY('2009-10-00'),
LAST_DAY(DATE('2009-10-00')),
LAST_DAY(DATE'2009-10-00'),
LAST_DAY(STR_TO_DATE('200910','%Y%m')),
WEEK('2009-10-00'),
WEEK(DATE('2009-10-00')),
WEEK(DATE'2009-10-00'),
WEEK(STR_TO_DATE('200910','%Y%m')),
WEEKOFYEAR('2009-10-00'),
WEEKOFYEAR(DATE('2009-10-00')),
WEEKOFYEAR(DATE'2009-10-00'),
WEEKOFYEAR(STR_TO_DATE('200910','%Y%m')),
DAYOFYEAR('2009-10-00'),
DAYOFYEAR(DATE('2009-10-00')),
DAYOFYEAR(DATE'2009-10-00'),
DAYOFYEAR(STR_TO_DATE('200910','%Y%m')),
WEEKDAY('2009-10-00'),
WEEKDAY(DATE('2009-10-00')),
WEEKDAY(DATE'2009-10-00'),
WEEKDAY(STR_TO_DATE('200910','%Y%m')),
TO_DAYs('2009-10-00'),
TO_DAYs(DATE('2009-10-00')),
TO_DAYs(DATE'2009-10-00'),
TO_DAYs(STR_TO_DATE('200910','%Y%m'));
query_vertical SELECT
DATE('00000100'),
STR_TO_DATE('000001','%Y%m'),
LAST_DAY('0000-01-00'),
LAST_DAY(DATE('0000-01-00')),
LAST_DAY(DATE'0000-01-00'),
LAST_DAY(STR_TO_DATE('000001','%Y%m')),
WEEK('0000-01-00'),
WEEK(DATE('0000-01-00')),
WEEK(DATE'0000-01-00'),
WEEK(STR_TO_DATE('000001','%Y%m')),
WEEKOFYEAR('0000-01-00'),
WEEKOFYEAR(DATE('0000-01-00')),
WEEKOFYEAR(DATE'0000-01-00'),
WEEKOFYEAR(STR_TO_DATE('000001','%Y%m')),
DAYOFYEAR('0000-01-00'),
DAYOFYEAR(DATE('0000-01-00')),
DAYOFYEAR(DATE'0000-01-00'),
DAYOFYEAR(STR_TO_DATE('000001','%Y%m')),
WEEKDAY('0000-01-00'),
WEEKDAY(DATE('0000-01-00')),
WEEKDAY(DATE'0000-01-00'),
WEEKDAY(STR_TO_DATE('000001','%Y%m')),
TO_DAYs('0000-01-00'),
TO_DAYs(DATE('0000-01-00')),
TO_DAYs(DATE'0000-01-00'),
TO_DAYs(STR_TO_DATE('000001','%Y%m'));
--echo End of 5.1 tests --echo End of 5.1 tests
--echo # --echo #

View File

@ -155,6 +155,74 @@ eval INSERT INTO mysql.plugin VALUES ('wonky', '$DAEMONEXAMPLE');
--replace_regex /\.dll/.so/ --replace_regex /\.dll/.so/
SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name; SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
# MTR will remove this file later, but this might be too late.
--error 0,1
--remove_file $expect_file
--write_file $expect_file
wait
EOF
--shutdown_server 10
--source include/wait_until_disconnected.inc
#
# Disable the plugin - to remove winky, wonky entries
#
--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example
#
# Enable the plugin again
#
--exec $MYSQL_PLUGIN_CMD ENABLE daemon_example
#
# Restart the server
#
--append_file $expect_file
restart
EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
--echo #
--echo # Ensure the plugin is loaded.
--echo #
--replace_regex /\.dll/.so/
SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
# MTR will remove this file later, but this might be too late.
--error 0,1
--remove_file $expect_file
--write_file $expect_file
wait
EOF
--shutdown_server 10
--source include/wait_until_disconnected.inc
# To test the case where the same plugin is reloaded with a different soname,
# we must copy the example daemon to a new location renaming it.
let $DAEMON_RELOAD = lib$DAEMONEXAMPLE;
--copy_file $PLUGIN_DIR/$DAEMONEXAMPLE $PLUGIN_DIR/$DAEMON_RELOAD
--copy_file include/libdaemon_example.ini $PLUGIN_DIR/libdaemon_example.ini
# Now reload it and see that it is a different name.
--exec $MYSQL_PLUGIN_CMD ENABLE libdaemon_example
#
# Restart the server
#
--append_file $expect_file
restart
EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
--echo #
--echo # Ensure the plugin is replaced.
--echo #
--replace_regex /\.dll/.so/
SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
--echo # --echo #
--echo # Disable the plugin... --echo # Disable the plugin...
--echo # --echo #
@ -170,7 +238,12 @@ EOF
# #
# Disable the plugin # Disable the plugin
# #
--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example --exec $MYSQL_PLUGIN_CMD DISABLE libdaemon_example
# Remove files for last test case.
--remove_file $PLUGIN_DIR/$DAEMON_RELOAD
--remove_file $DAEMONEXAMPLE_DIR/libdaemon_example.ini
# #
# Restart the server # Restart the server
@ -184,7 +257,7 @@ EOF
--echo # --echo #
--echo # Ensure the plugin isn't loaded. --echo # Ensure the plugin isn't loaded.
--echo # --echo #
SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name; SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
# #
# Stop the server for error conditions # Stop the server for error conditions

View File

@ -8,7 +8,7 @@ DROP TABLE IF EXISTS t1;
--echo # --echo #
--echo # Bug#51851: Server with SBR locks mutex twice on LOAD DATA into --echo # Bug#51851: Server with SBR locks mutex twice on LOAD DATA into
--echo # partitioned MyISAM table --echo # partitioned MyISAM table
--write_file init_file.txt --write_file $MYSQLTEST_VARDIR/tmp/init_file.txt
abcd abcd
EOF EOF
@ -19,8 +19,9 @@ CREATE TABLE t1
INDEX namelocs (name(255))) ENGINE = MyISAM INDEX namelocs (name(255))) ENGINE = MyISAM
PARTITION BY HASH(id) PARTITIONS 2; PARTITION BY HASH(id) PARTITIONS 2;
LOAD DATA LOCAL INFILE 'init_file.txt' --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/init_file.txt'
INTO TABLE t1 (name); INTO TABLE t1 (name);
--remove_file init_file.txt --remove_file $MYSQLTEST_VARDIR/tmp/init_file.txt
DROP TABLE t1; DROP TABLE t1;

View File

@ -1392,4 +1392,80 @@ SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # BUG#13519696 - 62940: SELECT RESULTS VARY WITH VERSION AND
--echo # WITH/WITHOUT INDEX RANGE SCAN
--echo #
create table t1 (id int unsigned not null auto_increment primary key);
insert into t1 values (null);
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
insert into t1 select null from t1;
create table t2 (
id int unsigned not null auto_increment,
val decimal(5,3) not null,
primary key (id,val),
unique key (val,id),
unique key (id));
--disable_warnings
insert into t2 select null,id*0.0009 from t1;
--enable_warnings
select count(val) from t2 ignore index (val) where val > 0.1155;
select count(val) from t2 force index (val) where val > 0.1155;
drop table t2, t1;
--echo #
--echo # BUG#13453382 - REGRESSION SINCE 5.1.39, RANGE OPTIMIZER WRONG
--echo # RESULTS WITH DECIMAL CONVERSION
--echo #
create table t1 (a int,b int,c int,primary key (a,c));
insert into t1 values (1,1,2),(1,1,3),(1,1,4);
# show that the integer 3 is bigger than the decimal 2.9,
# which should also apply to comparing "c" with 2.9
# when c is 3.
select convert(3, signed integer) > 2.9;
select * from t1 force index (primary) where a=1 and c>= 2.9;
select * from t1 ignore index (primary) where a=1 and c>= 2.9;
select * from t1 force index (primary) where a=1 and c> 2.9;
select * from t1 ignore index (primary) where a=1 and c> 2.9;
drop table t1;
--echo #
--echo # BUG#13463488 - 63437: CHAR & BETWEEN WITH INDEX RETURNS WRONG
--echo # RESULT AFTER MYSQL 5.1.
--echo #
CREATE TABLE t1(
F1 CHAR(5) NOT NULL,
F2 CHAR(5) NOT NULL,
F3 CHAR(5) NOT NULL,
PRIMARY KEY(F1),
INDEX IDX_F2(F2)
);
INSERT INTO t1 VALUES
('A','A','A'),('AA','AA','AA'),('AAA','AAA','AAA'),
('AAAA','AAAA','AAAA'),('AAAAA','AAAAA','AAAAA');
SELECT * FROM t1 WHERE F1 = 'A ';
SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 = 'A ';
SELECT * FROM t1 WHERE F1 >= 'A ';
SELECT * FROM t1 WHERE F1 > 'A ';
SELECT * FROM t1 WHERE F1 BETWEEN 'A ' AND 'AAAAA';
SELECT * FROM t1 WHERE F2 BETWEEN 'A ' AND 'AAAAA';
SELECT * FROM t1 WHERE F3 BETWEEN 'A ' AND 'AAAAA';
SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 BETWEEN 'A ' AND
'AAAAA';
DROP TABLE t1;
--echo End of 5.1 tests --echo End of 5.1 tests

View File

@ -1 +1,2 @@
--skip-grant-tables --skip-grant-tables
$UDF_EXAMPLE_LIB_OPT

View File

@ -338,8 +338,8 @@ DROP TABLE t1;
DROP TABLE IF EXISTS t1, t2; DROP TABLE IF EXISTS t1, t2;
--enable_warnings --enable_warnings
CREATE TABLE t1 (a INT); CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT); CREATE TABLE t2 (a INT) ENGINE=InnoDB;
START TRANSACTION; START TRANSACTION;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
@ -359,7 +359,6 @@ let $wait_condition=
--echo # Waiting until INSERT ... is blocked --echo # Waiting until INSERT ... is blocked
--source include/wait_condition.inc --source include/wait_condition.inc
DELETE FROM t1; DELETE FROM t1;
COMMIT;
--echo # Connection con2 --echo # Connection con2
--connection con2 --connection con2
@ -368,6 +367,14 @@ COMMIT;
--reap --reap
--error ER_XA_RBDEADLOCK --error ER_XA_RBDEADLOCK
XA COMMIT 'xid1'; XA COMMIT 'xid1';
--echo # Connection default
connection default;
COMMIT;
--echo # Connection con2
connection con2;
# This caused the assert to be triggered # This caused the assert to be triggered
XA START 'xid1'; XA START 'xid1';

View File

@ -204,6 +204,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
#ifdef HAVE_CHARSET_ucs2 #ifdef HAVE_CHARSET_ucs2
add_compiled_collation(&my_charset_ucs2_general_ci); add_compiled_collation(&my_charset_ucs2_general_ci);
add_compiled_collation(&my_charset_ucs2_bin); add_compiled_collation(&my_charset_ucs2_bin);
add_compiled_collation(&my_charset_ucs2_general_mysql500_ci);
#ifdef HAVE_UCA_COLLATIONS #ifdef HAVE_UCA_COLLATIONS
add_compiled_collation(&my_charset_ucs2_unicode_ci); add_compiled_collation(&my_charset_ucs2_unicode_ci);
add_compiled_collation(&my_charset_ucs2_icelandic_uca_ci); add_compiled_collation(&my_charset_ucs2_icelandic_uca_ci);
@ -236,6 +237,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
#ifdef HAVE_CHARSET_utf8 #ifdef HAVE_CHARSET_utf8
add_compiled_collation(&my_charset_utf8_general_ci); add_compiled_collation(&my_charset_utf8_general_ci);
add_compiled_collation(&my_charset_utf8_bin); add_compiled_collation(&my_charset_utf8_bin);
add_compiled_collation(&my_charset_utf8_general_mysql500_ci);
#ifdef HAVE_UTF8_GENERAL_CS #ifdef HAVE_UTF8_GENERAL_CS
add_compiled_collation(&my_charset_utf8_general_cs); add_compiled_collation(&my_charset_utf8_general_cs);
#endif #endif

View File

@ -783,7 +783,7 @@ long calc_daynr(uint year,uint month,uint day)
temp=(int) ((y/100+1)*3)/4; temp=(int) ((y/100+1)*3)/4;
DBUG_PRINT("exit",("year: %d month: %d day: %d -> daynr: %ld", DBUG_PRINT("exit",("year: %d month: %d day: %d -> daynr: %ld",
y+(month <= 2),month,day,delsum+y/4-temp)); y+(month <= 2),month,day,delsum+y/4-temp));
DBUG_ASSERT(delsum+(int) y/4-temp > 0); DBUG_ASSERT(delsum+(int) y/4-temp >= 0);
DBUG_RETURN(delsum+(int) y/4-temp); DBUG_RETURN(delsum+(int) y/4-temp);
} /* calc_daynr */ } /* calc_daynr */

View File

@ -7399,9 +7399,13 @@ void resolve_const_item(THD *thd, Item **ref, Item *comp_item)
or less than the original Item. A 0 may also be returned if or less than the original Item. A 0 may also be returned if
out of memory. out of memory.
@note We only use this on the range optimizer/partition pruning, @note We use this in the range optimizer/partition pruning,
because in some cases we can't store the value in the field because in some cases we can't store the value in the field
without some precision/character loss. without some precision/character loss.
We similarly use it to verify that expressions like
BIGINT_FIELD <cmp> <literal value>
is done correctly (as int/decimal/float according to literal type).
*/ */
int stored_field_cmp_to_item(THD *thd, Field *field, Item *item) int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
@ -7445,7 +7449,7 @@ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
return my_time_compare(&field_time, &item_time); return my_time_compare(&field_time, &item_time);
} }
return stringcmp(field_result, item_result); return sortcmp(field_result, item_result, field->charset());
} }
if (res_type == INT_RESULT) if (res_type == INT_RESULT)
return 0; // Both are of type int return 0; // Both are of type int
@ -7457,12 +7461,17 @@ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
if (item->null_value) if (item->null_value)
return 0; return 0;
field_val= field->val_decimal(&field_buf); field_val= field->val_decimal(&field_buf);
return my_decimal_cmp(item_val, field_val); return my_decimal_cmp(field_val, item_val);
} }
double result= item->val_real(); /*
The patch for Bug#13463415 started using this function for comparing
BIGINTs. That uncovered a bug in Visual Studio 32bit optimized mode.
Prefixing the auto variables with volatile fixes the problem....
*/
volatile double result= item->val_real();
if (item->null_value) if (item->null_value)
return 0; return 0;
double field_result= field->val_real(); volatile double field_result= field->val_real();
if (field_result < result) if (field_result < result)
return -1; return -1;
else if (field_result > result) else if (field_result > result)

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. /* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -435,11 +435,22 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
orig_field_val= field->val_int(); orig_field_val= field->val_int();
if (!(*item)->is_null() && !(*item)->save_in_field(field, 1)) if (!(*item)->is_null() && !(*item)->save_in_field(field, 1))
{ {
Item *tmp= new Item_int_with_ref(field->val_int(), *item, int field_cmp= 0;
test(field->flags & UNSIGNED_FLAG)); // If item is a decimal value, we must reject it if it was truncated.
if (tmp) if (field->type() == MYSQL_TYPE_LONGLONG)
thd->change_item_tree(item, tmp); {
result= 1; // Item was replaced field_cmp= stored_field_cmp_to_item(thd, field, *item);
DBUG_PRINT("info", ("convert_constant_item %d", field_cmp));
}
if (0 == field_cmp)
{
Item *tmp= new Item_int_with_ref(field->val_int(), *item,
test(field->flags & UNSIGNED_FLAG));
if (tmp)
thd->change_item_tree(item, tmp);
result= 1; // Item was replaced
}
} }
/* Restore the original field value. */ /* Restore the original field value. */
if (save_field_value) if (save_field_value)
@ -2321,10 +2332,10 @@ void Item_func_between::fix_length_and_dec()
The following can't be recoded with || as convert_constant_item The following can't be recoded with || as convert_constant_item
changes the argument changes the argument
*/ */
if (convert_constant_item(thd, field_item, &args[1])) const bool cvt_arg1= convert_constant_item(thd, field_item, &args[1]);
cmp_type=INT_RESULT; // Works for all types. const bool cvt_arg2= convert_constant_item(thd, field_item, &args[2]);
if (convert_constant_item(thd, field_item, &args[2])) if (cvt_arg1 && cvt_arg2)
cmp_type=INT_RESULT; // Works for all types. cmp_type=INT_RESULT; // Works for all types.
} }
} }
} }

View File

@ -2747,7 +2747,7 @@ String *Item_time_typecast::val_str(String *str)
bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
{ {
bool res= get_arg0_date(ltime, fuzzy_date); bool res= get_arg0_date(ltime, TIME_FUZZY_DATE);
ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0; ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0;
ltime->time_type= MYSQL_TIMESTAMP_DATE; ltime->time_type= MYSQL_TIMESTAMP_DATE;
return res; return res;

View File

@ -511,6 +511,11 @@ uint sync_binlog_period= 0, sync_relaylog_period= 0,
sync_relayloginfo_period= 0, sync_masterinfo_period= 0; sync_relayloginfo_period= 0, sync_masterinfo_period= 0;
ulong expire_logs_days = 0; ulong expire_logs_days = 0;
ulong rpl_recovery_rank=0; ulong rpl_recovery_rank=0;
/**
Soft upper limit for number of sp_head objects that can be stored
in the sp_cache for one connection.
*/
ulong stored_program_cache_size= 0;
const double log_10[] = { const double log_10[] = {
1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009, 1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009,
@ -7682,8 +7687,10 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_LOCK_system_variables_hash, key_LOCK_table_share, key_LOCK_thd_data, key_LOCK_system_variables_hash, key_LOCK_table_share, key_LOCK_thd_data,
key_LOCK_user_conn, key_LOCK_uuid_generator, key_LOG_LOCK_log, key_LOCK_user_conn, key_LOCK_uuid_generator, key_LOG_LOCK_log,
key_master_info_data_lock, key_master_info_run_lock, key_master_info_data_lock, key_master_info_run_lock,
key_master_info_sleep_lock,
key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock, key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock,
key_relay_log_info_log_space_lock, key_relay_log_info_run_lock, key_relay_log_info_log_space_lock, key_relay_log_info_run_lock,
key_relay_log_info_sleep_lock,
key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data, key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data,
key_LOCK_error_messages, key_LOG_INFO_lock, key_LOCK_thread_count, key_LOCK_error_messages, key_LOG_INFO_lock, key_LOCK_thread_count,
key_PARTITION_LOCK_auto_inc; key_PARTITION_LOCK_auto_inc;
@ -7729,10 +7736,12 @@ static PSI_mutex_info all_server_mutexes[]=
{ &key_LOG_LOCK_log, "LOG::LOCK_log", 0}, { &key_LOG_LOCK_log, "LOG::LOCK_log", 0},
{ &key_master_info_data_lock, "Master_info::data_lock", 0}, { &key_master_info_data_lock, "Master_info::data_lock", 0},
{ &key_master_info_run_lock, "Master_info::run_lock", 0}, { &key_master_info_run_lock, "Master_info::run_lock", 0},
{ &key_master_info_sleep_lock, "Master_info::sleep_lock", 0},
{ &key_mutex_slave_reporting_capability_err_lock, "Slave_reporting_capability::err_lock", 0}, { &key_mutex_slave_reporting_capability_err_lock, "Slave_reporting_capability::err_lock", 0},
{ &key_relay_log_info_data_lock, "Relay_log_info::data_lock", 0}, { &key_relay_log_info_data_lock, "Relay_log_info::data_lock", 0},
{ &key_relay_log_info_log_space_lock, "Relay_log_info::log_space_lock", 0}, { &key_relay_log_info_log_space_lock, "Relay_log_info::log_space_lock", 0},
{ &key_relay_log_info_run_lock, "Relay_log_info::run_lock", 0}, { &key_relay_log_info_run_lock, "Relay_log_info::run_lock", 0},
{ &key_relay_log_info_sleep_lock, "Relay_log_info::sleep_lock", 0},
{ &key_structure_guard_mutex, "Query_cache::structure_guard_mutex", 0}, { &key_structure_guard_mutex, "Query_cache::structure_guard_mutex", 0},
{ &key_TABLE_SHARE_LOCK_ha_data, "TABLE_SHARE::LOCK_ha_data", 0}, { &key_TABLE_SHARE_LOCK_ha_data, "TABLE_SHARE::LOCK_ha_data", 0},
{ &key_LOCK_error_messages, "LOCK_error_messages", PSI_FLAG_GLOBAL}, { &key_LOCK_error_messages, "LOCK_error_messages", PSI_FLAG_GLOBAL},
@ -7768,8 +7777,10 @@ PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
key_delayed_insert_cond, key_delayed_insert_cond_client, key_delayed_insert_cond, key_delayed_insert_cond_client,
key_item_func_sleep_cond, key_master_info_data_cond, key_item_func_sleep_cond, key_master_info_data_cond,
key_master_info_start_cond, key_master_info_stop_cond, key_master_info_start_cond, key_master_info_stop_cond,
key_master_info_sleep_cond,
key_relay_log_info_data_cond, key_relay_log_info_log_space_cond, key_relay_log_info_data_cond, key_relay_log_info_log_space_cond,
key_relay_log_info_start_cond, key_relay_log_info_stop_cond, key_relay_log_info_start_cond, key_relay_log_info_stop_cond,
key_relay_log_info_sleep_cond,
key_TABLE_SHARE_cond, key_user_level_lock_cond, key_TABLE_SHARE_cond, key_user_level_lock_cond,
key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache;
PSI_cond_key key_RELAYLOG_update_cond; PSI_cond_key key_RELAYLOG_update_cond;
@ -7797,10 +7808,12 @@ static PSI_cond_info all_server_conds[]=
{ &key_master_info_data_cond, "Master_info::data_cond", 0}, { &key_master_info_data_cond, "Master_info::data_cond", 0},
{ &key_master_info_start_cond, "Master_info::start_cond", 0}, { &key_master_info_start_cond, "Master_info::start_cond", 0},
{ &key_master_info_stop_cond, "Master_info::stop_cond", 0}, { &key_master_info_stop_cond, "Master_info::stop_cond", 0},
{ &key_master_info_sleep_cond, "Master_info::sleep_cond", 0},
{ &key_relay_log_info_data_cond, "Relay_log_info::data_cond", 0}, { &key_relay_log_info_data_cond, "Relay_log_info::data_cond", 0},
{ &key_relay_log_info_log_space_cond, "Relay_log_info::log_space_cond", 0}, { &key_relay_log_info_log_space_cond, "Relay_log_info::log_space_cond", 0},
{ &key_relay_log_info_start_cond, "Relay_log_info::start_cond", 0}, { &key_relay_log_info_start_cond, "Relay_log_info::start_cond", 0},
{ &key_relay_log_info_stop_cond, "Relay_log_info::stop_cond", 0}, { &key_relay_log_info_stop_cond, "Relay_log_info::stop_cond", 0},
{ &key_relay_log_info_sleep_cond, "Relay_log_info::sleep_cond", 0},
{ &key_TABLE_SHARE_cond, "TABLE_SHARE::cond", 0}, { &key_TABLE_SHARE_cond, "TABLE_SHARE::cond", 0},
{ &key_user_level_lock_cond, "User_level_lock::cond", 0}, { &key_user_level_lock_cond, "User_level_lock::cond", 0},
{ &key_COND_thread_count, "COND_thread_count", PSI_FLAG_GLOBAL}, { &key_COND_thread_count, "COND_thread_count", PSI_FLAG_GLOBAL},

View File

@ -181,6 +181,7 @@ extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size;
extern ulong max_binlog_size, max_relay_log_size; extern ulong max_binlog_size, max_relay_log_size;
extern ulong opt_binlog_rows_event_max_size; extern ulong opt_binlog_rows_event_max_size;
extern ulong rpl_recovery_rank, thread_cache_size; extern ulong rpl_recovery_rank, thread_cache_size;
extern ulong stored_program_cache_size;
extern ulong back_log; extern ulong back_log;
extern char language[FN_REFLEN]; extern char language[FN_REFLEN];
extern "C" MYSQL_PLUGIN_IMPORT ulong server_id; extern "C" MYSQL_PLUGIN_IMPORT ulong server_id;
@ -244,8 +245,10 @@ extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_LOCK_table_share, key_LOCK_thd_data, key_LOCK_table_share, key_LOCK_thd_data,
key_LOCK_user_conn, key_LOCK_uuid_generator, key_LOG_LOCK_log, key_LOCK_user_conn, key_LOCK_uuid_generator, key_LOG_LOCK_log,
key_master_info_data_lock, key_master_info_run_lock, key_master_info_data_lock, key_master_info_run_lock,
key_master_info_sleep_lock,
key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock, key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock,
key_relay_log_info_log_space_lock, key_relay_log_info_run_lock, key_relay_log_info_log_space_lock, key_relay_log_info_run_lock,
key_relay_log_info_sleep_lock,
key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data, key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data,
key_LOCK_error_messages, key_LOCK_thread_count, key_PARTITION_LOCK_auto_inc; key_LOCK_error_messages, key_LOCK_thread_count, key_PARTITION_LOCK_auto_inc;
extern PSI_mutex_key key_RELAYLOG_LOCK_index; extern PSI_mutex_key key_RELAYLOG_LOCK_index;
@ -264,8 +267,10 @@ extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
key_delayed_insert_cond, key_delayed_insert_cond_client, key_delayed_insert_cond, key_delayed_insert_cond_client,
key_item_func_sleep_cond, key_master_info_data_cond, key_item_func_sleep_cond, key_master_info_data_cond,
key_master_info_start_cond, key_master_info_stop_cond, key_master_info_start_cond, key_master_info_stop_cond,
key_master_info_sleep_cond,
key_relay_log_info_data_cond, key_relay_log_info_log_space_cond, key_relay_log_info_data_cond, key_relay_log_info_log_space_cond,
key_relay_log_info_start_cond, key_relay_log_info_stop_cond, key_relay_log_info_start_cond, key_relay_log_info_stop_cond,
key_relay_log_info_sleep_cond,
key_TABLE_SHARE_cond, key_user_level_lock_cond, key_TABLE_SHARE_cond, key_user_level_lock_cond,
key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache;
extern PSI_cond_key key_RELAYLOG_update_cond; extern PSI_cond_key key_RELAYLOG_update_cond;

View File

@ -49,9 +49,11 @@ Master_info::Master_info(bool is_slave_recovery)
bzero((char*) &file, sizeof(file)); bzero((char*) &file, sizeof(file));
mysql_mutex_init(key_master_info_run_lock, &run_lock, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_master_info_run_lock, &run_lock, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_master_info_data_lock, &data_lock, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_master_info_data_lock, &data_lock, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_master_info_sleep_lock, &sleep_lock, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_master_info_data_cond, &data_cond, NULL); mysql_cond_init(key_master_info_data_cond, &data_cond, NULL);
mysql_cond_init(key_master_info_start_cond, &start_cond, NULL); mysql_cond_init(key_master_info_start_cond, &start_cond, NULL);
mysql_cond_init(key_master_info_stop_cond, &stop_cond, NULL); mysql_cond_init(key_master_info_stop_cond, &stop_cond, NULL);
mysql_cond_init(key_master_info_sleep_cond, &sleep_cond, NULL);
} }
Master_info::~Master_info() Master_info::~Master_info()
@ -59,9 +61,11 @@ Master_info::~Master_info()
delete_dynamic(&ignore_server_ids); delete_dynamic(&ignore_server_ids);
mysql_mutex_destroy(&run_lock); mysql_mutex_destroy(&run_lock);
mysql_mutex_destroy(&data_lock); mysql_mutex_destroy(&data_lock);
mysql_mutex_destroy(&sleep_lock);
mysql_cond_destroy(&data_cond); mysql_cond_destroy(&data_cond);
mysql_cond_destroy(&start_cond); mysql_cond_destroy(&start_cond);
mysql_cond_destroy(&stop_cond); mysql_cond_destroy(&stop_cond);
mysql_cond_destroy(&sleep_cond);
} }
/** /**

View File

@ -78,8 +78,8 @@ class Master_info : public Slave_reporting_capability
File fd; // we keep the file open, so we need to remember the file pointer File fd; // we keep the file open, so we need to remember the file pointer
IO_CACHE file; IO_CACHE file;
mysql_mutex_t data_lock, run_lock; mysql_mutex_t data_lock, run_lock, sleep_lock;
mysql_cond_t data_cond, start_cond, stop_cond; mysql_cond_t data_cond, start_cond, stop_cond, sleep_cond;
THD *io_thd; THD *io_thd;
MYSQL* mysql; MYSQL* mysql;
uint32 file_id; /* for 3.23 load data infile */ uint32 file_id; /* for 3.23 load data infile */

View File

@ -75,10 +75,12 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery)
&data_lock, MY_MUTEX_INIT_FAST); &data_lock, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_relay_log_info_log_space_lock, mysql_mutex_init(key_relay_log_info_log_space_lock,
&log_space_lock, MY_MUTEX_INIT_FAST); &log_space_lock, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_relay_log_info_sleep_lock, &sleep_lock, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_relay_log_info_data_cond, &data_cond, NULL); mysql_cond_init(key_relay_log_info_data_cond, &data_cond, NULL);
mysql_cond_init(key_relay_log_info_start_cond, &start_cond, NULL); mysql_cond_init(key_relay_log_info_start_cond, &start_cond, NULL);
mysql_cond_init(key_relay_log_info_stop_cond, &stop_cond, NULL); mysql_cond_init(key_relay_log_info_stop_cond, &stop_cond, NULL);
mysql_cond_init(key_relay_log_info_log_space_cond, &log_space_cond, NULL); mysql_cond_init(key_relay_log_info_log_space_cond, &log_space_cond, NULL);
mysql_cond_init(key_relay_log_info_sleep_cond, &sleep_cond, NULL);
relay_log.init_pthread_objects(); relay_log.init_pthread_objects();
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -91,10 +93,12 @@ Relay_log_info::~Relay_log_info()
mysql_mutex_destroy(&run_lock); mysql_mutex_destroy(&run_lock);
mysql_mutex_destroy(&data_lock); mysql_mutex_destroy(&data_lock);
mysql_mutex_destroy(&log_space_lock); mysql_mutex_destroy(&log_space_lock);
mysql_mutex_destroy(&sleep_lock);
mysql_cond_destroy(&data_cond); mysql_cond_destroy(&data_cond);
mysql_cond_destroy(&start_cond); mysql_cond_destroy(&start_cond);
mysql_cond_destroy(&stop_cond); mysql_cond_destroy(&stop_cond);
mysql_cond_destroy(&log_space_cond); mysql_cond_destroy(&log_space_cond);
mysql_cond_destroy(&sleep_cond);
relay_log.cleanup(); relay_log.cleanup();
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }

View File

@ -138,15 +138,13 @@ public:
standard lock acquisition order to avoid deadlocks: standard lock acquisition order to avoid deadlocks:
run_lock, data_lock, relay_log.LOCK_log, relay_log.LOCK_index run_lock, data_lock, relay_log.LOCK_log, relay_log.LOCK_index
*/ */
mysql_mutex_t data_lock, run_lock; mysql_mutex_t data_lock, run_lock, sleep_lock;
/* /*
start_cond is broadcast when SQL thread is started start_cond is broadcast when SQL thread is started
stop_cond - when stopped stop_cond - when stopped
data_cond - when data protected by data_lock changes data_cond - when data protected by data_lock changes
*/ */
mysql_cond_t start_cond, stop_cond, data_cond; mysql_cond_t start_cond, stop_cond, data_cond, sleep_cond;
/* parent Master_info structure */ /* parent Master_info structure */
Master_info *mi; Master_info *mi;

View File

@ -68,8 +68,6 @@ bool use_slave_mask = 0;
MY_BITMAP slave_error_mask; MY_BITMAP slave_error_mask;
char slave_skip_error_names[SHOW_VAR_FUNC_BUFF_SIZE]; char slave_skip_error_names[SHOW_VAR_FUNC_BUFF_SIZE];
typedef bool (*CHECK_KILLED_FUNC)(THD*,void*);
char* slave_load_tmpdir = 0; char* slave_load_tmpdir = 0;
Master_info *active_mi= 0; Master_info *active_mi= 0;
my_bool replicate_same_server_id; my_bool replicate_same_server_id;
@ -152,9 +150,6 @@ static int safe_reconnect(THD* thd, MYSQL* mysql, Master_info* mi,
bool suppress_warnings); bool suppress_warnings);
static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
bool reconnect, bool suppress_warnings); bool reconnect, bool suppress_warnings);
static int safe_sleep(THD* thd, int sec, CHECK_KILLED_FUNC thread_killed,
void* thread_killed_arg);
static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi);
static Log_event* next_event(Relay_log_info* rli); static Log_event* next_event(Relay_log_info* rli);
static int queue_event(Master_info* mi,const char* buf,ulong event_len); static int queue_event(Master_info* mi,const char* buf,ulong event_len);
static int terminate_slave_thread(THD *thd, static int terminate_slave_thread(THD *thd,
@ -2068,35 +2063,42 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
/*
Sleep for a given amount of time or until killed.
static int safe_sleep(THD* thd, int sec, CHECK_KILLED_FUNC thread_killed, @param thd Thread context of the current thread.
void* thread_killed_arg) @param seconds The number of seconds to sleep.
@param func Function object to check if the thread has been killed.
@param info The Rpl_info object associated with this sleep.
@retval True if the thread has been killed, false otherwise.
*/
template <typename killed_func, typename rpl_info>
static inline bool slave_sleep(THD *thd, time_t seconds,
killed_func func, rpl_info info)
{ {
int nap_time;
thr_alarm_t alarmed;
DBUG_ENTER("safe_sleep");
thr_alarm_init(&alarmed); bool ret;
time_t start_time= my_time(0); struct timespec abstime;
time_t end_time= start_time+sec; const char *old_proc_info;
while ((nap_time= (int) (end_time - start_time)) > 0) mysql_mutex_t *lock= &info->sleep_lock;
mysql_cond_t *cond= &info->sleep_cond;
/* Absolute system time at which the sleep time expires. */
set_timespec(abstime, seconds);
mysql_mutex_lock(lock);
old_proc_info= thd->enter_cond(cond, lock, thd->proc_info);
while (! (ret= func(thd, info)))
{ {
ALARM alarm_buff; int error= mysql_cond_timedwait(cond, lock, &abstime);
/* if (error == ETIMEDOUT || error == ETIME)
The only reason we are asking for alarm is so that break;
we will be woken up in case of murder, so if we do not get killed,
set the alarm so it goes off after we wake up naturally
*/
thr_alarm(&alarmed, 2 * nap_time, &alarm_buff);
sleep(nap_time);
thr_end_alarm(&alarmed);
if ((*thread_killed)(thd,thread_killed_arg))
DBUG_RETURN(1);
start_time= my_time(0);
} }
DBUG_RETURN(0); /* Implicitly unlocks the mutex. */
thd->exit_cond(old_proc_info);
return ret;
} }
@ -2555,8 +2557,8 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
exec_res= 0; exec_res= 0;
rli->cleanup_context(thd, 1); rli->cleanup_context(thd, 1);
/* chance for concurrent connection to get more locks */ /* chance for concurrent connection to get more locks */
safe_sleep(thd, min(rli->trans_retries, MAX_SLAVE_RETRY_PAUSE), slave_sleep(thd, min(rli->trans_retries, MAX_SLAVE_RETRY_PAUSE),
(CHECK_KILLED_FUNC)sql_slave_killed, (void*)rli); sql_slave_killed, rli);
mysql_mutex_lock(&rli->data_lock); // because of SHOW STATUS mysql_mutex_lock(&rli->data_lock); // because of SHOW STATUS
rli->trans_retries++; rli->trans_retries++;
rli->retried_trans++; rli->retried_trans++;
@ -2654,8 +2656,7 @@ static int try_to_reconnect(THD *thd, MYSQL *mysql, Master_info *mi,
{ {
if (*retry_count > master_retry_count) if (*retry_count > master_retry_count)
return 1; // Don't retry forever return 1; // Don't retry forever
safe_sleep(thd, mi->connect_retry, (CHECK_KILLED_FUNC) io_slave_killed, slave_sleep(thd, mi->connect_retry, io_slave_killed, mi);
(void *) mi);
} }
if (check_io_slave_killed(thd, mi, messages[SLAVE_RECON_MSG_KILLED_WAITING])) if (check_io_slave_killed(thd, mi, messages[SLAVE_RECON_MSG_KILLED_WAITING]))
return 1; return 1;
@ -4248,8 +4249,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
change_rpl_status(RPL_ACTIVE_SLAVE,RPL_LOST_SOLDIER); change_rpl_status(RPL_ACTIVE_SLAVE,RPL_LOST_SOLDIER);
break; break;
} }
safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed, slave_sleep(thd,mi->connect_retry,io_slave_killed, mi);
(void*)mi);
} }
if (!slave_was_killed) if (!slave_was_killed)

View File

@ -57,6 +57,20 @@ public:
{ {
my_hash_delete(&m_hashtable, (uchar *)sp); my_hash_delete(&m_hashtable, (uchar *)sp);
} }
/**
Remove all elements from a stored routine cache if the current
number of elements exceeds the argument value.
@param[in] upper_limit_for_elements Soft upper limit of elements that
can be stored in the cache.
*/
void enforce_limit(ulong upper_limit_for_elements)
{
if (m_hashtable.records > upper_limit_for_elements)
my_hash_reset(&m_hashtable);
}
private: private:
void init(); void init();
void cleanup(); void cleanup();
@ -228,6 +242,21 @@ ulong sp_cache_version()
} }
/**
Enforce that the current number of elements in the cache don't exceed
the argument value by flushing the cache if necessary.
@param[in] c Cache to check
@param[in] upper_limit_for_elements Soft upper limit for number of sp_head
objects that can be stored in the cache.
*/
void
sp_cache_enforce_limit(sp_cache *c, ulong upper_limit_for_elements)
{
if (c)
c->enforce_limit(upper_limit_for_elements);
}
/************************************************************************* /*************************************************************************
Internal functions Internal functions
*************************************************************************/ *************************************************************************/

View File

@ -62,5 +62,6 @@ sp_head *sp_cache_lookup(sp_cache **cp, sp_name *name);
void sp_cache_invalidate(); void sp_cache_invalidate();
void sp_cache_flush_obsolete(sp_cache **cp, sp_head **sp); void sp_cache_flush_obsolete(sp_cache **cp, sp_head **sp);
ulong sp_cache_version(); ulong sp_cache_version();
void sp_cache_enforce_limit(sp_cache *cp, ulong upper_limit_for_elements);
#endif /* _SP_CACHE_H_ */ #endif /* _SP_CACHE_H_ */

View File

@ -5632,6 +5632,8 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
query_cache_abort(&thd->query_cache_tls); query_cache_abort(&thd->query_cache_tls);
} }
thd_proc_info(thd, "freeing items"); thd_proc_info(thd, "freeing items");
sp_cache_enforce_limit(thd->sp_proc_cache, stored_program_cache_size);
sp_cache_enforce_limit(thd->sp_func_cache, stored_program_cache_size);
thd->end_statement(); thd->end_statement();
thd->cleanup_after_query(); thd->cleanup_after_query();
DBUG_ASSERT(thd->change_list.is_empty()); DBUG_ASSERT(thd->change_list.is_empty());

View File

@ -2195,6 +2195,9 @@ void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length)
thd->protocol= save_protocol; thd->protocol= save_protocol;
sp_cache_enforce_limit(thd->sp_proc_cache, stored_program_cache_size);
sp_cache_enforce_limit(thd->sp_func_cache, stored_program_cache_size);
/* check_prepared_statemnt sends the metadata packet in case of success */ /* check_prepared_statemnt sends the metadata packet in case of success */
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -2560,6 +2563,9 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
stmt->execute_loop(&expanded_query, open_cursor, packet, packet_end); stmt->execute_loop(&expanded_query, open_cursor, packet, packet_end);
thd->protocol= save_protocol; thd->protocol= save_protocol;
sp_cache_enforce_limit(thd->sp_proc_cache, stored_program_cache_size);
sp_cache_enforce_limit(thd->sp_func_cache, stored_program_cache_size);
/* Close connection socket; for use with client testing (Bug#43560). */ /* Close connection socket; for use with client testing (Bug#43560). */
DBUG_EXECUTE_IF("close_conn_after_stmt_execute", vio_close(thd->net.vio);); DBUG_EXECUTE_IF("close_conn_after_stmt_execute", vio_close(thd->net.vio););

View File

@ -3253,6 +3253,13 @@ static Sys_var_tz Sys_time_zone(
SESSION_VAR(time_zone), NO_CMD_LINE, SESSION_VAR(time_zone), NO_CMD_LINE,
DEFAULT(&default_tz), NO_MUTEX_GUARD, IN_BINLOG); DEFAULT(&default_tz), NO_MUTEX_GUARD, IN_BINLOG);
static Sys_var_ulong Sys_sp_cache_size(
"stored_program_cache",
"The soft upper limit for number of cached stored routines for "
"one connection.",
GLOBAL_VAR(stored_program_cache_size), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(256, 512 * 1024), DEFAULT(256), BLOCK_SIZE(1));
/**************************************************************************** /****************************************************************************
Used templates Used templates

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2010, Innobase Oy. All Rights Reserved. Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -42,6 +42,27 @@ Created 6/2/1994 Heikki Tuuri
#include "ibuf0ibuf.h" #include "ibuf0ibuf.h"
#include "trx0trx.h" #include "trx0trx.h"
/**************************************************************//**
Report that an index page is corrupted. */
UNIV_INTERN
void
btr_corruption_report(
/*==================*/
const buf_block_t* block, /*!< in: corrupted block */
const dict_index_t* index) /*!< in: index tree */
{
fprintf(stderr, "InnoDB: flag mismatch in space %u page %u"
" index %s of table %s\n",
(unsigned) buf_block_get_space(block),
(unsigned) buf_block_get_page_no(block),
index->name, index->table_name);
buf_page_print(buf_block_get_frame(block), 0);
if (block->page.zip.data) {
buf_page_print(block->page.zip.data,
buf_block_get_zip_size(block));
}
}
#ifdef UNIV_BLOB_DEBUG #ifdef UNIV_BLOB_DEBUG
# include "srv0srv.h" # include "srv0srv.h"
# include "ut0rbt.h" # include "ut0rbt.h"
@ -692,8 +713,7 @@ btr_root_block_get(
block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH,
index, mtr); index, mtr);
ut_a((ibool)!!page_is_comp(buf_block_get_frame(block)) btr_assert_not_corrupted(block, index);
== dict_table_is_comp(index->table));
#ifdef UNIV_BTR_DEBUG #ifdef UNIV_BTR_DEBUG
if (!dict_index_is_ibuf(index)) { if (!dict_index_is_ibuf(index)) {
const page_t* root = buf_block_get_frame(block); const page_t* root = buf_block_get_frame(block);
@ -1532,7 +1552,7 @@ btr_page_reorganize_low(
ibool success = FALSE; ibool success = FALSE;
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); btr_assert_not_corrupted(block, index);
#ifdef UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page)); ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
@ -3164,7 +3184,8 @@ btr_compress(
block = btr_cur_get_block(cursor); block = btr_cur_get_block(cursor);
page = btr_cur_get_page(cursor); page = btr_cur_get_page(cursor);
index = btr_cur_get_index(cursor); index = btr_cur_get_index(cursor);
ut_a((ibool) !!page_is_comp(page) == dict_table_is_comp(index->table));
btr_assert_not_corrupted(block, index);
ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index), ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
MTR_MEMO_X_LOCK)); MTR_MEMO_X_LOCK));

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc. Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
@ -408,7 +408,12 @@ btr_cur_search_to_nth_level(
ut_ad(dict_index_check_search_tuple(index, tuple)); ut_ad(dict_index_check_search_tuple(index, tuple));
ut_ad(!dict_index_is_ibuf(index) || ibuf_inside(mtr)); ut_ad(!dict_index_is_ibuf(index) || ibuf_inside(mtr));
ut_ad(dtuple_check_typed(tuple)); ut_ad(dtuple_check_typed(tuple));
ut_ad(index->page != FIL_NULL);
UNIV_MEM_INVALID(&cursor->up_match, sizeof cursor->up_match);
UNIV_MEM_INVALID(&cursor->up_bytes, sizeof cursor->up_bytes);
UNIV_MEM_INVALID(&cursor->low_match, sizeof cursor->low_match);
UNIV_MEM_INVALID(&cursor->low_bytes, sizeof cursor->low_bytes);
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
cursor->up_match = ULINT_UNDEFINED; cursor->up_match = ULINT_UNDEFINED;
cursor->low_match = ULINT_UNDEFINED; cursor->low_match = ULINT_UNDEFINED;
@ -757,11 +762,11 @@ retry_page_get:
if (level != 0) { if (level != 0) {
/* x-latch the page */ /* x-latch the page */
page = btr_page_get( buf_block_t* child_block = btr_block_get(
space, zip_size, page_no, RW_X_LATCH, index, mtr); space, zip_size, page_no, RW_X_LATCH, index, mtr);
ut_a((ibool)!!page_is_comp(page) page = buf_block_get_frame(child_block);
== dict_table_is_comp(index->table)); btr_assert_not_corrupted(child_block, index);
} else { } else {
cursor->low_match = low_match; cursor->low_match = low_match;
cursor->low_bytes = low_bytes; cursor->low_bytes = low_bytes;

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc. Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
@ -615,6 +615,8 @@ buf_page_print(
ulint old_checksum; ulint old_checksum;
ulint size = zip_size; ulint size = zip_size;
ut_ad(0);
if (!size) { if (!size) {
size = UNIV_PAGE_SIZE; size = UNIV_PAGE_SIZE;
} }

View File

@ -3880,6 +3880,7 @@ ibuf_insert_to_index_page_low(
fputs("InnoDB: Submit a detailed bug report" fputs("InnoDB: Submit a detailed bug report"
" to http://bugs.mysql.com\n", stderr); " to http://bugs.mysql.com\n", stderr);
ut_ad(0);
} }
/************************************************************************ /************************************************************************
@ -4073,6 +4074,11 @@ ibuf_set_del_mark(
TRUE, mtr); TRUE, mtr);
} }
} else { } else {
const page_t* page
= page_cur_get_page(&page_cur);
const buf_block_t* block
= page_cur_get_block(&page_cur);
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fputs(" InnoDB: unable to find a record to delete-mark\n", fputs(" InnoDB: unable to find a record to delete-mark\n",
stderr); stderr);
@ -4081,10 +4087,14 @@ ibuf_set_del_mark(
fputs("\n" fputs("\n"
"InnoDB: record ", stderr); "InnoDB: record ", stderr);
rec_print(stderr, page_cur_get_rec(&page_cur), index); rec_print(stderr, page_cur_get_rec(&page_cur), index);
putc('\n', stderr); fprintf(stderr, "\nspace %u offset %u"
fputs("\n" " (%u records, index id %llu)\n"
"InnoDB: Submit a detailed bug report" "InnoDB: Submit a detailed bug report"
" to http://bugs.mysql.com\n", stderr); " to http://bugs.mysql.com\n",
(unsigned) buf_block_get_space(block),
(unsigned) buf_block_get_page_no(block),
(unsigned) page_get_n_recs(page),
(ulonglong) btr_page_get_index_id(page));
ut_ad(0); ut_ad(0);
} }
} }
@ -4128,12 +4138,31 @@ ibuf_delete(
offsets = rec_get_offsets( offsets = rec_get_offsets(
rec, index, offsets, ULINT_UNDEFINED, &heap); rec, index, offsets, ULINT_UNDEFINED, &heap);
/* Refuse to delete the last record. */ if (page_get_n_recs(page) <= 1
ut_a(page_get_n_recs(page) > 1); || !(REC_INFO_DELETED_FLAG
& rec_get_info_bits(rec, page_is_comp(page)))) {
/* Refuse to purge the last record or a
record that has not been marked for deletion. */
ut_print_timestamp(stderr);
fputs(" InnoDB: unable to purge a record\n",
stderr);
fputs("InnoDB: tuple ", stderr);
dtuple_print(stderr, entry);
fputs("\n"
"InnoDB: record ", stderr);
rec_print_new(stderr, rec, offsets);
fprintf(stderr, "\nspace %u offset %u"
" (%u records, index id %llu)\n"
"InnoDB: Submit a detailed bug report"
" to http://bugs.mysql.com\n",
(unsigned) buf_block_get_space(block),
(unsigned) buf_block_get_page_no(block),
(unsigned) page_get_n_recs(page),
(ulonglong) btr_page_get_index_id(page));
/* The record should have been marked for deletion. */ ut_ad(0);
ut_ad(REC_INFO_DELETED_FLAG return;
& rec_get_info_bits(rec, page_is_comp(page))); }
lock_update_delete(block, rec); lock_update_delete(block, rec);
@ -4219,6 +4248,7 @@ ibuf_restore_pos(
fprintf(stderr, "InnoDB: ibuf tree ok\n"); fprintf(stderr, "InnoDB: ibuf tree ok\n");
fflush(stderr); fflush(stderr);
ut_ad(0);
} }
return(FALSE); return(FALSE);

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2010, Innobase Oy. All Rights Reserved. Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -92,6 +92,26 @@ insert/delete buffer when the record is not in the buffer pool. */
buffer when the record is not in the buffer pool. */ buffer when the record is not in the buffer pool. */
#define BTR_DELETE 8192 #define BTR_DELETE 8192
/**************************************************************//**
Report that an index page is corrupted. */
UNIV_INTERN
void
btr_corruption_report(
/*==================*/
const buf_block_t* block, /*!< in: corrupted block */
const dict_index_t* index) /*!< in: index tree */
UNIV_COLD __attribute__((nonnull));
/** Assert that a B-tree page is not corrupted.
@param block buffer block containing a B-tree page
@param index the B-tree index */
#define btr_assert_not_corrupted(block, index) \
if ((ibool) !!page_is_comp(buf_block_get_frame(block)) \
!= dict_table_is_comp((index)->table)) { \
btr_corruption_report(block, index); \
ut_error; \
}
#ifdef UNIV_BLOB_DEBUG #ifdef UNIV_BLOB_DEBUG
# include "ut0rbt.h" # include "ut0rbt.h"
/** An index->blobs entry for keeping track of off-page column references */ /** An index->blobs entry for keeping track of off-page column references */

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved. Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -216,6 +216,7 @@ mlog_write_initial_log_record_fast(
"Please post a bug report to " "Please post a bug report to "
"bugs.mysql.com.\n", "bugs.mysql.com.\n",
type, offset, space); type, offset, space);
ut_ad(0);
} }
} }

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved. Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -38,6 +38,7 @@ Created 5/7/1996 Heikki Tuuri
#include "trx0purge.h" #include "trx0purge.h"
#include "dict0mem.h" #include "dict0mem.h"
#include "trx0sys.h" #include "trx0sys.h"
#include "btr0btr.h"
/* Restricts the length of search we will do in the waits-for /* Restricts the length of search we will do in the waits-for
graph of transactions */ graph of transactions */
@ -1690,7 +1691,7 @@ lock_rec_create(
page_no = buf_block_get_page_no(block); page_no = buf_block_get_page_no(block);
page = block->frame; page = block->frame;
ut_ad(!!page_is_comp(page) == dict_table_is_comp(index->table)); btr_assert_not_corrupted(block, index);
/* If rec is the supremum record, then we reset the gap and /* If rec is the supremum record, then we reset the gap and
LOCK_REC_NOT_GAP bits, as all locks on the supremum are LOCK_REC_NOT_GAP bits, as all locks on the supremum are
@ -1795,6 +1796,7 @@ lock_rec_enqueue_waiting(
"InnoDB: Submit a detailed bug report" "InnoDB: Submit a detailed bug report"
" to http://bugs.mysql.com\n", " to http://bugs.mysql.com\n",
stderr); stderr);
ut_ad(0);
} }
/* Enqueue the lock request that will wait to be granted */ /* Enqueue the lock request that will wait to be granted */
@ -3795,6 +3797,7 @@ lock_table_enqueue_waiting(
"InnoDB: Submit a detailed bug report" "InnoDB: Submit a detailed bug report"
" to http://bugs.mysql.com\n", " to http://bugs.mysql.com\n",
stderr); stderr);
ut_ad(0);
} }
/* Enqueue the lock request that will wait to be granted */ /* Enqueue the lock request that will wait to be granted */

View File

@ -3211,7 +3211,91 @@ retry:
fprintf(stderr, fprintf(stderr,
"InnoDB: You can disable Linux Native AIO by" "InnoDB: You can disable Linux Native AIO by"
" setting innodb_native_aio = off in my.cnf\n"); " setting innodb_use_native_aio = 0 in my.cnf\n");
return(FALSE);
}
/******************************************************************//**
Checks if the system supports native linux aio. On some kernel
versions where native aio is supported it won't work on tmpfs. In such
cases we can't use native aio as it is not possible to mix simulated
and native aio.
@return: TRUE if supported, FALSE otherwise. */
static
ibool
os_aio_native_aio_supported(void)
/*=============================*/
{
int fd;
byte* buf;
byte* ptr;
struct io_event io_event;
io_context_t io_ctx;
struct iocb iocb;
struct iocb* p_iocb;
int err;
if (!os_aio_linux_create_io_ctx(1, &io_ctx)) {
/* The platform does not support native aio. */
return(FALSE);
}
/* Now check if tmpdir supports native aio ops. */
fd = innobase_mysql_tmpfile();
if (fd < 0) {
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Error: unable to create "
"temp file to check native AIO support.\n");
return(FALSE);
}
memset(&io_event, 0x0, sizeof(io_event));
buf = (byte*) ut_malloc(UNIV_PAGE_SIZE * 2);
ptr = (byte*) ut_align(buf, UNIV_PAGE_SIZE);
/* Suppress valgrind warning. */
memset(buf, 0x00, UNIV_PAGE_SIZE * 2);
memset(&iocb, 0x0, sizeof(iocb));
p_iocb = &iocb;
io_prep_pwrite(p_iocb, fd, ptr, UNIV_PAGE_SIZE, 0);
err = io_submit(io_ctx, 1, &p_iocb);
if (err >= 1) {
/* Now collect the submitted IO request. */
err = io_getevents(io_ctx, 1, 1, &io_event, NULL);
}
ut_free(buf);
close(fd);
switch (err) {
case 1:
return(TRUE);
case -EINVAL:
case -ENOSYS:
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: Linux Native AIO is not"
" supported on tmpdir.\n"
"InnoDB: You can either move tmpdir to a"
" file system that supports native AIO\n"
"InnoDB: or you can set"
" innodb_use_native_aio to FALSE to avoid"
" this message.\n");
/* fall through. */
default:
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: Linux Native AIO check"
" on tmpdir returned error[%d]\n", -err);
}
return(FALSE); return(FALSE);
} }
#endif /* LINUX_NATIVE_AIO */ #endif /* LINUX_NATIVE_AIO */
@ -3378,6 +3462,19 @@ os_aio_init(
os_io_init_simple(); os_io_init_simple();
#if defined(LINUX_NATIVE_AIO)
/* Check if native aio is supported on this system and tmpfs */
if (srv_use_native_aio
&& !os_aio_native_aio_supported()) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: Linux Native AIO"
" disabled.\n");
srv_use_native_aio = FALSE;
}
#endif /* LINUX_NATIVE_AIO */
for (i = 0; i < n_segments; i++) { for (i = 0; i < n_segments; i++) {
srv_set_io_thread_op_info(i, "not started yet"); srv_set_io_thread_op_info(i, "not started yet");
} }

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2010, Innobase Oy. All Rights Reserved. Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -549,8 +549,7 @@ page_copy_rec_list_end_no_locks(
page_cur_move_to_next(&cur1); page_cur_move_to_next(&cur1);
} }
ut_a((ibool)!!page_is_comp(new_page) btr_assert_not_corrupted(new_block, index);
== dict_table_is_comp(index->table));
ut_a(page_is_comp(new_page) == page_rec_is_comp(rec)); ut_a(page_is_comp(new_page) == page_rec_is_comp(rec));
ut_a(mach_read_from_2(new_page + UNIV_PAGE_SIZE - 10) == (ulint) ut_a(mach_read_from_2(new_page + UNIV_PAGE_SIZE - 10) == (ulint)
(page_is_comp(new_page) ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM)); (page_is_comp(new_page) ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM));

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved. Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -950,7 +950,7 @@ row_ins_foreign_check_on_constraint(
fputs("\n" fputs("\n"
"InnoDB: Submit a detailed bug report to" "InnoDB: Submit a detailed bug report to"
" http://bugs.mysql.com\n", stderr); " http://bugs.mysql.com\n", stderr);
ut_ad(0);
err = DB_SUCCESS; err = DB_SUCCESS;
goto nonstandard_exit_func; goto nonstandard_exit_func;

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc. Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
@ -2963,6 +2963,7 @@ row_sel_get_clust_rec_for_mysql(
fputs("\n" fputs("\n"
"InnoDB: Submit a detailed bug report" "InnoDB: Submit a detailed bug report"
" to http://bugs.mysql.com\n", stderr); " to http://bugs.mysql.com\n", stderr);
ut_ad(0);
} }
clust_rec = NULL; clust_rec = NULL;

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1997, 2010, Innobase Oy. All Rights Reserved. Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -509,6 +509,7 @@ row_undo_mod_del_unmark_sec_and_undo_update(
fputs("\n" fputs("\n"
"InnoDB: Submit a detailed bug report" "InnoDB: Submit a detailed bug report"
" to http://bugs.mysql.com\n", stderr); " to http://bugs.mysql.com\n", stderr);
ut_ad(0);
break; break;
case ROW_FOUND: case ROW_FOUND:
btr_cur = btr_pcur_get_btr_cur(&pcur); btr_cur = btr_pcur_get_btr_cur(&pcur);

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved. Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -1617,6 +1617,7 @@ row_upd_sec_index_entry(
fputs("\n" fputs("\n"
"InnoDB: Submit a detailed bug report" "InnoDB: Submit a detailed bug report"
" to http://bugs.mysql.com\n", stderr); " to http://bugs.mysql.com\n", stderr);
ut_ad(0);
break; break;
case ROW_FOUND: case ROW_FOUND:
/* Delete mark the old index record; it can already be /* Delete mark the old index record; it can already be

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc. Copyright (c) 2009, Percona Inc.
@ -2415,6 +2415,7 @@ loop:
"InnoDB: Please submit a bug report" "InnoDB: Please submit a bug report"
" to http://bugs.mysql.com\n", " to http://bugs.mysql.com\n",
old_lsn, new_lsn); old_lsn, new_lsn);
ut_ad(0);
} }
old_lsn = new_lsn; old_lsn = new_lsn;

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2011, Innobase Oy. All Rights Reserved. Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -730,6 +730,7 @@ trx_purge_rseg_get_next_history_log(
"InnoDB: report, and submit it" "InnoDB: report, and submit it"
" to http://bugs.mysql.com\n", " to http://bugs.mysql.com\n",
(ulong) trx_sys->rseg_history_len); (ulong) trx_sys->rseg_history_len);
ut_ad(0);
} }
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -1003,6 +1003,7 @@ trx_undo_update_rec_get_update(
fprintf(stderr, "\n" fprintf(stderr, "\n"
"InnoDB: n_fields = %lu, i = %lu, ptr %p\n", "InnoDB: n_fields = %lu, i = %lu, ptr %p\n",
(ulong) n_fields, (ulong) i, ptr); (ulong) n_fields, (ulong) i, ptr);
ut_ad(0);
*upd = NULL; *upd = NULL;
return(NULL); return(NULL);
} }
@ -1513,6 +1514,7 @@ trx_undo_prev_version_build(
"InnoDB: record version ", stderr); "InnoDB: record version ", stderr);
rec_print_new(stderr, rec, offsets); rec_print_new(stderr, rec, offsets);
putc('\n', stderr); putc('\n', stderr);
ut_ad(0);
return(DB_ERROR); return(DB_ERROR);
} }
@ -1618,6 +1620,7 @@ trx_undo_prev_version_build(
(ullint) old_roll_ptr, (ullint) roll_ptr); (ullint) old_roll_ptr, (ullint) roll_ptr);
trx_purge_sys_print(); trx_purge_sys_print();
ut_ad(0);
return(DB_ERROR); return(DB_ERROR);
} }

View File

@ -3154,6 +3154,40 @@ CHARSET_INFO my_charset_ucs2_general_ci=
&my_collation_ucs2_general_ci_handler &my_collation_ucs2_general_ci_handler
}; };
CHARSET_INFO my_charset_ucs2_general_mysql500_ci=
{
159, 0, 0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, /* state */
"ucs2", /* cs name */
"ucs2_general_mysql500_ci", /* name */
"", /* comment */
NULL, /* tailoring */
ctype_ucs2, /* ctype */
to_lower_ucs2, /* to_lower */
to_upper_ucs2, /* to_upper */
to_upper_ucs2, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
my_unicase_mysql500, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
1, /* caseup_multiply */
1, /* casedn_multiply */
2, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
0xFFFF, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_general_ci_handler
};
CHARSET_INFO my_charset_ucs2_bin= CHARSET_INFO my_charset_ucs2_bin=
{ {
90,0,0, /* number */ 90,0,0, /* number */

View File

@ -193,6 +193,141 @@ static MY_UNICASE_INFO plane00[]={
}; };
/*
Almost similar to plane00, but maps sorting order
for U+00DF to 0x00DF instead of 0x0053.
*/
static MY_UNICASE_INFO plane00_mysql500[]={
{0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001},
{0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003},
{0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005},
{0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007},
{0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009},
{0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B},
{0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D},
{0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F},
{0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011},
{0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013},
{0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015},
{0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017},
{0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019},
{0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B},
{0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D},
{0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F},
{0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021},
{0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023},
{0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025},
{0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027},
{0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029},
{0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B},
{0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D},
{0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F},
{0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031},
{0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033},
{0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035},
{0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037},
{0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039},
{0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B},
{0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D},
{0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F},
{0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041},
{0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043},
{0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045},
{0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047},
{0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049},
{0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B},
{0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D},
{0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F},
{0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051},
{0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053},
{0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055},
{0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057},
{0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059},
{0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B},
{0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D},
{0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F},
{0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041},
{0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043},
{0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045},
{0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047},
{0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049},
{0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B},
{0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D},
{0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F},
{0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051},
{0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053},
{0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055},
{0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057},
{0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059},
{0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B},
{0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D},
{0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F},
{0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081},
{0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083},
{0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085},
{0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087},
{0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089},
{0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B},
{0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D},
{0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F},
{0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091},
{0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093},
{0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095},
{0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097},
{0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099},
{0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B},
{0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D},
{0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F},
{0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1},
{0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3},
{0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5},
{0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7},
{0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9},
{0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB},
{0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD},
{0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF},
{0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1},
{0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3},
{0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C},
{0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7},
{0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9},
{0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB},
{0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD},
{0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF},
{0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041},
{0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041},
{0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041},
{0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043},
{0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045},
{0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045},
{0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049},
{0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049},
{0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E},
{0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F},
{0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F},
{0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7},
{0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055},
{0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055},
{0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059},
{0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x00DF},
{0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041},
{0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041},
{0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041},
{0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043},
{0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045},
{0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045},
{0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049},
{0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049},
{0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E},
{0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F},
{0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F},
{0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7},
{0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055},
{0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055},
{0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059},
{0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059}
};
static MY_UNICASE_INFO plane01[]={ static MY_UNICASE_INFO plane01[]={
{0x0100,0x0101,0x0041}, {0x0100,0x0101,0x0041}, {0x0100,0x0101,0x0041}, {0x0100,0x0101,0x0041},
@ -1541,6 +1676,47 @@ MY_UNICASE_INFO *my_unicase_default[256]={
}; };
/*
Reproduce old utf8_general_ci behaviour before we fixed Bug#27877.
*/
MY_UNICASE_INFO *my_unicase_mysql500[256]={
plane00_mysql500,
plane01, plane02, plane03, plane04, plane05, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F,
NULL, plane21, NULL, NULL, plane24, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, planeFF
};
/* /*
Turkish lower/upper mapping: Turkish lower/upper mapping:
1. LOWER(0x0049 LATIN CAPITAL LETTER I) -> 1. LOWER(0x0049 LATIN CAPITAL LETTER I) ->
@ -2814,6 +2990,39 @@ CHARSET_INFO my_charset_utf8_general_ci=
}; };
CHARSET_INFO my_charset_utf8_general_mysql500_ci=
{
223,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, /* state */
"utf8", /* cs name */
"utf8_general_mysql500_ci", /* name */
"", /* comment */
NULL, /* tailoring */
ctype_utf8, /* ctype */
to_lower_utf8, /* to_lower */
to_upper_utf8, /* to_upper */
to_upper_utf8, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
my_unicase_mysql500, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
1, /* caseup_multiply */
1, /* casedn_multiply */
1, /* mbminlen */
3, /* mbmaxlen */
0, /* min_sort_char */
0xFFFF, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_ci_handler
};
CHARSET_INFO my_charset_utf8_bin= CHARSET_INFO my_charset_utf8_bin=
{ {
83,0,0, /* number */ 83,0,0, /* number */
@ -4325,6 +4534,7 @@ CHARSET_INFO my_charset_filename=
&my_collation_filename_handler &my_collation_filename_handler
}; };
#ifdef MY_TEST_UTF8 #ifdef MY_TEST_UTF8
#include <stdio.h> #include <stdio.h>

View File

@ -783,7 +783,20 @@ static Bigint *multadd(Bigint *b, int m, int a, Stack_alloc *alloc)
return b; return b;
} }
/**
Converts a string to Bigint.
Now we have nd0 digits, starting at s, followed by a
decimal point, followed by nd-nd0 digits.
Unless nd0 == nd, in which case we have a number of the form:
".xxxxxx" or "xxxxxx."
@param s Input string, already partially parsed by my_strtod_int().
@param nd0 Number of digits before decimal point.
@param nd Total number of digits.
@param y9 Pre-computed value of the first nine digits.
@param alloc Stack allocator for Bigints.
*/
static Bigint *s2b(const char *s, int nd0, int nd, ULong y9, Stack_alloc *alloc) static Bigint *s2b(const char *s, int nd0, int nd, ULong y9, Stack_alloc *alloc)
{ {
Bigint *b; Bigint *b;
@ -803,10 +816,11 @@ static Bigint *s2b(const char *s, int nd0, int nd, ULong y9, Stack_alloc *alloc)
do do
b= multadd(b, 10, *s++ - '0', alloc); b= multadd(b, 10, *s++ - '0', alloc);
while (++i < nd0); while (++i < nd0);
s++; s++; /* skip '.' */
} }
else else
s+= 10; s+= 10;
/* now do the fractional part */
for(; i < nd; i++) for(; i < nd; i++)
b= multadd(b, 10, *s++ - '0', alloc); b= multadd(b, 10, *s++ - '0', alloc);
return b; return b;
@ -1416,20 +1430,29 @@ static double my_strtod_int(const char *s00, char **se, int *error, char *buf, s
for (; s < end && c >= '0' && c <= '9'; c = *++s) for (; s < end && c >= '0' && c <= '9'; c = *++s)
{ {
have_dig: have_dig:
nz++; /*
if (c-= '0') Here we are parsing the fractional part.
We can stop counting digits after a while: the extra digits
will not contribute to the actual result produced by s2b().
We have to continue scanning, in case there is an exponent part.
*/
if (nd < 2 * DBL_DIG)
{ {
nf+= nz; nz++;
for (i= 1; i < nz; i++) if (c-= '0')
{
nf+= nz;
for (i= 1; i < nz; i++)
if (nd++ < 9)
y*= 10;
else if (nd <= DBL_DIG + 1)
z*= 10;
if (nd++ < 9) if (nd++ < 9)
y*= 10; y= 10*y + c;
else if (nd <= DBL_DIG + 1) else if (nd <= DBL_DIG + 1)
z*= 10; z= 10*z + c;
if (nd++ < 9) nz= 0;
y= 10*y + c; }
else if (nd <= DBL_DIG + 1)
z= 10*z + c;
nz= 0;
} }
} }
} }