Commit 435f54fc authored by Georgi Kodinov's avatar Georgi Kodinov
Browse files

merged 5.1-5.1.29-rc -> 5.1-bugteam

parents 749f8b3e f87973fe
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2396,8 +2396,15 @@ static uint get_table_structure(char *table, char *db, char *table_type,
            fprintf(sql_file, ",\n  %s %s",
                    quote_name(row[0], name_buff, 0), row[1]);
          }

          /*
            Stand-in tables are always MyISAM tables as the default
            engine might have a column-limit that's lower than the
            number of columns in the view, and MyISAM support is
            guaranteed to be in the server anyway.
          */
          fprintf(sql_file,
                  "\n) */;\n"
                  "\n) ENGINE=MyISAM */;\n"
                  "SET character_set_client = @saved_cs_client;\n");

          check_io(sql_file);
+8 −0
Original line number Diff line number Diff line
@@ -29,6 +29,14 @@ extern ulong locks_immediate,locks_waited ;

enum thr_lock_type { TL_IGNORE=-1,
		     TL_UNLOCK,			/* UNLOCK ANY LOCK */
                     /*
                       Parser only! At open_tables() becomes TL_READ or
                       TL_READ_NO_INSERT depending on the binary log format
                       (SBR/RBR) and on the table category (log table).
                       Used for tables that are read by statements which
                       modify tables.
                     */
                     TL_READ_DEFAULT,
		     TL_READ,			/* Read lock */
		     TL_READ_WITH_SHARED_LOCKS,
		     /* High prior. than TL_WRITE. Allow concurrent insert */
+5 −0
Original line number Diff line number Diff line
@@ -90,4 +90,9 @@ Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note	1276	Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note	1003	select `test`.`t2`.`a` AS `a`,(select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`a`) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat('0',`test`.`t2`.`a`,'01')))) AS `x` from `test`.`t2` order by `test`.`t2`.`a`
DROP TABLE t1,t2;
CREATE TABLE t1 (a TIMESTAMP);
INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
a
DROP TABLE t1;
End of 5.0 tests
+77 −0
Original line number Diff line number Diff line
@@ -328,4 +328,81 @@ create event
очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66
on schedule every 2 year do select 1;
ERROR 42000: Identifier name 'очень_очень_очень_очень_очень_очень_очень_очень_длинна' is too long
create event event_35981 on schedule every 6 month on completion preserve
disable
do
select 1;
The following SELECTs should all give 1
select  count(*) from information_schema.events
where   event_schema = database() and event_name = 'event_35981' and
on_completion = 'PRESERVE';
count(*)
1
alter   event event_35981 enable;
select  count(*) from information_schema.events
where   event_schema = database() and event_name = 'event_35981' and
on_completion = 'PRESERVE';
count(*)
1
alter   event event_35981 on completion not preserve;
select  count(*) from information_schema.events
where   event_schema = database() and event_name = 'event_35981' and
on_completion = 'NOT PRESERVE';
count(*)
1
alter   event event_35981 disable;
select  count(*) from information_schema.events
where   event_schema = database() and event_name = 'event_35981' and
on_completion = 'NOT PRESERVE';
count(*)
1
alter   event event_35981 on completion preserve;
select  count(*) from information_schema.events
where   event_schema = database() and event_name = 'event_35981' and
on_completion = 'PRESERVE';
count(*)
1
drop event event_35981;
create event event_35981 on schedule every 6 month disable
do
select 1;
select  count(*) from information_schema.events
where   event_schema = database() and event_name = 'event_35981' and
on_completion = 'NOT PRESERVE';
count(*)
1
drop event event_35981;
create event event_35981 on schedule every 1 hour starts current_timestamp
on completion not preserve
do
select 1;
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
  ends '1999-01-02 00:00:00';
ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
drop event event_35981;
create event event_35981 on schedule every 1 hour starts current_timestamp
on completion not preserve
do
select 1;
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
  ends '1999-01-02 00:00:00' on completion preserve;
Warnings:
Note	1544	Event execution time is in the past. Event has been disabled
drop event event_35981;
create event event_35981 on schedule every 1 hour starts current_timestamp
on completion preserve
do
select 1;
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
  ends '1999-01-02 00:00:00';
Warnings:
Note	1544	Event execution time is in the past. Event has been disabled
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
  ends '1999-01-02 00:00:00' on completion not preserve;
ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
  ends '1999-01-02 00:00:00' on completion preserve;
Warnings:
Note	1544	Event execution time is in the past. Event has been disabled
drop event event_35981;
drop database events_test;
+29 −0
Original line number Diff line number Diff line
@@ -832,6 +832,35 @@ Execute select '000 001 002 003 004 005 006 007 008 009010 011 012 013 014 015 0
Query	set global general_log = off
deallocate prepare long_query;
set global general_log = @old_general_log_state;
DROP TABLE IF EXISTS log_count;
DROP TABLE IF EXISTS slow_log_copy;
DROP TABLE IF EXISTS general_log_copy;
CREATE TABLE log_count (count BIGINT(21));
SET @old_general_log_state = @@global.general_log;
SET @old_slow_log_state = @@global.slow_query_log;
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
CREATE TABLE slow_log_copy SELECT * FROM mysql.slow_log;
INSERT INTO slow_log_copy SELECT * FROM mysql.slow_log;
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.slow_log));
DROP TABLE slow_log_copy;
CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
DROP TABLE general_log_copy;
SET GLOBAL general_log = OFF;
SET GLOBAL slow_query_log = OFF;
CREATE TABLE slow_log_copy SELECT * FROM mysql.slow_log;
INSERT INTO slow_log_copy SELECT * FROM mysql.slow_log;
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.slow_log));
DROP TABLE slow_log_copy;
CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
DROP TABLE general_log_copy;
SET GLOBAL general_log = @old_general_log_state;
SET GLOBAL slow_query_log = @old_slow_log_state;
DROP TABLE log_count;
SET @old_slow_log_state = @@global.slow_query_log;
SET SESSION long_query_time = 0;
SET GLOBAL slow_query_log = ON;
Loading