3304 He Zhenxing 2009-05-20 [merge]
Auto merge
M mysql-test/suite/backup/r/backup_external_non_win.result
M scripts/mysql_convert_table_format.sh
3302.1.1 He Zhenxing 2009-05-20 [merge]
Merge in the fix for backup_external_non_win.test
M mysql-test/suite/backup/r/backup_external_non_win.result
M scripts/mysql_convert_table_format.sh
3299.1.4 He Zhenxing 2009-05-20 [merge]
Auto Merge
3299.1.3 He Zhenxing 2009-05-20
Fix for backup test PB failure of backup_external_non_win.test
Fixed the variable name $opt_type to $opt_engine in
scripts/mysql_convert_table_format, and also updates the result
file of the test.
@ mysql-test/suite/backup/r/backup_external_non_win.result
update result file
@ scripts/mysql_convert_table_format.sh
Fix variable name $opt_type to $opt_engine
M mysql-test/suite/backup/r/backup_external_non_win.result
M scripts/mysql_convert_table_format.sh
=== modified file 'mysql-test/r/func_in.result'
--- a/mysql-test/r/func_in.result 2009-05-20 08:27:39 +0000
+++ b/mysql-test/r/func_in.result 2009-05-20 13:33:34 +0000
@@ -587,9 +587,4 @@ SELECT CASE c1 WHEN c1 + 1 THEN 1 END, A
CASE c1 WHEN c1 + 1 THEN 1 END ABS(AVG(c0))
NULL 1.0000
DROP TABLE t1;
-CREATE TABLE t1(a TEXT);
-INSERT INTO t1 VALUES('iynfj');
-SELECT SUM( DISTINCT a ) FROM t1 GROUP BY a HAVING a IN ( AVG( 1 ), 1 + a );
-SUM( DISTINCT a )
-DROP TABLE t1;
End of 5.1 tests
=== modified file 'mysql-test/suite/binlog/r/binlog_stm_ps.result'
--- a/mysql-test/suite/binlog/r/binlog_stm_ps.result 2009-04-03 18:21:57 +0000
+++ b/mysql-test/suite/binlog/r/binlog_stm_ps.result 2009-05-20 10:28:43 +0000
@@ -11,7 +11,7 @@ prepare s from "insert into t1 select 10
set @a=100;
execute s using @a;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table t1 (a int)
=== modified file 'mysql-test/suite/binlog/r/binlog_unsafe.result'
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result 2009-05-07 20:48:24 +0000
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result 2009-05-20 13:33:34 +0000
@@ -10,25 +10,25 @@ INSERT DELAYED INTO t1 VALUES (5);
---- Insert directly ----
INSERT INTO t1 VALUES (@@global.sync_binlog);
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
INSERT INTO t1 VALUES (@@session.insert_id);
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
INSERT INTO t2 SELECT UUID();
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
INSERT INTO t2 VALUES (@@session.sql_mode);
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
INSERT INTO t2 VALUES (@@global.init_slave);
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
INSERT INTO t2 VALUES (@@hostname);
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
---- Insert from stored procedure ----
CREATE PROCEDURE proc()
BEGIN
@@ -42,7 +42,7 @@ INSERT INTO t2 VALUES (@@hostname);
END|
CALL proc();
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
---- Insert from stored function ----
CREATE FUNCTION func()
RETURNS INT
@@ -60,7 +60,7 @@ SELECT func();
func()
0
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
---- Insert from trigger ----
CREATE TRIGGER trig
BEFORE INSERT ON trigger_table
@@ -76,8 +76,8 @@ INSERT INTO t2 VALUES (@@hostname);
END|
INSERT INTO trigger_table VALUES ('bye.');
Warnings:
-Note 1592 Statement is not safe to log in statement format.
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
---- Insert from prepared statement ----
PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)';
PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)';
@@ -88,25 +88,25 @@ PREPARE p6 FROM 'INSERT INTO t2 VALUES (
PREPARE p7 FROM 'INSERT INTO t2 VALUES (@@hostname)';
EXECUTE p1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
EXECUTE p2;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
EXECUTE p3;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
EXECUTE p4;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
EXECUTE p5;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
EXECUTE p6;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
EXECUTE p7;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
---- Insert from nested call of triggers / functions / procedures ----
CREATE PROCEDURE proc1()
INSERT INTO trigger_table VALUES ('ha!')|
@@ -136,7 +136,7 @@ EXECUTE prep6;
func5()
0
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
==== Variables that should *not* be unsafe ====
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
@@ -171,16 +171,16 @@ DROP TABLE t1, t2, t3, trigger_table, tr
CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b));
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
UPDATE t1 SET a=1 LIMIT 1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
DELETE FROM t1 LIMIT 1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
CREATE PROCEDURE p1()
BEGIN
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
@@ -190,7 +190,7 @@ DELETE FROM t1 LIMIT 1;
END|
CALL p1();
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
@@ -198,16 +198,16 @@ CREATE TABLE t1 (a VARCHAR(100), b VARCH
INSERT INTO t1 VALUES ('a','b');
UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
DROP TABLE t1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1(i INT PRIMARY KEY);
CREATE TABLE t2(i INT PRIMARY KEY);
CREATE TABLE t3(i INT, ch CHAR(50));
-"Should issue message Statement is not safe to log in statement format."
+"Should issue message Statement may not be safe to log in statement format."
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
CREATE FUNCTION func6()
RETURNS INT
BEGIN
@@ -216,10 +216,10 @@ INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
RETURN 0;
END|
-"Should issue message Statement is not safe to log in statement format only once"
+"Should issue message Statement may not be safe to log in statement format only once"
INSERT INTO t3 VALUES(func6(), UUID());
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
"Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements"
CREATE FUNCTION fun_check_log_bin() RETURNS INT
BEGIN
@@ -232,7 +232,7 @@ SELECT fun_check_log_bin();
fun_check_log_bin()
100
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
"SQL_LOG_BIN should be ON still"
SHOW VARIABLES LIKE "SQL_LOG_BIN";
Variable_name Value
@@ -288,16 +288,16 @@ CREATE TABLE t1(i INT PRIMARY KEY);
CREATE TABLE t2(i INT PRIMARY KEY);
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
INSERT INTO t1 VALUES(@@global.sync_binlog);
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
UPDATE t1 SET i = 999 LIMIT 1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
DELETE FROM t1 LIMIT 1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
DROP TABLE t1, t2;
SET @@SESSION.SQL_MODE = @save_sql_mode;
"End of tests"
=== modified file 'mysql-test/suite/binlog/t/binlog_unsafe.test'
--- a/mysql-test/suite/binlog/t/binlog_unsafe.test 2009-05-07 20:48:24 +0000
+++ b/mysql-test/suite/binlog/t/binlog_unsafe.test 2009-05-20 13:33:34 +0000
@@ -289,7 +289,7 @@ CREATE TABLE t1(i INT PRIMARY KEY);
CREATE TABLE t2(i INT PRIMARY KEY);
CREATE TABLE t3(i INT, ch CHAR(50));
---echo "Should issue message Statement is not safe to log in statement format."
+--echo "Should issue message Statement may not be safe to log in statement format."
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
DELIMITER |;
@@ -302,7 +302,7 @@ BEGIN
RETURN 0;
END|
DELIMITER ;|
---echo "Should issue message Statement is not safe to log in statement format only once"
+--echo "Should issue message Statement may not be safe to log in statement format only once"
INSERT INTO t3 VALUES(func6(), UUID());
--echo "Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements"
=== modified file 'mysql-test/suite/rpl/r/rpl_stm_loadfile.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result 2009-04-03 18:21:57 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result 2009-05-20 10:28:43 +0000
@@ -10,7 +10,7 @@ CREATE TABLE test.t1 (a INT, blob_column
INSERT INTO test.t1 VALUES(1,'test');
UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
create procedure test.p1()
begin
INSERT INTO test.t1 VALUES(2,'test');
@@ -18,7 +18,7 @@ UPDATE test.t1 SET blob_column=LOAD_FILE
end|
CALL test.p1();
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
SELECT * FROM test.t1 ORDER BY blob_column;
a blob_column
1 abase
=== modified file 'mysql-test/suite/rpl/r/rpl_udf.result'
--- a/mysql-test/suite/rpl/r/rpl_udf.result 2009-04-03 18:32:34 +0000
+++ b/mysql-test/suite/rpl/r/rpl_udf.result 2009-05-20 13:33:34 +0000
@@ -182,19 +182,19 @@ CREATE TABLE t1(sum INT, price FLOAT(24)
affected rows: 0
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
Warnings:
-Note 1592 Statement is not safe to log in statement format.
+Note 1592 Statement may not be safe to log in statement format.
affected rows: 1
SELECT * FROM t1 ORDER BY sum;
sum price
=== modified file 'mysql-test/t/func_in.test'
--- a/mysql-test/t/func_in.test 2009-05-12 13:59:17 +0000
+++ b/mysql-test/t/func_in.test 2009-05-20 11:14:33 +0000
@@ -439,14 +439,4 @@ SELECT CASE c1 WHEN c1 + 1 THEN 1 END, A
DROP TABLE t1;
-#
-# Bug #44399: crash with statement using TEXT columns, aggregates, GROUP BY,
-# and HAVING
-#
-
-CREATE TABLE t1(a TEXT);
-INSERT INTO t1 VALUES('iynfj');
-SELECT SUM( DISTINCT a ) FROM t1 GROUP BY a HAVING a IN ( AVG( 1 ), 1 + a );
-DROP TABLE t1;
-
--echo End of 5.1 tests
=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc 2009-05-20 08:27:39 +0000
+++ b/sql/item_cmpfunc.cc 2009-05-20 13:33:34 +0000
@@ -189,7 +189,6 @@ enum_field_types agg_field_type(Item **i
collect_cmp_types()
items Array of items to collect types from
nitems Number of items in the array
- with_sum_func a sum function is referenced
DESCRIPTION
This function collects different result types for comparison of the first
@@ -200,7 +199,7 @@ enum_field_types agg_field_type(Item **i
Bitmap of collected types - otherwise
*/
-static uint collect_cmp_types(Item **items, uint nitems, my_bool with_sum_func)
+static uint collect_cmp_types(Item **items, uint nitems)
{
uint i;
uint found_types;
@@ -216,16 +215,6 @@ static uint collect_cmp_types(Item **ite
found_types|= 1<< (uint)item_cmp_type(left_result,
items[i]->result_type());
}
- if (with_sum_func || current_thd->lex->current_select->group_list.elements)
- {
- /*
- See TODO commentary in the setup_copy_fields function:
- item in a group may be wrapped with an Item_copy_string item.
- That item has a STRING_RESULT result type, so we need
- to take this type into account.
- */
- found_types |= (1 << item_cmp_type(left_result, STRING_RESULT));
- }
return found_types;
}
@@ -2798,8 +2787,19 @@ void Item_func_case::fix_length_and_dec(
for (nagg= 0; nagg < ncases/2 ; nagg++)
agg[nagg+1]= args[nagg*2];
nagg++;
- if (!(found_types= collect_cmp_types(agg, nagg, with_sum_func)))
+ if (!(found_types= collect_cmp_types(agg, nagg)))
return;
+ if (with_sum_func || current_thd->lex->current_select->group_list.elements)
+ {
+ /*
+ See TODO commentary in the setup_copy_fields function:
+ item in a group may be wrapped with an Item_copy_string item.
+ That item has a STRING_RESULT result type, so we need
+ to take this type into account.
+ */
+ found_types |= (1 << item_cmp_type(left_result_type, STRING_RESULT));
+ }
+
for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
{
if (found_types & (1 << i) && !cmp_items[i])
@@ -3590,7 +3590,7 @@ void Item_func_in::fix_length_and_dec()
uint type_cnt= 0, i;
Item_result cmp_type= STRING_RESULT;
left_result_type= args[0]->result_type();
- if (!(found_types= collect_cmp_types(args, arg_count, with_sum_func)))
+ if (!(found_types= collect_cmp_types(args, arg_count)))
return;
for (arg= args + 1, arg_end= args + arg_count; arg != arg_end ; arg++)
Attachment: [text/bzr-bundle] bzr/zhenxing.he@sun.com-20090520134211-va6md0lgc2t83d5n.bundle
| Thread |
|---|
| • bzr push into mysql-6.0-bugteam branch (zhenxing.he:3304) | He Zhenxing | 20 May |