3664 Joerg Bruehe 2011-12-20 [merge]
Mergethe build tree of 5.6. back into main "trunk".
Both main and the build clone had received major changes in parallel,
this resulted in
Text conflict in mysql-test/r/type_temporal_fractional.result
Text conflict in mysql-test/t/type_temporal_fractional.test
Text conflict in storage/innobase/handler/ha_innodb.cc
Text conflict in storage/innobase/handler/ha_innodb.h
Text conflict in storage/innobase/handler/handler0alter.cc
modified:
mysql-test/r/type_temporal_fractional.result
mysql-test/suite/innodb/r/innodb_buffer_pool_load.result
mysql-test/suite/innodb/t/innodb_buffer_pool_load.test
mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result
mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result
mysql-test/suite/sys_vars/t/innodb_adaptive_max_sleep_delay_basic.test
mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test
mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test
mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
mysql-test/t/type_temporal_fractional.test
sql/field.h
sql/item.h
sql/item_func.cc
sql/item_sum.cc
sql/item_sum.h
sql/item_timefunc.h
sql/rpl_info_factory.cc
3663 Mattias Jonsson 2011-12-19
Post push fix for bug#13357766.
Too agressiv to set table->m_needs_reopen
in beginning of mysql_admin_table.
Changed to only set it on failure.
Also a miss in truncate_partition,
failure was incorrectly logged to binlog.
modified:
sql/ha_partition.cc
sql/sql_admin.cc
=== modified file 'mysql-test/r/type_temporal_fractional.result'
--- a/mysql-test/r/type_temporal_fractional.result 2011-12-16 16:57:46 +0000
+++ b/mysql-test/r/type_temporal_fractional.result 2011-12-20 09:45:15 +0000
@@ -16984,3 +16984,40 @@ SEC_TO_TIME(-3200399.000001)
-838:59:59.000000
Warnings:
Warning 1292 Truncated incorrect time value: '-3200399.000001'
+#
+# BUG#13451866 - DIFFERENCE IN RESULTS WHEN USING
+# EXTRACT( MINUTE_MICROSECOND )
+#
+CREATE TABLE t1 (a DATETIME(6) DEFAULT NULL);
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00.000000');
+SELECT * FROM t1;
+a
+0000-00-00 00:00:00.000000
+SELECT EXTRACT(MINUTE_MICROSECOND FROM a) FROM t1;
+EXTRACT(MINUTE_MICROSECOND FROM a)
+0
+SELECT EXTRACT(MINUTE_MICROSECOND FROM '0000-00-00 00:00:00.000000');
+EXTRACT(MINUTE_MICROSECOND FROM '0000-00-00 00:00:00.000000')
+0
+DROP TABLE t1;
+#
+# BUG#13436875 - ASSERTION '!ARGS[0]->IS_TEMPORAL() ||
+# !ARGS[1]->IS_TEMPORAL()'
+#
+CREATE TABLE t1 (a DATETIME NOT NULL);
+SELECT 1 FROM t1 WHERE GREATEST(a, a) / a;
+1
+SELECT 1 FROM t1 WHERE LEAST(a, a) / a;
+1
+SELECT 1 FROM t1 WHERE COALESCE(a, a) / a;
+1
+SELECT 1 FROM t1 WHERE IF(0, a, a) / a;
+1
+SELECT 1 FROM t1 WHERE IFNULL(a, a) / a;
+1
+SELECT 1 FROM t1 WHERE CASE WHEN 0 then a ELSE a END / a;
+1
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1) / a;
+1
+DROP TABLE t1;
+# End of 5.6 tests
=== modified file 'mysql-test/suite/innodb/r/innodb_buffer_pool_load.result'
--- a/mysql-test/suite/innodb/r/innodb_buffer_pool_load.result 2011-11-20 21:00:25 +0000
+++ b/mysql-test/suite/innodb/r/innodb_buffer_pool_load.result 2011-12-08 09:14:27 +0000
@@ -16,7 +16,7 @@ count(*)
SET GLOBAL innodb_buffer_pool_load_now = ON;
SELECT variable_value
FROM information_schema.global_status
-WHERE variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
variable_value
Buffer pool(s) load completed at TIMESTAMP_NOW
SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
=== modified file 'mysql-test/suite/innodb/t/innodb_buffer_pool_load.test'
--- a/mysql-test/suite/innodb/t/innodb_buffer_pool_load.test 2011-11-20 21:00:25 +0000
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_load.test 2011-12-08 09:14:27 +0000
@@ -47,7 +47,7 @@ SET GLOBAL innodb_buffer_pool_dump_now =
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
- WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc
# Confirm the file has been created
@@ -76,14 +76,14 @@ SET GLOBAL innodb_buffer_pool_load_now =
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at '
FROM information_schema.global_status
- WHERE variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
-- source include/wait_condition.inc
# Show the status, interesting if the above timed out
-- replace_regex /[0-9]{6}[[:space:]]+[0-9]{1,2}:[0-9]{2}:[0-9]{2}/TIMESTAMP_NOW/
SELECT variable_value
FROM information_schema.global_status
-WHERE variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
# Accept 329 for 16k page size, 662 for 8k page size & 1392 for 4k page size
-- replace_result 329 {checked_valid} 662 {checked_valid} 1392 {checked_valid}
@@ -107,7 +107,7 @@ SET GLOBAL innodb_buffer_pool_load_now =
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 13) = 'Error parsing'
FROM information_schema.global_status
- WHERE variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
-- source include/wait_condition.inc
DROP TABLE ib_bp_test;
=== modified file 'mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result 2011-11-17 00:20:31 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result 2011-12-08 09:14:27 +0000
@@ -4,7 +4,7 @@ SELECT @orig;
ib_buffer_pool
SELECT variable_value
FROM information_schema.global_status
-WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
variable_value
not started
SET GLOBAL innodb_buffer_pool_filename = 'innodb_foobar_dump';
=== modified file 'mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result 2011-11-17 00:20:31 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result 2011-12-08 09:14:27 +0000
@@ -6,6 +6,6 @@ SET GLOBAL innodb_buffer_pool_dump_now =
SET GLOBAL innodb_buffer_pool_load_now = ON;
SELECT variable_value
FROM information_schema.global_status
-WHERE variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
variable_value
Buffer pool(s) load completed at TIMESTAMP_NOW
=== modified file 'mysql-test/suite/sys_vars/t/innodb_adaptive_max_sleep_delay_basic.test'
--- a/mysql-test/suite/sys_vars/t/innodb_adaptive_max_sleep_delay_basic.test 2011-08-19 06:13:33 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_adaptive_max_sleep_delay_basic.test 2011-12-08 09:14:27 +0000
@@ -20,8 +20,8 @@
--source include/have_innodb.inc
# Check if builtins are enabled
-if (`SELECT VARIABLE_VALUE='OFF' FROM INFORMATION_SCHEMA.GLOBAL_STATUS
- WHERE variable_name = 'INNODB_HAVE_ATOMIC_BUILTINS'`) {
+if (`SELECT LOWER(VARIABLE_VALUE)='off' FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+ WHERE LOWER(variable_name) = 'innodb_have_atomic_builtins'`) {
--skip Test requires InnoDB atomic builtins
}
=== modified file 'mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test'
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test 2011-11-17 00:20:31 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test 2011-12-08 09:14:27 +0000
@@ -17,7 +17,7 @@ SELECT @@global.innodb_buffer_pool_dump_
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
- WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc
# Confirm that the dump file has been created
=== modified file 'mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test'
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test 2011-11-17 00:20:31 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test 2011-12-08 09:14:27 +0000
@@ -15,7 +15,7 @@ SELECT @orig;
# dump actually being complete and file_exists may fail.
SELECT variable_value
FROM information_schema.global_status
-WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
# Try with a non-default filename
@@ -28,7 +28,7 @@ SET GLOBAL innodb_buffer_pool_dump_now =
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
- WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc
-- file_exists $file
=== modified file 'mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test'
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test 2011-11-17 00:20:31 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test 2011-12-08 09:14:27 +0000
@@ -15,7 +15,7 @@ SET GLOBAL innodb_buffer_pool_dump_now =
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
- WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc
# Confirm the file is really created
@@ -29,11 +29,11 @@ SET GLOBAL innodb_buffer_pool_load_now =
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at '
FROM information_schema.global_status
- WHERE variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
-- source include/wait_condition.inc
# Show the status, interesting if the above timed out
-- replace_regex /[0-9]{6}[[:space:]]+[0-9]{1,2}:[0-9]{2}:[0-9]{2}/TIMESTAMP_NOW/
SELECT variable_value
FROM information_schema.global_status
-WHERE variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
=== modified file 'mysql-test/t/type_temporal_fractional.test'
--- a/mysql-test/t/type_temporal_fractional.test 2011-12-16 16:57:46 +0000
+++ b/mysql-test/t/type_temporal_fractional.test 2011-12-20 09:45:15 +0000
@@ -7488,3 +7488,33 @@ SELECT SEC_TO_TIME(3200399.999999);
SELECT SEC_TO_TIME(3200399.000001);
SELECT SEC_TO_TIME(-3200399.999999);
SELECT SEC_TO_TIME(-3200399.000001);
+
+
+--echo #
+--echo # BUG#13451866 - DIFFERENCE IN RESULTS WHEN USING
+--echo # EXTRACT( MINUTE_MICROSECOND )
+--echo #
+CREATE TABLE t1 (a DATETIME(6) DEFAULT NULL);
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00.000000');
+SELECT * FROM t1;
+SELECT EXTRACT(MINUTE_MICROSECOND FROM a) FROM t1;
+SELECT EXTRACT(MINUTE_MICROSECOND FROM '0000-00-00 00:00:00.000000');
+DROP TABLE t1;
+
+
+--echo #
+--echo # BUG#13436875 - ASSERTION '!ARGS[0]->IS_TEMPORAL() ||
+--echo # !ARGS[1]->IS_TEMPORAL()'
+--echo #
+CREATE TABLE t1 (a DATETIME NOT NULL);
+SELECT 1 FROM t1 WHERE GREATEST(a, a) / a;
+SELECT 1 FROM t1 WHERE LEAST(a, a) / a;
+SELECT 1 FROM t1 WHERE COALESCE(a, a) / a;
+SELECT 1 FROM t1 WHERE IF(0, a, a) / a;
+SELECT 1 FROM t1 WHERE IFNULL(a, a) / a;
+SELECT 1 FROM t1 WHERE CASE WHEN 0 then a ELSE a END / a;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1) / a;
+DROP TABLE t1;
+
+
+--echo # End of 5.6 tests
=== modified file 'sql/field.h'
--- a/sql/field.h 2011-12-15 12:12:14 +0000
+++ b/sql/field.h 2011-12-20 09:45:15 +0000
@@ -1171,6 +1171,10 @@ public:
uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg, const CHARSET_INFO *charset);
Item_result result_type () const { return STRING_RESULT; }
+ Item_result numeric_context_result_type() const
+ {
+ return REAL_RESULT;
+ }
uint decimals() const { return NOT_FIXED_DEC; }
void make_field(Send_field *field);
int store(double nr);
@@ -1931,7 +1935,7 @@ public:
virtual uint32 max_display_length() { return field_length; }
virtual bool str_needs_quotes() { return TRUE; }
virtual uint is_equal(Create_field *new_field);
- virtual Item_result numeric_context_result_type() const
+ Item_result numeric_context_result_type() const
{
return dec ? DECIMAL_RESULT : INT_RESULT;
}
@@ -2017,7 +2021,7 @@ public:
longlong val_date_temporal();
bool get_time(MYSQL_TIME *ltime)
{
- return get_date(ltime, 0);
+ return get_date(ltime, TIME_FUZZY_DATE);
}
};
=== modified file 'sql/item.h'
--- a/sql/item.h 2011-11-21 11:58:25 +0000
+++ b/sql/item.h 2011-12-13 18:18:20 +0000
@@ -643,6 +643,10 @@ public:
*/
virtual enum Item_result numeric_context_result_type() const
{
+ if (is_temporal())
+ return decimals ? DECIMAL_RESULT : INT_RESULT;
+ if (result_type() == STRING_RESULT)
+ return REAL_RESULT;
return result_type();
}
virtual Item_result cast_to_int_type() const { return result_type(); }
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc 2011-11-21 11:58:25 +0000
+++ b/sql/item_func.cc 2011-12-13 18:18:20 +0000
@@ -789,9 +789,10 @@ void Item_num_op::find_num_type(void)
DBUG_ASSERT(arg_count == 2);
Item_result r0= args[0]->numeric_context_result_type();
Item_result r1= args[1]->numeric_context_result_type();
+
+ DBUG_ASSERT(r0 != STRING_RESULT && r1 != STRING_RESULT);
- if (r0 == REAL_RESULT || r1 == REAL_RESULT ||
- r0 == STRING_RESULT || r1 ==STRING_RESULT)
+ if (r0 == REAL_RESULT || r1 == REAL_RESULT)
{
/*
Since DATE/TIME/DATETIME data types return INT_RESULT/DECIMAL_RESULT
=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc 2011-12-15 15:15:37 +0000
+++ b/sql/item_sum.cc 2011-12-20 09:45:15 +0000
@@ -1297,7 +1297,6 @@ void Item_sum_sum::fix_length_and_dec()
decimals= args[0]->decimals;
switch (args[0]->numeric_context_result_type()) {
case REAL_RESULT:
- case STRING_RESULT:
hybrid_type= REAL_RESULT;
sum= 0.0;
break;
@@ -1314,6 +1313,7 @@ void Item_sum_sum::fix_length_and_dec()
my_decimal_set_zero(dec_buffs);
break;
}
+ case STRING_RESULT:
case ROW_RESULT:
default:
DBUG_ASSERT(0);
=== modified file 'sql/item_sum.h'
--- a/sql/item_sum.h 2011-11-10 14:58:23 +0000
+++ b/sql/item_sum.h 2011-12-13 18:18:20 +0000
@@ -1051,10 +1051,6 @@ protected:
bool keep_field_type(void) const { return 1; }
enum Item_result result_type () const { return hybrid_type; }
enum enum_field_types field_type() const { return hybrid_field_type; }
- enum Item_result numeric_context_result_type() const
- {
- return args[0]->numeric_context_result_type();
- }
void update_field();
void min_max_update_str_field();
void min_max_update_temporal_field();
=== modified file 'sql/item_timefunc.h'
--- a/sql/item_timefunc.h 2011-11-28 10:08:20 +0000
+++ b/sql/item_timefunc.h 2011-12-13 18:18:20 +0000
@@ -513,11 +513,6 @@ public:
DBUG_ASSERT(fixed);
return decimals;
}
- enum Item_result numeric_context_result_type() const
- {
- DBUG_ASSERT(fixed);
- return decimals ? DECIMAL_RESULT : INT_RESULT;
- }
};
@@ -545,12 +540,6 @@ public:
sql_mode(0)
{ }
enum Item_result result_type () const { return STRING_RESULT; }
- enum Item_result numeric_context_result_type() const
- {
- DBUG_ASSERT(fixed);
- return cached_field_type == MYSQL_TYPE_STRING ? STRING_RESULT :
- decimals ? DECIMAL_RESULT : INT_RESULT;
- }
enum_field_types field_type() const { return cached_field_type; }
const CHARSET_INFO *charset_for_protocol() const
{
=== modified file 'sql/rpl_info_factory.cc'
--- a/sql/rpl_info_factory.cc 2011-10-13 14:01:50 +0000
+++ b/sql/rpl_info_factory.cc 2011-12-13 12:13:37 +0000
@@ -401,7 +401,9 @@ bool Rpl_info_factory::decide_repository
If there is an error, we cannot proceed with the normal operation.
In this case, we just pick the dest repository if check_info() has
not failed to execute against it in order to give users the chance
- to fix the problem and restart the server.
+ to fix the problem and restart the server. One particular case can
+ happen when there is an inplace upgrade: no source table (it did
+ not exist in 5.5) and the default destination is a file.
Notice that migration will not take place and the destination may
be empty.
@@ -411,7 +413,9 @@ bool Rpl_info_factory::decide_repository
sql_print_warning("Error while checking replication metadata. "
"Setting the requested repository in order to "
"give users the chance to fix the problem and "
- "restart the server.");
+ "restart the server. If this is a live upgrade "
+ "please consider using mysql_upgrade to fix the "
+ "problem.");
delete (*handler_src);
*handler_src= NULL;
info->set_rpl_info_handler(*handler_dest);
@@ -421,7 +425,12 @@ bool Rpl_info_factory::decide_repository
}
else
{
- *msg= "Error while checking replication metadata.";
+ *msg= "Error while checking replication metadata. This might also happen "
+ "when doing a live upgrade from a version that did not make use "
+ "of the replication metadata tables. If that was the case, consider "
+ "starting the server with the option --skip-slave-start which "
+ "causes the server to bypass the replication metadata tables check "
+ "while it is starting up";
goto err;
}
}
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (joerg.bruehe:3663 to 3664) | Joerg Bruehe | 21 Dec |