mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/mysql-5.0-bg11081
This commit is contained in:
@ -1056,3 +1056,104 @@ a b
|
||||
1 9
|
||||
3 7
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
create table t2 like t1;
|
||||
create table t3 like t2;
|
||||
prepare stmt from "repair table t1";
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
prepare stmt from "optimize table t1";
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status Table is already up to date
|
||||
prepare stmt from "analyze table t1";
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Table is already up to date
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Table is already up to date
|
||||
prepare stmt from "repair table t1, t2, t3";
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
test.t2 repair status OK
|
||||
test.t3 repair status OK
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
test.t2 repair status OK
|
||||
test.t3 repair status OK
|
||||
prepare stmt from "optimize table t1, t2, t3";
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
test.t2 optimize status OK
|
||||
test.t3 optimize status OK
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status Table is already up to date
|
||||
test.t2 optimize status Table is already up to date
|
||||
test.t3 optimize status Table is already up to date
|
||||
prepare stmt from "analyze table t1, t2, t3";
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Table is already up to date
|
||||
test.t2 analyze status Table is already up to date
|
||||
test.t3 analyze status Table is already up to date
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Table is already up to date
|
||||
test.t2 analyze status Table is already up to date
|
||||
test.t3 analyze status Table is already up to date
|
||||
prepare stmt from "repair table t1, t4, t3";
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
test.t4 repair error Table 'test.t4' doesn't exist
|
||||
test.t3 repair status OK
|
||||
Warnings:
|
||||
Error 1146 Table 'test.t4' doesn't exist
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
test.t4 repair error Table 'test.t4' doesn't exist
|
||||
test.t3 repair status OK
|
||||
Warnings:
|
||||
Error 1146 Table 'test.t4' doesn't exist
|
||||
prepare stmt from "optimize table t1, t3, t4";
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
test.t3 optimize status OK
|
||||
test.t4 optimize error Table 'test.t4' doesn't exist
|
||||
Warnings:
|
||||
Error 1146 Table 'test.t4' doesn't exist
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status Table is already up to date
|
||||
test.t3 optimize status Table is already up to date
|
||||
test.t4 optimize error Table 'test.t4' doesn't exist
|
||||
Warnings:
|
||||
Error 1146 Table 'test.t4' doesn't exist
|
||||
prepare stmt from "analyze table t4, t1";
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t4 analyze error Table 'test.t4' doesn't exist
|
||||
test.t1 analyze status Table is already up to date
|
||||
Warnings:
|
||||
Error 1146 Table 'test.t4' doesn't exist
|
||||
execute stmt;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t4 analyze error Table 'test.t4' doesn't exist
|
||||
test.t1 analyze status Table is already up to date
|
||||
Warnings:
|
||||
Error 1146 Table 'test.t4' doesn't exist
|
||||
deallocate prepare stmt;
|
||||
|
@ -422,13 +422,10 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye
|
||||
prepare stmt1 from ' select * into outfile ''data.txt'' from t1 ';
|
||||
execute stmt1 ;
|
||||
prepare stmt1 from ' optimize table t1 ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' analyze table t1 ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' checksum table t1 ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' repair table t1 ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' handler t1 open ';
|
||||
|
@ -286,12 +286,12 @@ id stmt_text status
|
||||
1 select 1 supported
|
||||
2 flush tables not supported
|
||||
3 handler t1 open as ha not supported
|
||||
4 analyze table t1 not supported
|
||||
4 analyze table t1 supported
|
||||
5 check table t1 not supported
|
||||
6 checksum table t1 not supported
|
||||
7 check table t1 not supported
|
||||
8 optimize table t1 not supported
|
||||
9 repair table t1 not supported
|
||||
8 optimize table t1 supported
|
||||
9 repair table t1 supported
|
||||
10 describe extended select * from t1 supported
|
||||
11 help help not supported
|
||||
12 show databases supported
|
||||
|
@ -1,4 +1,5 @@
|
||||
drop table if exists t1, t2;
|
||||
drop function if exists f1;
|
||||
create table t1 (ts timestamp);
|
||||
set time_zone='+00:00';
|
||||
select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp());
|
||||
@ -268,3 +269,17 @@ select * from t1;
|
||||
convert_tz(NULL, NULL, NULL)
|
||||
NULL
|
||||
drop table t1;
|
||||
create table t1 (ldt datetime, udt datetime);
|
||||
create function f1(i datetime) returns datetime
|
||||
return convert_tz(i, 'UTC', 'Europe/Moscow');
|
||||
create trigger t1_bi before insert on t1 for each row
|
||||
set new.udt:= convert_tz(new.ldt, 'Europe/Moscow', 'UTC');
|
||||
insert into t1 (ldt) values ('2006-04-19 16:30:00');
|
||||
select * from t1;
|
||||
ldt udt
|
||||
2006-04-19 16:30:00 2006-04-19 12:30:00
|
||||
select ldt, f1(udt) as ldt2 from t1;
|
||||
ldt ldt2
|
||||
2006-04-19 16:30:00 2006-04-19 16:30:00
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
|
@ -1110,4 +1110,40 @@ select * from t1 order by 1+1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#19308 "REPAIR/OPTIMIZE/ANALYZE supported in SP but not in PS".
|
||||
# Add test coverage for the added commands.
|
||||
#
|
||||
create table t1 (a int);
|
||||
create table t2 like t1;
|
||||
create table t3 like t2;
|
||||
prepare stmt from "repair table t1";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
prepare stmt from "optimize table t1";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
prepare stmt from "analyze table t1";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
prepare stmt from "repair table t1, t2, t3";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
prepare stmt from "optimize table t1, t2, t3";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
prepare stmt from "analyze table t1, t2, t3";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
prepare stmt from "repair table t1, t4, t3";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
prepare stmt from "optimize table t1, t3, t4";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
prepare stmt from "analyze table t4, t1";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
# End of 5.0 tests
|
||||
|
@ -453,13 +453,10 @@ into table t1 fields terminated by ''\t'' ';
|
||||
prepare stmt1 from ' select * into outfile ''data.txt'' from t1 ';
|
||||
execute stmt1 ;
|
||||
##
|
||||
--error 1295
|
||||
prepare stmt1 from ' optimize table t1 ' ;
|
||||
--error 1295
|
||||
prepare stmt1 from ' analyze table t1 ' ;
|
||||
--error 1295
|
||||
prepare stmt1 from ' checksum table t1 ' ;
|
||||
--error 1295
|
||||
prepare stmt1 from ' repair table t1 ' ;
|
||||
--error 1295
|
||||
prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;
|
||||
|
@ -3,6 +3,7 @@
|
||||
# Preparing playground
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
drop function if exists f1;
|
||||
--enable_warnings
|
||||
|
||||
|
||||
@ -222,3 +223,22 @@ select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
# Test for bug #11081 "Using a CONVERT_TZ function in a stored function
|
||||
# or trigger fails".
|
||||
#
|
||||
create table t1 (ldt datetime, udt datetime);
|
||||
create function f1(i datetime) returns datetime
|
||||
return convert_tz(i, 'UTC', 'Europe/Moscow');
|
||||
create trigger t1_bi before insert on t1 for each row
|
||||
set new.udt:= convert_tz(new.ldt, 'Europe/Moscow', 'UTC');
|
||||
# This should work without errors
|
||||
insert into t1 (ldt) values ('2006-04-19 16:30:00');
|
||||
select * from t1;
|
||||
# This should work without errors as well
|
||||
select ldt, f1(udt) as ldt2 from t1;
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
|
||||
# End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user