#At file:///MySQL/REPO/V60/push-6.0/
2669 Joerg Bruehe 2008-06-24 [merge]
Merge from the main tree.
added:
mysql-test/suite/bugs/r/rpl_bug33029.result
mysql-test/suite/bugs/t/rpl_bug33029.test
modified:
client/mysql.cc
mysql-test/r/mysql.result
mysql-test/r/subselect.result
mysql-test/r/subselect_no_mat.result
mysql-test/r/subselect_no_opts.result
mysql-test/r/subselect_no_semijoin.result
mysql-test/suite/rpl/t/disabled.def
mysql-test/t/mysql_delimiter.sql
mysql-test/t/subselect.test
sql/slave.cc
sql/sql_class.cc
sql/sql_select.cc
sql/structs.h
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc 2008-04-01 10:45:05 +0000
+++ b/client/mysql.cc 2008-06-20 19:24:46 +0000
@@ -1848,7 +1848,7 @@ static int read_and_execute(bool interac
the very beginning of a text file when
you save the file using "Unicode UTF-8" format.
*/
- if (!line_number &&
+ if (line && !line_number &&
(uchar) line[0] == 0xEF &&
(uchar) line[1] == 0xBB &&
(uchar) line[2] == 0xBF)
@@ -2128,37 +2128,6 @@ static bool add_line(String &buffer,char
continue;
}
}
- else if (!*ml_comment && !*in_string &&
- (end_of_line - pos) >= 10 &&
- !my_strnncoll(charset_info, (uchar*) pos, 10,
- (const uchar*) "delimiter ", 10))
- {
- // Flush previously accepted characters
- if (out != line)
- {
- buffer.append(line, (uint32) (out - line));
- out= line;
- }
-
- // Flush possible comments in the buffer
- if (!buffer.is_empty())
- {
- if (com_go(&buffer, 0) > 0) // < 0 is not fatal
- DBUG_RETURN(1);
- buffer.length(0);
- }
-
- /*
- Delimiter wants the get rest of the given line as argument to
- allow one to change ';' to ';;' and back
- */
- buffer.append(pos);
- if (com_delimiter(&buffer, pos) > 0)
- DBUG_RETURN(1);
-
- buffer.length(0);
- break;
- }
else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
{
// Found a statement. Continue parsing after the delimiter
=== modified file 'mysql-test/r/mysql.result'
--- a/mysql-test/r/mysql.result 2007-11-27 17:23:39 +0000
+++ b/mysql-test/r/mysql.result 2008-06-20 19:24:46 +0000
@@ -38,6 +38,8 @@ t2
t3
Tables_in_test
t1
+delimiter
+1
_
Test delimiter : from command line
a
=== modified file 'mysql-test/r/subselect.result'
--- a/mysql-test/r/subselect.result 2008-05-22 18:40:15 +0000
+++ b/mysql-test/r/subselect.result 2008-06-20 19:24:46 +0000
@@ -4593,6 +4593,13 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (S
s1
a
DROP TABLE t1;
+CREATE TABLE t1(c int, KEY(c));
+CREATE TABLE t2(a int, b int);
+INSERT INTO t2 VALUES (1, 10), (2, NULL);
+INSERT INTO t1 VALUES (1), (3);
+SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
+a b
+DROP TABLE t1,t2;
CREATE TABLE t1( a INT );
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2( a INT, b INT );
=== modified file 'mysql-test/r/subselect_no_mat.result'
--- a/mysql-test/r/subselect_no_mat.result 2008-05-22 18:40:15 +0000
+++ b/mysql-test/r/subselect_no_mat.result 2008-06-21 09:05:07 +0000
@@ -4597,6 +4597,13 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (S
s1
a
DROP TABLE t1;
+CREATE TABLE t1(c int, KEY(c));
+CREATE TABLE t2(a int, b int);
+INSERT INTO t2 VALUES (1, 10), (2, NULL);
+INSERT INTO t1 VALUES (1), (3);
+SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
+a b
+DROP TABLE t1,t2;
CREATE TABLE t1( a INT );
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2( a INT, b INT );
=== modified file 'mysql-test/r/subselect_no_opts.result'
--- a/mysql-test/r/subselect_no_opts.result 2008-05-22 18:40:15 +0000
+++ b/mysql-test/r/subselect_no_opts.result 2008-06-21 09:05:07 +0000
@@ -4597,6 +4597,13 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (S
s1
a
DROP TABLE t1;
+CREATE TABLE t1(c int, KEY(c));
+CREATE TABLE t2(a int, b int);
+INSERT INTO t2 VALUES (1, 10), (2, NULL);
+INSERT INTO t1 VALUES (1), (3);
+SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
+a b
+DROP TABLE t1,t2;
CREATE TABLE t1( a INT );
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2( a INT, b INT );
=== modified file 'mysql-test/r/subselect_no_semijoin.result'
--- a/mysql-test/r/subselect_no_semijoin.result 2008-05-22 18:40:15 +0000
+++ b/mysql-test/r/subselect_no_semijoin.result 2008-06-21 09:05:07 +0000
@@ -4597,6 +4597,13 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (S
s1
a
DROP TABLE t1;
+CREATE TABLE t1(c int, KEY(c));
+CREATE TABLE t2(a int, b int);
+INSERT INTO t2 VALUES (1, 10), (2, NULL);
+INSERT INTO t1 VALUES (1), (3);
+SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
+a b
+DROP TABLE t1,t2;
CREATE TABLE t1( a INT );
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2( a INT, b INT );
=== added file 'mysql-test/suite/bugs/r/rpl_bug33029.result'
--- a/mysql-test/suite/bugs/r/rpl_bug33029.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/r/rpl_bug33029.result 2008-06-19 18:47:59 +0000
@@ -0,0 +1,15 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table `t1` (`id` int not null auto_increment primary key);
+create trigger `trg` before insert on `t1` for each row begin end;
+set @@global.debug="+d,simulate_bug33029";
+stop slave;
+start slave;
+insert into `t1` values ();
+select * from t1;
+id
+1
=== added file 'mysql-test/suite/bugs/t/rpl_bug33029.test'
--- a/mysql-test/suite/bugs/t/rpl_bug33029.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/t/rpl_bug33029.test 2008-06-19 18:47:59 +0000
@@ -0,0 +1,25 @@
+#
+# Bug #36443 Server crashes when executing insert when insert trigger on table
+#
+# Emulating the former bug#33029 situation to see that there is no crash anymore.
+#
+
+
+source include/master-slave.inc;
+
+create table `t1` (`id` int not null auto_increment primary key);
+create trigger `trg` before insert on `t1` for each row begin end;
+
+sync_slave_with_master;
+set @@global.debug="+d,simulate_bug33029";
+
+stop slave;
+start slave;
+
+connection master;
+
+insert into `t1` values ();
+
+sync_slave_with_master;
+select * from t1;
+
=== modified file 'mysql-test/suite/rpl/t/disabled.def'
--- a/mysql-test/suite/rpl/t/disabled.def 2008-05-19 08:32:08 +0000
+++ b/mysql-test/suite/rpl/t/disabled.def 2008-06-20 19:24:46 +0000
@@ -29,4 +29,4 @@ rpl_log_pos : Bug#8693 Te
rpl_row_basic_7ndb : BUG#33360 2007-12-19 mats rpl_ndb_idempotent fails due to
null field for table on slave side
rpl_redirect : Failure is sporadic and and the test is superfluous (mats)
rpl_innodb_bug28430 : Failure on Solaris Bug #36793
-
+rpl_server_id1 : Bug #36818 rpl_server_id1 fails expecting slave has stopped
(azundris)
=== modified file 'mysql-test/t/mysql_delimiter.sql'
--- a/mysql-test/t/mysql_delimiter.sql 2006-11-22 06:27:06 +0000
+++ b/mysql-test/t/mysql_delimiter.sql 2008-06-20 16:58:14 +0000
@@ -59,3 +59,9 @@ source t/mysql_delimiter_19799.sql
use test//
show tables//
delimiter ; # Reset delimiter
+
+#
+# Bug #33812: mysql client incorrectly parsing DELIMITER
+#
+select a as delimiter from t1
+delimiter ; # Reset delimiter
=== modified file 'mysql-test/t/subselect.test'
--- a/mysql-test/t/subselect.test 2008-05-22 18:40:15 +0000
+++ b/mysql-test/t/subselect.test 2008-06-20 19:24:46 +0000
@@ -3422,6 +3422,19 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (S
DROP TABLE t1;
#
+# Bug #37004: NOT IN subquery with MAX over an empty set
+#
+
+CREATE TABLE t1(c int, KEY(c));
+CREATE TABLE t2(a int, b int);
+INSERT INTO t2 VALUES (1, 10), (2, NULL);
+INSERT INTO t1 VALUES (1), (3);
+
+SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
+
+DROP TABLE t1,t2;
+
+#
# Bug#33204: INTO is allowed in subselect, causing inconsistent results
#
CREATE TABLE t1( a INT );
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc 2008-05-08 16:01:15 +0000
+++ b/sql/slave.cc 2008-06-23 11:55:24 +0000
@@ -4024,6 +4024,7 @@ bool rpl_master_erroneous_autoinc(THD *t
if (active_mi && active_mi->rli.sql_thd == thd)
{
Relay_log_info *rli= &active_mi->rli;
+ DBUG_EXECUTE_IF("simulate_bug33029", return TRUE;);
return rpl_master_has_bug(rli, 33029, FALSE);
}
return FALSE;
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2008-05-21 10:17:29 +0000
+++ b/sql/sql_class.cc 2008-06-23 11:55:24 +0000
@@ -2946,8 +2946,8 @@ void THD::reset_sub_statement_state(Sub_
*/
if (rpl_master_erroneous_autoinc(this))
{
- backup->auto_inc_intervals_forced= auto_inc_intervals_forced;
- auto_inc_intervals_forced.empty();
+ DBUG_ASSERT(backup->auto_inc_intervals_forced.nb_elements() == 0);
+ auto_inc_intervals_forced.swap(&backup->auto_inc_intervals_forced);
}
#endif
@@ -2995,8 +2995,8 @@ void THD::restore_sub_statement_state(Su
*/
if (rpl_master_erroneous_autoinc(this))
{
- auto_inc_intervals_forced= backup->auto_inc_intervals_forced;
- backup->auto_inc_intervals_forced.empty();
+ backup->auto_inc_intervals_forced.swap(&auto_inc_intervals_forced);
+ DBUG_ASSERT(backup->auto_inc_intervals_forced.nb_elements() == 0);
}
#endif
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2008-05-23 05:03:07 +0000
+++ b/sql/sql_select.cc 2008-06-20 19:24:46 +0000
@@ -1479,6 +1479,7 @@ JOIN::optimize()
{
DBUG_PRINT("info",("No matching min/max row"));
zero_result_cause= "No matching min/max row";
+ tables= 0;
error=0;
DBUG_RETURN(0);
}
@@ -1492,6 +1493,7 @@ JOIN::optimize()
{
DBUG_PRINT("info",("No matching min/max row"));
zero_result_cause= "No matching min/max row";
+ tables= 0;
error=0;
DBUG_RETURN(0);
}
=== modified file 'sql/structs.h'
--- a/sql/structs.h 2008-04-01 15:13:57 +0000
+++ b/sql/structs.h 2008-06-23 11:55:24 +0000
@@ -320,31 +320,22 @@ private:
*/
Discrete_interval *current;
uint elements; // number of elements
-
- /* helper function for copy construct and assignment operator */
- void copy_(const Discrete_intervals_list& from)
- {
- for (Discrete_interval *i= from.head; i; i= i->next)
- {
- Discrete_interval j= *i;
- append(&j);
- }
+ void set_members(Discrete_interval *h, Discrete_interval *t,
+ Discrete_interval *c, uint el)
+ {
+ head= h;
+ tail= t;
+ current= c;
+ elements= el;
}
+ void operator=(Discrete_intervals_list &); /* prevent use of these */
+ Discrete_intervals_list(const Discrete_intervals_list &);
+
public:
Discrete_intervals_list() : head(NULL), current(NULL), elements(0) {};
- Discrete_intervals_list(const Discrete_intervals_list& from)
- {
- copy_(from);
- }
- void operator=(const Discrete_intervals_list& from)
- {
- empty();
- copy_(from);
- }
void empty_no_free()
{
- head= current= NULL;
- elements= 0;
+ set_members(NULL, NULL, NULL, 0);
}
void empty()
{
@@ -356,7 +347,24 @@ public:
}
empty_no_free();
}
-
+ void copy_shallow(const Discrete_intervals_list * dli)
+ {
+ head= dli->get_head();
+ tail= dli->get_tail();
+ current= dli->get_current();
+ elements= dli->nb_elements();
+ }
+ void swap (Discrete_intervals_list * dli)
+ {
+ Discrete_interval *h, *t, *c;
+ uint el;
+ h= dli->get_head();
+ t= dli->get_tail();
+ c= dli->get_current();
+ el= dli->nb_elements();
+ dli->copy_shallow(this);
+ set_members(h, t, c, el);
+ }
const Discrete_interval* get_next()
{
Discrete_interval *tmp= current;
@@ -370,4 +378,7 @@ public:
ulonglong minimum() const { return (head ? head->minimum() : 0); };
ulonglong maximum() const { return (head ? tail->maximum() : 0); };
uint nb_elements() const { return elements; }
+ Discrete_interval* get_head() const { return head; };
+ Discrete_interval* get_tail() const { return tail; };
+ Discrete_interval* get_current() const { return current; };
};
| Thread |
|---|
| • bzr commit into mysql-6.0 branch (joerg:2669) | Joerg Bruehe | 24 Jun |