Commit 6d3bdcf1 authored by He Zhenxing's avatar He Zhenxing

Auto merge

parents 5229ef4a ec5e3b62
......@@ -166,4 +166,31 @@ ERROR HY000: View's SELECT refers to a temporary table 't2'
Cleanup.
drop table t2, t3;
#
# Bug#39843 DELETE requires write access to table in subquery in where clause
#
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
table1_rowid SMALLINT NOT NULL
);
CREATE TABLE t2 (
table2_rowid SMALLINT NOT NULL
);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
LOCK TABLES t1 WRITE, t2 READ;
# Sub-select should not try to aquire a write lock.
DELETE FROM t1
WHERE EXISTS
(
SELECT 'x'
FROM t2
WHERE t1.table1_rowid = t2.table2_rowid
) ;
# While implementing the patch we didn't break old behavior;
# The following sub-select should still requires a write lock:
SELECT * FROM t1 WHERE 1 IN (SELECT * FROM t2 FOR UPDATE);
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
UNLOCK TABLES;
DROP TABLE t1,t2;
End of 5.1 tests.
......@@ -2103,4 +2103,16 @@ a
UNLOCK TABLES;
# drop the created tables
DROP TABLE t1, t2, t3;
# insert duplicate value in child table while merge table doesn't have key
create table t1 (
col1 int(10),
primary key (col1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE m1 (
col1 int(10) NOT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(t1);
insert into m1 (col1) values (1);
insert into m1 (col1) values (1);
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
drop table m1, t1;
End of 5.1 tests
......@@ -803,6 +803,8 @@ select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
16382
set global max_prepared_stmt_count=-1;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1'
select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
0
......
......@@ -1305,7 +1305,7 @@ set @@sql_mode='traditional';
create table t1 (i int)
comment '123456789*123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*123456789*';
ERROR HY000: Too long comment for table 't1'
ERROR HY000: Comment for table 't1' is too long (max = 60)
create table t1 (
i int comment
'123456789*123456789*123456789*123456789*
......@@ -1315,7 +1315,7 @@ i int comment
123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*');
ERROR HY000: Too long comment for field 'i'
ERROR HY000: Comment for field 'i' is too long (max = 255)
set @@sql_mode= @org_mode;
create table t1
(i int comment
......@@ -1327,7 +1327,7 @@ create table t1
123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*');
Warnings:
Warning 1105 Unknown error
Warning 1629 Comment for field 'i' is too long (max = 255)
select column_name, column_comment from information_schema.columns where
table_schema = 'test' and table_name = 't1';
column_name column_comment
......
......@@ -753,7 +753,7 @@ VARIABLE_NAME VARIABLE_VALUE
MYISAM_DATA_POINTER_SIZE 7
SET GLOBAL table_open_cache=-1;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0'
Warning 1292 Truncated incorrect table_open_cache value: '-1'
SHOW VARIABLES LIKE 'table_open_cache';
Variable_name Value
table_open_cache 1
......@@ -1389,8 +1389,41 @@ SET @@session.thread_stack= 7;
ERROR HY000: Variable 'thread_stack' is a read only variable
SET @@global.thread_stack= 7;
ERROR HY000: Variable 'thread_stack' is a read only variable
SELECT @@global.expire_logs_days INTO @old_eld;
SET GLOBAL expire_logs_days = -1;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '-1'
needs to've been adjusted (0)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
0
SET GLOBAL expire_logs_days = 11;
SET @old_mode=@@sql_mode;
SET SESSION sql_mode = 'TRADITIONAL';
SET GLOBAL expire_logs_days = 100;
ERROR 42000: Variable 'expire_logs_days' can't be set to the value of '100'
needs to be unchanged (11)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
11
SET SESSION sql_mode = @old_mode;
SET GLOBAL expire_logs_days = 100;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '100'
needs to've been adjusted (99)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET GLOBAL expire_logs_days = 11;
SET GLOBAL expire_logs_days = 99;
needs to pass with no warnings (99)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET GLOBAL expire_logs_days = @old_eld;
select @@storage_engine;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def @@storage_engine 253 6 6 N 1 31 8
@@storage_engine
MyISAM
End of 5.1 tests
......@@ -61,7 +61,7 @@ SELECT @@global.auto_increment_increment;
1
SET @@global.auto_increment_increment = -1024;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
Warning 1292 Truncated incorrect auto_increment_increment value: '-1024'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
......@@ -89,7 +89,7 @@ SELECT @@session.auto_increment_increment;
1
SET @@session.auto_increment_increment = -2;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
Warning 1292 Truncated incorrect auto_increment_increment value: '-2'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
......
......@@ -169,7 +169,7 @@ id name
## Verifying behavior of variable with negative value ##
SET @@auto_increment_increment = -10;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
Warning 1292 Truncated incorrect auto_increment_increment value: '-10'
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
......
......@@ -61,7 +61,7 @@ SELECT @@global.auto_increment_offset;
1
SET @@global.auto_increment_offset = -1024;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
Warning 1292 Truncated incorrect auto_increment_offset value: '-1024'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
......@@ -94,7 +94,7 @@ SELECT @@session.auto_increment_offset;
1
SET @@session.auto_increment_offset = -2;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
Warning 1292 Truncated incorrect auto_increment_offset value: '-2'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
......
......@@ -178,7 +178,7 @@ id name
## Assigning -ve value to variable ##
SET @@auto_increment_offset = -10;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
Warning 1292 Truncated incorrect auto_increment_offset value: '-10'
SELECT @@auto_increment_offset = -10;
@@auto_increment_offset = -10
0
......
......@@ -28,6 +28,8 @@ SELECT @@global.concurrent_insert;
2
'#--------------------FN_DYNVARS_018_04-------------------------#'
SET @@global.concurrent_insert = -1;
Warnings:
Warning 1292 Truncated incorrect concurrent_insert value: '-1'
Select @@global.concurrent_insert;
@@global.concurrent_insert
0
......
......@@ -35,7 +35,7 @@ SELECT @@global.connect_timeout;
2
SET @@global.connect_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect connect_timeout value: '0'
Warning 1292 Truncated incorrect connect_timeout value: '-1024'
SELECT @@global.connect_timeout;
@@global.connect_timeout
2
......
......@@ -64,6 +64,8 @@ SELECT @@global.default_week_format;
@@global.default_week_format
7
SET @@global.default_week_format = -1024;
Warnings:
Warning 1292 Truncated incorrect default_week_format value: '-1024'
SELECT @@global.default_week_format;
@@global.default_week_format
0
......@@ -100,6 +102,8 @@ SELECT @@session.default_week_format;
@@session.default_week_format
7
SET @@session.default_week_format = -2;
Warnings:
Warning 1292 Truncated incorrect default_week_format value: '-2'
SELECT @@session.default_week_format;
@@session.default_week_format
0
......
......@@ -35,7 +35,7 @@ SELECT @@global.delayed_insert_timeout;
1
SET @@global.delayed_insert_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect delayed_insert_timeout value: '0'
Warning 1292 Truncated incorrect delayed_insert_timeout value: '-1024'
SELECT @@global.delayed_insert_timeout;
@@global.delayed_insert_timeout
1
......
......@@ -78,6 +78,8 @@ SELECT @@global.div_precision_increment;
@@global.div_precision_increment
30
SET @@global.div_precision_increment = -1024;
Warnings:
Warning 1292 Truncated incorrect div_precision_increment value: '-1024'
SELECT @@global.div_precision_increment;
@@global.div_precision_increment
0
......@@ -100,6 +102,8 @@ SELECT @@session.div_precision_increment;
@@session.div_precision_increment
30
SET @@session.div_precision_increment = -2;
Warnings:
Warning 1292 Truncated incorrect div_precision_increment value: '-2'
SELECT @@session.div_precision_increment;
@@session.div_precision_increment
0
......
......@@ -32,6 +32,8 @@ SELECT @@global.expire_logs_days;
21
'#--------------------FN_DYNVARS_029_04-------------------------#'
SET @@global.expire_logs_days = -1;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '-1'
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
0
......@@ -53,6 +55,8 @@ SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET @@global.expire_logs_days = -1024;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '-1024'
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
0
......
......@@ -65,7 +65,7 @@ SELECT @@global.group_concat_max_len;
4
SET @@global.group_concat_max_len = -1024;
Warnings:
Warning 1292 Truncated incorrect group_concat_max_len value: '0'
Warning 1292 Truncated incorrect group_concat_max_len value: '-1024'
SELECT @@global.group_concat_max_len;
@@global.group_concat_max_len
4
......@@ -91,7 +91,7 @@ SELECT @@session.group_concat_max_len;
4
SET @@session.group_concat_max_len = -2;
Warnings:
Warning 1292 Truncated incorrect group_concat_max_len value: '0'
Warning 1292 Truncated incorrect group_concat_max_len value: '-2'
SELECT @@session.group_concat_max_len;
@@session.group_concat_max_len
4
......
......@@ -61,7 +61,7 @@ SELECT @@global.interactive_timeout;
1
SET @@global.interactive_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect interactive_timeout value: '0'
Warning 1292 Truncated incorrect interactive_timeout value: '-1024'
SELECT @@global.interactive_timeout;
@@global.interactive_timeout
1
......@@ -89,7 +89,7 @@ SELECT @@session.interactive_timeout;
1
SET @@session.interactive_timeout = -2;
Warnings:
Warning 1292 Truncated incorrect interactive_timeout value: '0'
Warning 1292 Truncated incorrect interactive_timeout value: '-2'
SELECT @@session.interactive_timeout;
@@session.interactive_timeout
1
......
......@@ -76,7 +76,7 @@ SELECT @@global.max_allowed_packet;
1024
SET @@global.max_allowed_packet = -1024;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '0'
Warning 1292 Truncated incorrect max_allowed_packet value: '-1024'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
......
......@@ -39,7 +39,7 @@ SELECT @@global.max_binlog_size;
'#--------------------FN_DYNVARS_072_04-------------------------#'
SET @@global.max_binlog_size = -1;
Warnings:
Warning 1292 Truncated incorrect max_binlog_size value: '0'
Warning 1292 Truncated incorrect max_binlog_size value: '-1'
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
4096
......@@ -56,7 +56,7 @@ SELECT @@global.max_binlog_size;
1073741824
SET @@global.max_binlog_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_binlog_size value: '0'
Warning 1292 Truncated incorrect max_binlog_size value: '-1024'
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
4096
......
......@@ -39,7 +39,7 @@ SELECT @@global.max_connections;
'#--------------------FN_DYNVARS_074_04-------------------------#'
SET @@global.max_connections = -1;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '0'
Warning 1292 Truncated incorrect max_connections value: '-1'
SELECT @@global.max_connections;
@@global.max_connections
1
......@@ -56,7 +56,7 @@ SELECT @@global.max_connections;
100000
SET @@global.max_connections = -1024;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '0'
Warning 1292 Truncated incorrect max_connections value: '-1024'
SELECT @@global.max_connections;
@@global.max_connections
1
......
......@@ -76,10 +76,14 @@ SELECT @@session.max_delayed_threads;
16383
'#------------------FN_DYNVARS_075_05-----------------------#'
SET @@global.max_delayed_threads = -1024;
Warnings:
Warning 1292 Truncated incorrect max_delayed_threads value: '-1024'
SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
0
SET @@global.max_delayed_threads = -1;
Warnings:
Warning 1292 Truncated incorrect max_delayed_threads value: '-1'
SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
0
......
......@@ -63,10 +63,14 @@ SELECT @@session.max_error_count;
65534
'#------------------FN_DYNVARS_076_05-----------------------#'
SET @@global.max_error_count = -1;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-1'
SELECT @@global.max_error_count;
@@global.max_error_count
0
SET @@global.max_error_count = -1024;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-1024'
SELECT @@global.max_error_count;
@@global.max_error_count
0
......@@ -93,6 +97,8 @@ SELECT @@global.max_error_count;
@@global.max_error_count
65535
SET @@session.max_error_count = -1;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-1'
SELECT @@session.max_error_count;
@@session.max_error_count
0
......@@ -102,6 +108,8 @@ SELECT @@session.max_error_count;
@@session.max_error_count
65535
SET @@session.max_error_count = -2;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-2'
SELECT @@session.max_error_count;
@@session.max_error_count
0
......
......@@ -77,10 +77,14 @@ SELECT @@session.max_insert_delayed_threads;
16383
'#------------------FN_DYNVARS_078_05-----------------------#'
SET @@global.max_insert_delayed_threads = -1024;
Warnings:
Warning 1292 Truncated incorrect max_insert_delayed_threads value: '-1024'
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
0
SET @@global.max_insert_delayed_threads = -1;
Warnings:
Warning 1292 Truncated incorrect max_insert_delayed_threads value: '-1'
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
0
......
......@@ -71,7 +71,7 @@ SELECT @@session.max_length_for_sort_data;
'#------------------FN_DYNVARS_080_05-----------------------#'
SET @@global.max_length_for_sort_data = -1024;
Warnings:
Warning 1292 Truncated incorrect max_length_for_sort_data value: '0'
Warning 1292 Truncated incorrect max_length_for_sort_data value: '-1024'
SELECT @@global.max_length_for_sort_data;
@@global.max_length_for_sort_data
4
......@@ -111,7 +111,7 @@ SELECT @@session.max_length_for_sort_data;
8388608
SET @@session.max_length_for_sort_data = -1;
Warnings:
Warning 1292 Truncated incorrect max_length_for_sort_data value: '0'
Warning 1292 Truncated incorrect max_length_for_sort_data value: '-1'
SELECT @@session.max_length_for_sort_data;
@@session.max_length_for_sort_data
4
......
......@@ -36,6 +36,8 @@ SELECT @@global.max_prepared_stmt_count;
65535
'#--------------------FN_DYNVARS_081_04-------------------------#'
SET @@global.max_prepared_stmt_count = -1;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
0
......@@ -51,6 +53,8 @@ SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
1048576
SET @@global.max_prepared_stmt_count = -1024;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1024'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
0
......
......@@ -38,6 +38,8 @@ SELECT @@global.max_relay_log_size;
'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_082_04-------------------------#'
SET @@global.max_relay_log_size = -1;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '-1'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
0
......@@ -53,6 +55,8 @@ SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
1073741824
SET @@global.max_relay_log_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '-1024'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
0
......
......@@ -71,7 +71,7 @@ SELECT @@session.max_sort_length;
'#------------------FN_DYNVARS_084_05-----------------------#'
SET @@global.max_sort_length = -1024;
Warnings:
Warning 1292 Truncated incorrect max_sort_length value: '0'
Warning 1292 Truncated incorrect max_sort_length value: '-1024'
SELECT @@global.max_sort_length;
@@global.max_sort_length
4
......@@ -111,7 +111,7 @@ SELECT @@session.max_sort_length;
8388608
SET @@session.max_sort_length = -1;
Warnings:
Warning 1292 Truncated incorrect max_sort_length value: '0'
Warning 1292 Truncated incorrect max_sort_length value: '-1'
SELECT @@session.max_sort_length;
@@session.max_sort_length
4
......
......@@ -74,6 +74,8 @@ SELECT @@session.max_sp_recursion_depth;
150
'#------------------FN_DYNVARS_085_05-----------------------#'
SET @@global.max_sp_recursion_depth = -1024;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1024'
SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
0
......@@ -84,6 +86,8 @@ SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
255
SET @@global.max_sp_recursion_depth = -1;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1'
SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
0
......@@ -110,6 +114,8 @@ SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
255
SET @@session.max_sp_recursion_depth = -1;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1'
SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
0
......@@ -120,6 +126,8 @@ SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
255
SET @@session.max_sp_recursion_depth = -001;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1'
SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
0
......
......@@ -48,7 +48,7 @@ ERROR HY000: Variable 'myisam_data_pointer_size' is a GLOBAL variable and should
'#------------------FN_DYNVARS_093_05-----------------------#'
SET @@global.myisam_data_pointer_size = -1;
Warnings:
Warning 1292 Truncated incorrect myisam_data_pointer_size value: '0'
Warning 1292 Truncated incorrect myisam_data_pointer_size value: '-1'
SELECT @@global.myisam_data_pointer_size;
@@global.myisam_data_pointer_size
2
......
......@@ -50,7 +50,7 @@ SELECT @@global.net_buffer_length;
1024
SET @@global.net_buffer_length = -1024;
Warnings:
Warning 1292 Truncated incorrect net_buffer_length value: '0'
Warning 1292 Truncated incorrect net_buffer_length value: '-1024'
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1024
......
......@@ -61,7 +61,7 @@ SELECT @@global.net_read_timeout;
1
SET @@global.net_read_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect net_read_timeout value: '0'
Warning 1292 Truncated incorrect net_read_timeout value: '-1024'
SELECT @@global.net_read_timeout;
@@global.net_read_timeout
1
......@@ -89,7 +89,7 @@ SELECT @@session.net_read_timeout;
1
SET @@session.net_read_timeout = -2;
Warnings:
Warning 1292 Truncated incorrect net_read_timeout value: '0'
Warning 1292 Truncated incorrect net_read_timeout value: '-2'
SELECT @@session.net_read_timeout;
@@session.net_read_timeout
1
......
......@@ -61,7 +61,7 @@ SELECT @@global.net_write_timeout;
1
SET @@global.net_write_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect net_write_timeout value: '0'
Warning 1292 Truncated incorrect net_write_timeout value: '-1024'
SELECT @@global.net_write_timeout;
@@global.net_write_timeout
1
......@@ -89,7 +89,7 @@ SELECT @@session.net_write_timeout;
1
SET @@session.net_write_timeout = -2;
Warnings:
Warning 1292 Truncated incorrect net_write_timeout value: '0'
Warning 1292 Truncated incorrect net_write_timeout value: '-2'
SELECT @@session.net_write_timeout;
@@session.net_write_timeout
1
......
......@@ -81,6 +81,8 @@ ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@global.optimizer_prune_level = FELSE;
ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@global.optimizer_prune_level = -1024;
Warnings:
Warning 1292 Truncated incorrect optimizer_prune_level value: '-1024'
SELECT @@global.optimizer_prune_level;
@@global.optimizer_prune_level
0
......@@ -107,6 +109,8 @@ ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@session.optimizer_prune_level = 'OFN';
ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@session.optimizer_prune_level = -2;
Warnings:
Warning 1292 Truncated incorrect optimizer_prune_level value: '-2'
SELECT @@session.optimizer_prune_level;
@@session.optimizer_prune_level
0
......
......@@ -72,6 +72,8 @@ SELECT @@global.optimizer_search_depth;
@@global.optimizer_search_depth
63
SET @@global.optimizer_search_depth = -1;
Warnings:
Warning 1292 Truncated incorrect optimizer_search_depth value: '-1'
SELECT @@global.optimizer_search_depth;
@@global.optimizer_search_depth
0
......@@ -98,6 +100,8 @@ SELECT @@session.optimizer_search_depth;
@@session.optimizer_search_depth
63
SET @@session.optimizer_search_depth = -2;
Warnings:
Warning 1292 Truncated incorrect optimizer_search_depth value: '-2'
SELECT @@session.optimizer_search_depth;
@@session.optimizer_search_depth
0
......
......@@ -77,7 +77,7 @@ SELECT @@global.preload_buffer_size;
1024
SET @@global.preload_buffer_size = -1;
Warnings:
Warning 1292 Truncated incorrect preload_buffer_size value: '0'
Warning 1292 Truncated incorrect preload_buffer_size value: '-1'
SELECT @@global.preload_buffer_size;
@@global.preload_buffer_size
1024
......@@ -111,7 +111,7 @@ SELECT @@session.preload_buffer_size;
1024
SET @@session.preload_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect preload_buffer_size value: '0'
Warning 1292 Truncated incorrect preload_buffer_size value: '-2'
SELECT @@session.preload_buffer_size;
@@session.preload_buffer_size
1024
......
......@@ -81,7 +81,7 @@ SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
1
SET @@global.read_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '0'
Warning 1292 Truncated incorrect read_buffer_size value: '-1024'
SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
1
......@@ -109,7 +109,7 @@ SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
1
SET @@session.read_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '0'
Warning 1292 Truncated incorrect read_buffer_size value: '-2'
SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
@@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228
1
......
......@@ -83,7 +83,7 @@ SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 822
1
SET @@global.read_rnd_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '0'
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '-1024'
SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
1
......@@ -111,7 +111,7 @@ SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8
1
SET @@session.read_rnd_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '0'
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '-2'
SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
@@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228
1
......
......@@ -58,13 +58,13 @@ ERROR HY000: Variable 'slave_net_timeout' is a GLOBAL variable and should be set
'#------------------FN_DYNVARS_146_05-----------------------#'
SET @@global.slave_net_timeout = -1;
Warnings:
Warning 1292 Truncated incorrect slave_net_timeout value: '0'
Warning 1292 Truncated incorrect slave_net_timeout value: '-1'
SELECT @@global.slave_net_timeout;
@@global.slave_net_timeout
1
SET @@global.slave_net_timeout = -2147483648;
Warnings:
Warning 1292 Truncated incorrect slave_net_timeout value: '0'
Warning 1292 Truncated incorrect slave_net_timeout value: '-2147483648'
SELECT @@global.slave_net_timeout;
@@global.slave_net_timeout
1
......
......@@ -36,6 +36,8 @@ SELECT @@global.slow_launch_time;
65536
'#--------------------FN_DYNVARS_150_04-------------------------#'
SET @@global.slow_launch_time = -1;
Warnings:
Warning 1292 Truncated incorrect slow_launch_time value: '-1'
SELECT @@global.slow_launch_time;
@@global.slow_launch_time
0
......@@ -57,6 +59,8 @@ SELECT @@global.slow_launch_time;
@@global.slow_launch_time
31536000
SET @@global.slow_launch_time = -1024;
Warnings:
Warning 1292 Truncated incorrect slow_launch_time value: '-1024'
SELECT @@global.slow_launch_time;
@@global.slow_launch_time
0
......
......@@ -45,7 +45,7 @@ SELECT @@global.table_definition_cache;
256
SET @@global.table_definition_cache = -1024;
Warnings:
Warning 1292 Truncated incorrect table_definition_cache value: '0'
Warning 1292 Truncated incorrect table_definition_cache value: '-1024'
SELECT @@global.table_definition_cache;
@@global.table_definition_cache
256
......
......@@ -37,13 +37,13 @@ SELECT @@global.table_lock_wait_timeout ;
'#--------------------FN_DYNVARS_001_04-------------------------#'
SET @@global.table_lock_wait_timeout = -1;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '0'
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '-1'
SET @@global.table_lock_wait_timeout= 100000000000;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '100000000000'
SET @@global.table_lock_wait_timeout= -1024;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '0'
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '-1024'
SET @@global.table_lock_wait_timeout= 0;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '0'
......
......@@ -39,7 +39,7 @@ SELECT @@global.table_open_cache ;
'#--------------------FN_DYNVARS_001_04-------------------------#'
SET @@global.table_open_cache = -1;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0'
Warning 1292 Truncated incorrect table_open_cache value: '-1'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
......@@ -51,7 +51,7 @@ SELECT @@global.table_open_cache ;
524288
SET @@global.table_open_cache = -1024;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0'
Warning 1292 Truncated incorrect table_open_cache value: '-1024'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
......
......@@ -214,4 +214,34 @@ create view v_bug5719 as select * from t2;
--echo
drop table t2, t3;
--echo #
--echo # Bug#39843 DELETE requires write access to table in subquery in where clause
--echo #
--disable_warnings
DROP TABLE IF EXISTS t1,t2;
--enable_warnings
CREATE TABLE t1 (
table1_rowid SMALLINT NOT NULL
);
CREATE TABLE t2 (
table2_rowid SMALLINT NOT NULL
);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
LOCK TABLES t1 WRITE, t2 READ;
--echo # Sub-select should not try to aquire a write lock.
DELETE FROM t1
WHERE EXISTS
(
SELECT 'x'
FROM t2
WHERE t1.table1_rowid = t2.table2_rowid
) ;
--echo # While implementing the patch we didn't break old behavior;
--echo # The following sub-select should still requires a write lock:
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
SELECT * FROM t1 WHERE 1 IN (SELECT * FROM t2 FOR UPDATE);
UNLOCK TABLES;
DROP TABLE t1,t2;
--echo End of 5.1 tests.
......@@ -1496,4 +1496,22 @@ UNLOCK TABLES;
--echo # drop the created tables
DROP TABLE t1, t2, t3;
#
# Bug #41305 server crashes when inserting duplicate row into a merge table
#
--echo # insert duplicate value in child table while merge table doesn't have key
create table t1 (
col1 int(10),
primary key (col1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE m1 (
col1 int(10) NOT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(t1);
insert into m1 (col1) values (1);
--error ER_DUP_ENTRY
insert into m1 (col1) values (1);
drop table m1, t1;
--echo End of 5.1 tests
......@@ -1163,11 +1163,11 @@ set @@sql_mode= @org_mode;
# Bug #13934 Silent truncation of table comments
#
set @@sql_mode='traditional';
--error 1105
--error ER_TOO_LONG_TABLE_COMMENT
create table t1 (i int)
comment '123456789*123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*123456789*';
--error 1105
--error ER_TOO_LONG_FIELD_COMMENT
create table t1 (
i int comment
'123456789*123456789*123456789*123456789*
......
......@@ -1122,9 +1122,45 @@ SET @@session.thread_stack= 7;
SET @@global.thread_stack= 7;
#
#
# Bug #40657 - assertion with out of range variables and traditional sql_mode
#
SELECT @@global.expire_logs_days INTO @old_eld;
SET GLOBAL expire_logs_days = -1;
--echo needs to've been adjusted (0)
SELECT @@global.expire_logs_days;
SET GLOBAL expire_logs_days = 11;
SET @old_mode=@@sql_mode;
SET SESSION sql_mode = 'TRADITIONAL';
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL expire_logs_days = 100;
--echo needs to be unchanged (11)
SELECT @@global.expire_logs_days;
SET SESSION sql_mode = @old_mode;
SET GLOBAL expire_logs_days = 100;
--echo needs to've been adjusted (99)
SELECT @@global.expire_logs_days;
SET GLOBAL expire_logs_days = 11;
SET GLOBAL expire_logs_days = 99;
--echo needs to pass with no warnings (99)
SELECT @@global.expire_logs_days;
# cleanup
SET GLOBAL expire_logs_days = @old_eld;
#
# Bug#41030 Wrong meta data (incorrect fieldlen)
#
--enable_metadata
select @@storage_engine;
--disable_metadata
--echo End of 5.1 tests
......@@ -4650,10 +4650,14 @@ bool flush_error_log()
uchar buf[IO_SIZE];
freopen(err_temp,"a+",stderr);
setbuf(stderr, NULL);
(void) my_delete(err_renamed, MYF(0));
my_rename(log_error_file,err_renamed,MYF(0));
if (freopen(log_error_file,"a+",stdout))
{
freopen(log_error_file,"a+",stderr);
setbuf(stderr, NULL);
}
if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0)
{
......@@ -4669,7 +4673,10 @@ bool flush_error_log()
#else
my_rename(log_error_file,err_renamed,MYF(0));
if (freopen(log_error_file,"a+",stdout))
{
freopen(log_error_file,"a+",stderr);
setbuf(stderr, NULL);
}
else
result= 1;
#endif
......
......@@ -3703,7 +3703,10 @@ static int init_server_components()
#ifndef EMBEDDED_LIBRARY
if (freopen(log_error_file, "a+", stdout))
#endif
{
freopen(log_error_file, "a+", stderr);
setbuf(stderr, NULL);
}
}
}
......@@ -4331,6 +4334,7 @@ we force server id to 2, but this MySQL server will not act as a slave.");
{
freopen(log_error_file,"a+",stdout);
freopen(log_error_file,"a+",stderr);
setbuf(stderr, NULL);
FreeConsole(); // Remove window
}
#endif
......
This diff is collapsed.
......@@ -6169,3 +6169,11 @@ ER_CONFLICT_FN_PARSE_ERROR
eng "Error in parsing conflict function. Message: %-.64s"
ER_EXCEPTIONS_WRITE_ERROR
eng "Write to exceptions table failed. Message: %-.128s""
ER_TOO_LONG_TABLE_COMMENT
eng "Comment for table '%-.64s' is too long (max = %lu)"
por "Comentrio para a tabela '%-.64s' longo demais (max = %lu)"
ER_TOO_LONG_FIELD_COMMENT
eng "Comment for field '%-.64s' is too long (max = %lu)"
por "Comentrio para o campo '%-.64s' longo demais (max = %lu)"
......@@ -418,6 +418,43 @@ TYPELIB query_cache_type_typelib=
array_elements(query_cache_type_names)-1,"", query_cache_type_names, NULL
};
/**
Helper function for determine if a SELECT statement has a SQL_NO_CACHE
directive.
@param sql A pointer to the first white space character after SELECT
@return
@retval TRUE The character string contains SQL_NO_CACHE
@retval FALSE No directive found.
*/
static bool has_no_cache_directive(char *sql)
{
int i=0;
while (sql[i] == ' ')
++i;
if (my_toupper(system_charset_info, sql[i]) == 'S' &&
my_toupper(system_charset_info, sql[i+1]) == 'Q' &&
my_toupper(system_charset_info, sql[i+2]) == 'L' &&
my_toupper(system_charset_info, sql[i+3]) == '_' &&
my_toupper(system_charset_info, sql[i+4]) == 'N' &&
my_toupper(system_charset_info, sql[i+5]) == 'O' &&
my_toupper(system_charset_info, sql[i+6]) == '_' &&
my_toupper(system_charset_info, sql[i+7]) == 'C' &&
my_toupper(system_charset_info, sql[i+8]) == 'A' &&
my_toupper(system_charset_info, sql[i+9]) == 'C' &&
my_toupper(system_charset_info, sql[i+10]) == 'H' &&
my_toupper(system_charset_info, sql[i+11]) == 'E' &&
my_toupper(system_charset_info, sql[i+12]) == ' ')
return TRUE;
return FALSE;
}
/*****************************************************************************
Query_cache_block_table method(s)
*****************************************************************************/
......@@ -1233,6 +1270,16 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
DBUG_PRINT("qcache", ("The statement is not a SELECT; Not cached"));
goto err;
}
if (query_length > 20 && has_no_cache_directive(&sql[i+6]))
{
/*
We do not increase 'refused' statistics here since it will be done
later when the query is parsed.
*/
DBUG_PRINT("qcache", ("The statement has a SQL_NO_CACHE directive"));
goto err;
}
}
STRUCT_LOCK(&structure_guard_mutex);
......
......@@ -1559,6 +1559,7 @@ void st_select_lex::init_query()
exclude_from_table_unique_test= no_wrap_view_item= FALSE;
nest_level= 0;
link_next= 0;
lock_option= TL_READ_DEFAULT;
}
void st_select_lex::init_select()
......
......@@ -688,6 +688,15 @@ class st_select_lex: public st_select_lex_node
int cur_pos_in_select_list;
List<udf_func> udf_list; /* udf function calls stack */
/**
Per sub-query locking strategy.
Note: This variable might interfer with the corresponding statement-level
variable Lex::lock_option because on how different parser rules depend
on eachother.
*/
thr_lock_type lock_option;
/*
This is a copy of the original JOIN USING list that comes from
the parser. The parser :
......
......@@ -5580,6 +5580,14 @@ void mysql_reset_thd_for_next_command(THD *thd)
}
/**
Resets the lex->current_select object.
@note It is assumed that lex->current_select != NULL
This function is a wrapper around select_lex->init_select() with an added
check for the special situation when using INTO OUTFILE and LOAD DATA.
*/
void
mysql_init_select(LEX *lex)
{
......@@ -5594,6 +5602,18 @@ mysql_init_select(LEX *lex)
}
/**
Used to allocate a new SELECT_LEX object on the current thd mem_root and
link it into the relevant lists.
This function is always followed by mysql_init_select.
@see mysql_init_select
@retval TRUE An error occurred
@retval FALSE The new SELECT_LEX was successfully allocated.
*/
bool
mysql_new_select(LEX *lex, bool move_down)
{
......@@ -6411,7 +6431,6 @@ void st_select_lex::set_lock_for_tables(thr_lock_type lock_type)
DBUG_ENTER("set_lock_for_tables");
DBUG_PRINT("enter", ("lock_type: %d for_update: %d", lock_type,
for_update));
for (TABLE_LIST *tables= (TABLE_LIST*) table_list.first;
tables;
tables= tables->next_local)
......
......@@ -6489,7 +6489,8 @@ select_option:
{
if (check_simple_select())
MYSQL_YYABORT;
Lex->lock_option= TL_READ_HIGH_PRIORITY;
Lex->lock_option= TL_READ_HIGH_PRIORITY;
Lex->current_select->lock_option= TL_READ_HIGH_PRIORITY;
}
| DISTINCT { Select->options|= SELECT_DISTINCT; }
| SQL_SMALL_RESULT { Select->options|= SELECT_SMALL_RESULT; }
......@@ -6535,6 +6536,7 @@ select_lock_type:
{
LEX *lex=Lex;
lex->current_select->set_lock_for_tables(TL_WRITE);
lex->current_select->lock_option= TL_WRITE;
lex->safe_to_cache_query=0;
}
| LOCK_SYM IN_SYM SHARE_SYM MODE_SYM
......@@ -6542,6 +6544,7 @@ select_lock_type:
LEX *lex=Lex;
lex->current_select->
set_lock_for_tables(TL_READ_WITH_SHARED_LOCKS);
lex->current_select->lock_option= TL_READ_WITH_SHARED_LOCKS;
lex->safe_to_cache_query=0;
}
;
......@@ -12909,6 +12912,18 @@ subselect_start:
subselect_end:
{
LEX *lex=Lex;
/*
Set the required lock level for the tables associated with the
current sub-select. This will overwrite previous lock options set
using st_select_lex::add_table_to_list in any of the following
rules: single_multi, table_wild_one, load_data, table_alias_ref,
table_factor.
The default lock level is TL_READ_DEFAULT but it can be modified
with query options specific for a certain (sub-)SELECT.
*/
lex->current_select->
set_lock_for_tables(lex->current_select->lock_option);
lex->pop_context();
SELECT_LEX *child= lex->current_select;
lex->current_select = lex->current_select->return_after_parsing();
......
......@@ -229,16 +229,16 @@ bool mysql_create_frm(THD *thd, const char *file_name,
create_info->comment.length, 60);
if (tmp_len < create_info->comment.length)
{
(void) my_snprintf(buff, sizeof(buff), "Too long comment for table '%s'",
table);
if ((thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
my_message(ER_UNKNOWN_ERROR, buff, MYF(0));
my_error(ER_TOO_LONG_TABLE_COMMENT, MYF(0), table, tmp_len);
goto err;
}
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR), buff);
ER_TOO_LONG_TABLE_COMMENT,
ER(ER_TOO_LONG_TABLE_COMMENT),
table, tmp_len);
create_info->comment.length= tmp_len;
}
......@@ -613,17 +613,16 @@ static bool pack_header(uchar *forminfo, enum legacy_db_type table_type,
255);
if (tmp_len < field->comment.length)
{
char buff[128];
(void) my_snprintf(buff,sizeof(buff), "Too long comment for field '%s'",
field->field_name);
if ((current_thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
my_message(ER_UNKNOWN_ERROR, buff, MYF(0));
my_error(ER_TOO_LONG_FIELD_COMMENT, MYF(0), field->field_name, tmp_len);
DBUG_RETURN(1);
}
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR), buff);
ER_TOO_LONG_FIELD_COMMENT,
ER(ER_TOO_LONG_FIELD_COMMENT),
field->field_name, tmp_len);
field->comment.length= tmp_len;
}
......
......@@ -872,6 +872,16 @@ int ha_myisammrg::info(uint flag)
table->s->crashed= 1;
#endif
stats.data_file_length= mrg_info.data_file_length;
if (mrg_info.errkey >= table_share->keys)
{
/*
If value of errkey is higher than the number of keys
on the table set errkey to MAX_KEY. This will be
treated as unknown key case and error message generator
won't try to locate key causing segmentation fault.
*/
mrg_info.errkey= MAX_KEY;
}
errkey= mrg_info.errkey;
table->s->keys_in_use.set_prefix(table->s->keys);
stats.mean_rec_length= mrg_info.reclength;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment