Commit 497eb43b authored by Kristofer Pettersson's avatar Kristofer Pettersson

auto merge

parents 7c49ff02 67834221
......@@ -1779,7 +1779,7 @@ static int read_and_execute(bool interactive)
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)
......@@ -2081,37 +2081,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
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
......@@ -2156,7 +2125,14 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
else if (!*ml_comment && (!*in_string && (inchar == '#' ||
inchar == '-' && pos[1] == '-' &&
my_isspace(charset_info,pos[2]))))
/*
The third byte is either whitespace or is the
end of the line -- which would occur only
because of the user sending newline -- which is
itself whitespace and should also match.
*/
(my_isspace(charset_info,pos[2]) ||
!pos[2]))))
{
// Flush previously accepted characters
if (out != line)
......
......@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
# remember to also change ndb version below and update version.c in ndb
AM_INIT_AUTOMAKE(mysql, 5.0.66)
AM_INIT_AUTOMAKE(mysql, 5.0.68)
AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10
......@@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
# ndb version
NDB_VERSION_MAJOR=5
NDB_VERSION_MINOR=0
NDB_VERSION_BUILD=66
NDB_VERSION_BUILD=68
NDB_VERSION_STATUS=""
# Set all version vars based on $VERSION. How do we do this more elegant ?
......
--require r/have_archive.require
--disable_query_log
show variables like "have_archive";
show variables like 'have_archive';
--enable_query_log
-- require r/have_bdb.require
disable_query_log;
show variables like "have_bdb";
show variables like 'have_bdb';
enable_query_log;
-- require r/have_big5.require
disable_query_log;
show collation like "big5_chinese_ci";
show collation like 'big5_chinese_ci';
enable_query_log;
-- require r/have_blackhole.require
disable_query_log;
show variables like "have_blackhole_engine";
show variables like 'have_blackhole_engine';
enable_query_log;
--require r/case_sensitive_file_system.require
--disable_query_log
show variables like "lower_case_file_system";
show variables like 'lower_case_file_system';
--enable_query_log
-- require r/have_compress.require
disable_query_log;
show variables like "have_compress";
show variables like 'have_compress';
enable_query_log;
-- require r/have_cp1250_ch.require
disable_query_log;
show collation like "cp1250_czech_cs";
show collation like 'cp1250_czech_cs';
enable_query_log;
-- require r/have_cp932.require
disable_query_log;
show collation like "cp932_japanese_ci";
show collation like 'cp932_japanese_ci';
enable_query_log;
-- require r/have_crypt.require
disable_query_log;
show variables like "have_crypt";
show variables like 'have_crypt';
enable_query_log;
-- require r/have_csv.require
disable_query_log;
show variables like "have_csv";
show variables like 'have_csv';
enable_query_log;
-- require r/have_eucjpms.require
disable_query_log;
show collation like "eucjpms_japanese_ci";
show collation like 'eucjpms_japanese_ci';
enable_query_log;
-- require r/have_euckr.require
disable_query_log;
show collation like "euckr_korean_ci";
show collation like 'euckr_korean_ci';
enable_query_log;
-- require r/have_exampledb.require
disable_query_log;
show variables like "have_example_engine";
show variables like 'have_example_engine';
enable_query_log;
-- require r/have_federated_db.require
disable_query_log;
show variables like "have_federated_engine";
show variables like 'have_federated_engine';
enable_query_log;
-- require r/have_gb2312.require
disable_query_log;
show collation like "gb2312_chinese_ci";
show collation like 'gb2312_chinese_ci';
enable_query_log;
-- require r/have_gbk.require
disable_query_log;
show collation like "gbk_chinese_ci";
show collation like 'gbk_chinese_ci';
enable_query_log;
--require r/have_geometry.require
--disable_query_log
show variables like "have_geometry";
show variables like 'have_geometry';
--enable_query_log
-- require r/have_innodb.require
disable_query_log;
show variables like "have_innodb";
show variables like 'have_innodb';
enable_query_log;
-- require r/have_latin2_ch.require
disable_query_log;
show collation like "latin2_czech_cs";
show collation like 'latin2_czech_cs';
enable_query_log;
-- require r/have_log_bin.require
disable_query_log;
show variables like "log_bin";
show variables like 'log_bin';
enable_query_log;
--require r/lowercase0.require
--disable_query_log
show variables like "lower_case_%";
show variables like 'lower_case_%';
--enable_query_log
......@@ -10,7 +10,7 @@ drop table if exists t1, t2;
--enable_warnings
flush tables;
--require r/have_ndb.require
show variables like "have_ndbcluster";
show variables like 'have_ndbcluster';
enable_query_log;
# Check that server2 has NDB support
......@@ -21,7 +21,7 @@ drop table if exists t1, t2;
--enable_warnings
flush tables;
--require r/have_ndb.require
show variables like "have_ndbcluster";
show variables like 'have_ndbcluster';
enable_query_log;
# Set the default connection to 'server1'
......
# Check that server is compiled and started with support for NDB
-- require r/have_ndb.require
disable_query_log;
show variables like "have_ndbcluster";
show variables like 'have_ndbcluster';
enable_query_log;
# Check that NDB is installed and known to be working
......
......@@ -3,5 +3,5 @@
# of query cache hits
-- disable_ps_protocol
disable_query_log;
show variables like "have_query_cache";
show variables like 'have_query_cache';
enable_query_log;
-- require r/have_sjis.require
disable_query_log;
show collation like "sjis_japanese_ci";
show collation like 'sjis_japanese_ci';
enable_query_log;
-- require r/have_ssl.require
disable_query_log;
show variables like "have_ssl";
show variables like 'have_ssl';
enable_query_log;
-- require r/have_tis620.require
disable_query_log;
show collation like "tis620_thai_ci";
show collation like 'tis620_thai_ci';
enable_query_log;
-- require r/have_ucs2.require
disable_query_log;
show collation like "ucs2_general_ci";
show collation like 'ucs2_general_ci';
enable_query_log;
......@@ -4,7 +4,7 @@
#
--require r/have_udf.require
disable_query_log;
show variables like "have_dynamic_loading";
show variables like 'have_dynamic_loading';
enable_query_log;
#
......
-- require r/have_ujis.require
disable_query_log;
show collation like "ujis_japanese_ci";
show collation like 'ujis_japanese_ci';
enable_query_log;
# include/wait_condition.inc
#
# SUMMARY
#
# Waits until the passed statement returns true, or the operation
# times out.
#
# USAGE
#
# let $wait_condition=
# SELECT c = 3 FROM t;
# --source include/wait_condition.inc
#
# OR
#
# let $wait_timeout= 60; # Override default 30 seconds with 60.
# let $wait_condition=
# SELECT c = 3 FROM t;
# --source include/wait_condition.inc
# --echo Executed the test condition $wait_condition_reps times
#
# EXAMPLE
# events_bugs.test, events_time_zone.test
#
--disable_query_log
let $wait_counter= 300;
if ($wait_timeout)
{
let $wait_counter= `SELECT $wait_timeout * 10`;
}
# Reset $wait_timeout so that its value won't be used on subsequent
# calls, and default will be used instead.
let $wait_timeout= 0;
# Keep track of how many times the wait condition is tested
# This is used by some tests (e.g., main.status)
let $wait_condition_reps= 0;
while ($wait_counter)
{
let $success= `$wait_condition`;
inc $wait_condition_reps;
if ($success)
{
let $wait_counter= 0;
}
if (!$success)
{
real_sleep 0.1;
dec $wait_counter;
}
}
if (!$success)
{
echo Timeout in wait_condition.inc for $wait_condition;
}
--enable_query_log
......@@ -35,7 +35,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;*";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';*' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*' at line 1
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*!98765' AND b = 'bar'' at line 1
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';*";
......
......@@ -305,4 +305,18 @@ drop table t1;
SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs;
NAME_CONST('var', 'value') COLLATE latin1_general_cs
value
select @@session.time_zone into @save_tz;
set @@session.time_zone='UTC';
select uuid() into @my_uuid;
select mid(@my_uuid,15,1);
mid(@my_uuid,15,1)
1
select 24 * 60 * 60 * 1000 * 1000 * 10 into @my_uuid_one_day;
select concat('0',mid(@my_uuid,16,3),mid(@my_uuid,10,4),left(@my_uuid,8)) into @my_uuidate;
select floor(conv(@my_uuidate,16,10)/@my_uuid_one_day) into @my_uuid_date;
select 141427 + datediff(curdate(),'1970-01-01') into @my_uuid_synthetic;
select @my_uuid_date - @my_uuid_synthetic;
@my_uuid_date - @my_uuid_synthetic
0
set @@session.time_zone=@save_tz;
End of 5.0 tests
......@@ -38,6 +38,8 @@ t2
t3
Tables_in_test
t1
delimiter
1
_
Test delimiter : from command line
a
......
DROP PROCEDURE IF EXISTS p26030;
select "non terminated"$$
non terminated
non terminated
select "terminated";$$
terminated
terminated
select "non terminated, space" $$
non terminated, space
non terminated, space
select "terminated, space"; $$
terminated, space
terminated, space
select "non terminated, comment" /* comment */$$
non terminated, comment
non terminated, comment
select "terminated, comment"; /* comment */$$
terminated, comment
terminated, comment
select "stmt 1";select "stmt 2 non terminated"$$
stmt 1
stmt 1
stmt 2 non terminated
stmt 2 non terminated
select "stmt 1";select "stmt 2 terminated";$$
stmt 1
stmt 1
stmt 2 terminated
stmt 2 terminated
select "stmt 1";select "stmt 2 non terminated, space" $$
stmt 1
stmt 1
stmt 2 non terminated, space
stmt 2 non terminated, space
select "stmt 1";select "stmt 2 terminated, space"; $$
stmt 1
stmt 1
stmt 2 terminated, space
stmt 2 terminated, space
select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$
stmt 1
stmt 1
stmt 2 non terminated, comment
stmt 2 non terminated, comment
select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$
stmt 1
stmt 1
stmt 2 terminated, comment
stmt 2 terminated, comment
select "stmt 1"; select "space, stmt 2"$$
stmt 1
stmt 1
space, stmt 2
space, stmt 2
select "stmt 1";/* comment */select "comment, stmt 2"$$
stmt 1
stmt 1
comment, stmt 2
comment, stmt 2
DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030()
$$
1
1
DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030()
$$
1
1
DROP PROCEDURE p26030;
use test;
SELECT
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
;
1
1
prepare stmt from
"
SELECT
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
"
;
execute stmt;
1
1
drop view if exists view_overflow;
CREATE VIEW view_overflow AS
SELECT
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
;
SELECT * from view_overflow;
1
1
drop view view_overflow;
drop procedure if exists proc_overflow;
CREATE PROCEDURE proc_overflow()
BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
select 1;
select 2;
select 3;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END $$
call proc_overflow();
1
1
2
2
3
3
drop procedure proc_overflow;
drop function if exists func_overflow;
create function func_overflow() returns int
BEGIN
DECLARE x int default 0;
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
SET x=x+1;
SET x=x+2;
SET x=x+3;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
return x;
END $$
select func_overflow();
func_overflow()
6
drop function func_overflow;
drop table if exists table_overflow;
create table table_overflow(a int, b int);
create trigger trigger_overflow before insert on table_overflow
for each row
BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
SET NEW.b := NEW.a;
SET NEW.b := NEW.b + 1;
SET NEW.b := NEW.b + 2;
SET NEW.b := NEW.b + 3;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END; END; END; END; END; END; END; END; END; END; END; END;
END $$
insert into table_overflow set a=10;
insert into table_overflow set a=20;
select * from table_overflow;
a b
10 16
20 26
drop table table_overflow;
drop procedure if exists proc_35577;
CREATE PROCEDURE proc_35577()
BEGIN
DECLARE z_done INT DEFAULT 0;
DECLARE t_done VARCHAR(5000);
outer_loop: LOOP
IF t_done=1 THEN
LEAVE outer_loop;
END IF;
inner_block:BEGIN
DECLARE z_done INT DEFAULT 0;
SET z_done = 0;
inner_loop: LOOP
IF z_done=1 THEN
LEAVE inner_loop;
END IF;
IF (t_done = 'a') THEN
IF (t_done <> 0) THEN
IF ( t_done > 0) THEN
IF (t_done = 'a') THEN
SET t_done = 'a';
ELSEIF (t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
ELSEIF(t_done = 'a') THEN
SET t_done = 'a';
END IF;
END IF;
END IF;
END IF;
END LOOP inner_loop;
END inner_block;
END LOOP outer_loop;
END $$
drop procedure proc_35577;
drop procedure if exists p_37269;
create procedure p_37269()
begin
declare done int default 0;
declare varb int default 0;
declare vara int default 0;
repeat
select now();
until done end repeat;
while varb do
select now();
begin
select now();
repeat
select now();
until done end repeat;
if vara then
select now();
repeat
select now();
loop
select now();
end loop;
repeat
select now();
label1: while varb do
select now();
end while label1;
if vara then
select now();
repeat
select now();
until done end repeat;
begin
select now();
while varb do
select now();
label1: while varb do
select now();
end while label1;
if vara then
select now();
while varb do
select now();
loop
select now();
end loop;
repeat
select now();
loop
select now();
while varb do
select now();
end while;
repeat
select now();
label1: loop
select now();
if vara then
select now();
end if;
end loop label1;
until done end repeat;
end loop;
until done end repeat;
end while;
end if;
end while;
end;
end if;
until done end repeat;
until done end repeat;
end if;
end;
end while;
end $$
drop procedure p_37269;
drop procedure if exists p_37228;
create procedure p_37228 ()
BEGIN
DECLARE v INT DEFAULT 123;
IF (v > 1) THEN SET v = 1;
ELSEIF (v < 10) THEN SET v = 10;
ELSEIF (v < 11) THEN SET v = 11;
ELSEIF (v < 12) THEN SET v = 12;
ELSEIF (v < 13) THEN SET v = 13;
ELSEIF (v < 14) THEN SET v = 14;
ELSEIF (v < 15) THEN SET v = 15;
ELSEIF (v < 16) THEN SET v = 16;
ELSEIF (v < 17) THEN SET v = 17;
ELSEIF (v < 18) THEN SET v = 18;
ELSEIF (v < 19) THEN SET v = 19;
ELSEIF (v < 20) THEN SET v = 20;
ELSEIF (v < 21) THEN SET v = 21;
ELSEIF (v < 22) THEN SET v = 22;
ELSEIF (v < 23) THEN SET v = 23;
ELSEIF (v < 24) THEN SET v = 24;
ELSEIF (v < 25) THEN SET v = 25;
ELSEIF (v < 26) THEN SET v = 26;
ELSEIF (v < 27) THEN SET v = 27;
ELSEIF (v < 28) THEN SET v = 28;
ELSEIF (v < 29) THEN SET v = 29;
ELSEIF (v < 30) THEN SET v = 30;
ELSEIF (v < 31) THEN SET v = 31;
ELSEIF (v < 32) THEN SET v = 32;
ELSEIF (v < 33) THEN SET v = 33;
ELSEIF (v < 34) THEN SET v = 34;
ELSEIF (v < 35) THEN SET v = 35;
ELSEIF (v < 36) THEN SET v = 36;
ELSEIF (v < 37) THEN SET v = 37;
ELSEIF (v < 38) THEN SET v = 38;
ELSEIF (v < 39) THEN SET v = 39;
END IF;
END $$
drop procedure p_37228;
......@@ -85,9 +85,9 @@ NULL
NULL
NULL
prepare stmt6 from 'select 1; select2';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select2' at line 1
prepare stmt6 from 'insert into t1 values (5,"five"); select2';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select2' at line 1
explain prepare stmt6 from 'insert into t1 values (5,"five"); select2';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from 'insert into t1 values (5,"five"); select2'' at line 1
create table t2
......
......@@ -78,3 +78,34 @@ alter table t1 modify a varchar(255);
select length(a) from t1;
length(a)
6
select 0b01000001;
0b01000001
A
select 0x41;
0x41
A
select b'01000001';
b'01000001'
A
select x'41', 0+x'41';
x'41' 0+x'41'
A 65
select N'abc', length(N'abc');
abc length(N'abc')
abc 3
select N'', length(N'');
length(N'')
0
select '', length('');
length('')
0
select b'', 0+b'';
b'' 0+b''
0
select x'', 0+x'';
x'' 0+x''
0
select 0x;
ERROR 42S22: Unknown column '0x' in 'field list'
select 0b;
ERROR 42S22: Unknown column '0b' in 'field list'
......@@ -8,7 +8,7 @@
#
# The amount and properties of character_sets/collations depend on the
# build type
# 2007-12 MySQL 5.0
# 2007-12 MySQL 5.0, 2008-06 MySQL 5.1
# ---------------------------------------------------------------------
#
# Variant 1 fits to
......@@ -33,10 +33,22 @@
# Variant 3 fits to
# version_comment MySQL Community Server (GPL)
# version_comment MySQL Cluster Server (Commercial)
# version_comment MySQL Advanced Server (GPL) 5.1
# version_comment MySQL Advanced Server (Commercial) 5.1
#
# Difference between variant 3 and 2 is within the collation properties
# IS_COMPILED and SORTLEN.
#
# 2008-06 All time excluded variant is "vanilla".
# How to build "vanilla":
# ./BUILD/autorun.sh
# ./configure
# ./make
# Some properties of "vanilla"
# version_comment Source distribution
# Compared to the variants 1 to 3 a lot of character sets are missing.
# Example: "ucs2_bin" is in variant 1 to 3 but not in "vanilla".
#
# Created:
# 2007-12-18 mleich - remove the unstable character_set/collation subtests
# from include/datadict-master.inc
......
......@@ -84,4 +84,3 @@ SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
FROM information_schema.columns
$my_where
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# suite/funcs_1/datadict/tables.inc
#
# Auxiliary script to be sourced by
# is_tables_<engine>.test
#
# The variable $engine_type has to be assigned before sourcing ths script.
#
# Author:
# 2008-06-04 mleich Create this script based on older scripts and new code.
#
# Just have some tables within different databases.
--disable_warnings
DROP DATABASE IF EXISTS test1;
DROP DATABASE IF EXISTS test2;
--enable_warnings
CREATE DATABASE test1;
CREATE DATABASE test2;
--replace_result $engine_type <engine_to_be_used>
eval CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = $engine_type;
--source suite/funcs_1/datadict/tables2.inc
SHOW TABLES FROM test1;
SHOW TABLES FROM test2;
# Create a low privileged user.
# Note: The database db_datadict is just a "home" for the low privileged user
# and not in the focus of testing.
--error 0,ER_CANNOT_USER
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
--echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,test1);
--source suite/funcs_1/datadict/tables2.inc
SHOW TABLES FROM test1;
# The lowprivileged user testuser1 will get here an error.
--disable_abort_on_error
SHOW TABLES FROM test2;
--enable_abort_on_error
--echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE test1;
DROP DATABASE test2;
......@@ -2,8 +2,8 @@
#
# Auxiliary script to be sourced by
# is_tables_mysql.test
# is_tables_mysql_embedded.test
# is_tables_is.test
# is_tables_<engine>.test
#
# Author:
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
......@@ -12,28 +12,27 @@
#
--disable_warnings
DROP DATABASE IF EXISTS db_datadict;
DROP DATABASE IF EXISTS test1;
--enable_warnings
CREATE DATABASE db_datadict;
CREATE DATABASE test1;
--source suite/funcs_1/datadict/tables2.inc
# Create a low privileged user.
# Note: The database db_datadict is just a "home" for the low privileged user
# Note: The database test1 is just a "home" for the low privileged user
# and not in the focus of testing.
--error 0,ER_CANNOT_USER
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
--echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,db_datadict);
connect (testuser1,localhost,testuser1,,test1);
--source suite/funcs_1/datadict/tables2.inc
--echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
DROP DATABASE test1;
......@@ -29,6 +29,8 @@
let $innodb_pattern = 'InnoDB free';
let $ndb_pattern = 'number_of_replicas';
--vertical_results
# We do not unify the engine name here, because the rowformat is
# specific to the engine.
--replace_column 8 "#TBLR#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT#" 16 "#UT#" 17 "#CT#" 20 "#CO#" 21 "#TC#"
eval
SELECT *,
......@@ -44,4 +46,3 @@ FROM information_schema.tables
$my_where
ORDER BY table_schema,table_name;
--horizontal_results
# Skip tests which suffer from
# Bug#28309 First insert violates unique constraint
# - was "memory" table empty?
# if the folowing conditions are fulfilled:
# - MySQL Version is 5.0 (Bug is fixed in 5.1 and up)
# - use of embedded server
# - run on a case insensitive filesystem
#
let $value= query_get_value(SHOW VARIABLES LIKE 'lower_case_file_system', Value, 1);
if (`SELECT '$value' = 'ON' AND VERSION() LIKE '5.0%embedded%'`)
{
skip # Test requires backport of fix for Bug#28309 First insert violates unique constraint - was "memory" table empty ?;
}
......@@ -7,7 +7,7 @@ create table tb1 (
f1 char(0),
f2 char(0) binary,
f3 char(0) ascii,
f4 tinytext unicode,
f4 tinytext,
f5 text,
f6 mediumtext,
f7 longtext,
......
......@@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f124 longtext,
f125 tinyblob,
f126 blob,
f127 mediumblob,
......
......@@ -55,13 +55,13 @@ f223 year(3),
f224 year(4),
f225 enum("1enum","2enum"),
f226 set("1set","2set"),
f235 char(0) unicode,
f235 char(0),
f236 char(90),
f237 char(255) ascii,
f238 varchar(0),
f239 varchar(20000) binary,
f240 varchar(2000) unicode,
f241 char(100) unicode
f240 varchar(2000),
f241 char(100)
) engine = innodb;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
......
......@@ -55,12 +55,12 @@ f223 year(3),
f224 year(4),
f225 enum("1enum","2enum"),
f226 set("1set","2set"),
f236 char(95) unicode,
f241 char(255) unicode,
f236 char(95),
f241 char(255),
f237 char(130) binary,
f238 varchar(25000) binary,
f239 varbinary(0),
f240 varchar(1200) unicode
f240 varchar(1200)
) engine = memory;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
......
......@@ -7,7 +7,7 @@ create table tb1 (
f1 char,
f2 char binary,
f3 char ascii,
f4 tinytext unicode,
f4 tinytext,
f5 text,
f6 mediumtext,
f7 longtext,
......
......@@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f124 longtext,
f125 tinyblob,
f126 blob,
f127 mediumblob,
......
......@@ -63,13 +63,13 @@ f231 VARBINARY(192),
f232 VARBINARY(27),
f233 VARBINARY(64),
f234 VARBINARY(192),
f235 char(255) unicode,
f235 char(255),
f236 char(60) ascii,
f237 char(255) binary,
f238 varchar(0) binary,
f239 varbinary(1000),
f240 varchar(120) unicode,
f241 char(100) unicode,
f240 varchar(120),
f241 char(100),
f242 bit(30)
) engine = myisam;
......
USE test;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
f132 tinyint zerofill not null DEFAULT 99,
f133 tinyint unsigned zerofill not null DEFAULT 99,
f134 smallint not null DEFAULT 999,
f135 smallint unsigned not null DEFAULT 999,
f136 smallint zerofill not null DEFAULT 999,
f137 smallint unsigned zerofill not null DEFAULT 999,
f138 mediumint not null DEFAULT 9999,
f139 mediumint unsigned not null DEFAULT 9999,
f140 mediumint zerofill not null DEFAULT 9999,
f141 mediumint unsigned zerofill not null DEFAULT 9999,
f142 int not null DEFAULT 99999,
f143 int unsigned not null DEFAULT 99999,
f144 int zerofill not null DEFAULT 99999,
f145 int unsigned zerofill not null DEFAULT 99999,
f146 bigint not null DEFAULT 999999,
f147 bigint unsigned not null DEFAULT 999999,
f148 bigint zerofill not null DEFAULT 999999,
f149 bigint unsigned zerofill not null DEFAULT 999999,
f150 decimal not null DEFAULT 999.999,
f151 decimal unsigned not null DEFAULT 999.17,
f152 decimal zerofill not null DEFAULT 999.999,
f153 decimal unsigned zerofill,
f154 decimal (0),
f155 decimal (64),
f156 decimal (0) unsigned,
f157 decimal (64) unsigned,
f158 decimal (0) zerofill,
f159 decimal (64) zerofill,
f160 decimal (0) unsigned zerofill,
f161 decimal (64) unsigned zerofill,
f162 decimal (0,0),
f163 decimal (63,30),
f164 decimal (0,0) unsigned,
f165 decimal (63,30) unsigned,
f166 decimal (0,0) zerofill,
f167 decimal (63,30) zerofill,
f168 decimal (0,0) unsigned zerofill,
f169 decimal (63,30) unsigned zerofill,
f170 numeric,
f171 numeric unsigned,
f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = innodb;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase x.x.x.1:
-----------------
DROP TABLE IF EXISTS t0, t1, t2;
CREATE TABLE t0 (col1 char(50)) ENGINE=innodb;
CREATE TABLE t1 (id INT NOT NULL, col1 char(50),
PRIMARY KEY (id)) ENGINE=innodb;
CREATE TABLE t0 (col1 CHAR(50))
ENGINE = <engine_to_be_tested>;
CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id))
ENGINE = <engine_to_be_tested>;
CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT,
INDEX par_ind (f_id), col1 char(50),
FOREIGN KEY (f_id) REFERENCES t1(id)
ON DELETE SET NULL) ENGINE=innodb;
insert into t1 values (1,'Department A');
insert into t1 values (2,'Department B');
insert into t1 values (3,'Department C');
insert into t2 values (1,2,'Emp 1');
insert into t2 values (2,2,'Emp 2');
insert into t2 values (3,2,'Emp 3');
create trigger trig after insert on t0 for each row
delete from t1 where col1=new.col1;
select * from t2;
INDEX par_ind (f_id), col1 CHAR(50),
FOREIGN KEY (f_id) REFERENCES t1(id) ON DELETE SET NULL)
ENGINE = <engine_to_be_tested>;
INSERT INTO t1 VALUES (1,'Department A');
INSERT INTO t1 VALUES (2,'Department B');
INSERT INTO t1 VALUES (3,'Department C');
INSERT INTO t2 VALUES (1,2,'Emp 1');
INSERT INTO t2 VALUES (2,2,'Emp 2');
INSERT INTO t2 VALUES (3,2,'Emp 3');
CREATE TRIGGER trig AFTER INSERT ON t0 FOR EACH ROW
DELETE FROM t1 WHERE col1 = new.col1;
SELECT * FROM t2;
id f_id col1
1 2 Emp 1
2 2 Emp 2
3 2 Emp 3
lock tables t0 write, t1 write;
insert into t0 values ('Department B');
unlock tables;
select * from t2;
LOCK TABLES t0 WRITE, t1 WRITE;
INSERT INTO t0 VALUES ('Department B');
UNLOCK TABLES;
SELECT * FROM t2;
id f_id col1
1 NULL Emp 1
2 NULL Emp 2
3 NULL Emp 3
drop trigger trig;
drop table t2, t1;
DROP TRIGGER trig;
DROP TABLE t2, t1;
Testcase x.x.x.2:
-----------------
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (id INT NOT NULL, col1 char(50),
PRIMARY KEY (id)) ENGINE=innodb;
CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id))
ENGINE = <engine_to_be_tested>;
CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT,
INDEX par_ind (f_id), col1 char(50),
FOREIGN KEY (f_id) REFERENCES t1(id)
ON UPDATE CASCADE) ENGINE=innodb;
insert into t1 values (1,'Department A');
insert into t1 values (2,'Department B');
insert into t1 values (3,'Department C');
insert into t2 values (1,2,'Emp 1');
insert into t2 values (2,3,'Emp 2');
insert into t2 values (3,4,'Emp 3');
INDEX par_ind (f_id), col1 CHAR(50),
FOREIGN KEY (f_id) REFERENCES t1(id) ON UPDATE CASCADE)
ENGINE = <engine_to_be_tested>;
INSERT INTO t1 VALUES (1,'Department A');
INSERT INTO t1 VALUES (2,'Department B');
INSERT INTO t1 VALUES (3,'Department C');
INSERT INTO t2 VALUES (1,2,'Emp 1');
INSERT INTO t2 VALUES (2,3,'Emp 2');
insert into t2 VALUES (3,4,'Emp 3');
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f_id`) REFERENCES `t1` (`id`) ON UPDATE CASCADE)
create trigger tr_t2 before insert on t2 for each row
insert into t1 values(new.f_id, concat('New Department ', new.f_id));
lock tables t1 write, t2 write;
insert into t2 values (3,4,'Emp 3');
unlock tables;
select * from t1;
CREATE TRIGGER tr_t2 BEFORE INSERT ON t2 FOR EACH ROW
INSERT INTO t1 VALUES(new.f_id, CONCAT('New Department ', new.f_id));
LOCK TABLES t1 WRITE, t2 WRITE;
INSERT INTO t2 VALUES (3,4,'Emp 3');
UNLOCK TABLES;
SELECT * FROM t1;
id col1
1 Department A
2 Department B
3 Department C
4 New Department 4
select * from t2;
SELECT * FROM t2;
id f_id col1
1 2 Emp 1
2 3 Emp 2
3 4 Emp 3
drop trigger tr_t2;
drop table t2, t1, t0;
DROP TRIGGER tr_t2;
DROP TABLE t2, t1, t0;
Foreign Key tests disabled (bug 11472 - stored in trig_frkey2.test)
-------------------------------------------------------------------
DROP TABLE test.tb3;
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1
(
f1 CHAR UNICODE,
f2 CHAR(0) UNICODE,
f3 CHAR(10) UNICODE,
f5 VARCHAR(0) UNICODE,
f6 VARCHAR(255) UNICODE,
f7 VARCHAR(260) UNICODE,
f8 TEXT UNICODE,
f9 TINYTEXT UNICODE,
f10 MEDIUMTEXT UNICODE,
f11 LONGTEXT UNICODE
) ENGINE = InnoDB;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 longtext ucs2 ucs2_general_ci
2.0000 mediumtext ucs2 ucs2_general_ci
2.0000 text ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
2.0079 tinytext ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
NULL char ucs2 ucs2_general_ci
NULL varchar ucs2 ucs2_general_ci
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH,
CHARACTER_SET_NAME,
COLLATION_NAME,
COLUMN_TYPE
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text
2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext
2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext
2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
DROP TABLE t1;
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1
(
f1 CHAR UNICODE,
f2 CHAR(0) UNICODE,
f3 CHAR(10) UNICODE,
f5 VARCHAR(0) UNICODE,
f6 VARCHAR(255) UNICODE,
f7 VARCHAR(260) UNICODE
) ENGINE = MEMORY;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
NULL char ucs2 ucs2_general_ci
NULL varchar ucs2 ucs2_general_ci
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH,
CHARACTER_SET_NAME,
COLLATION_NAME,
COLUMN_TYPE
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
DROP TABLE t1;
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1
(
f1 CHAR UNICODE,
f2 CHAR(0) UNICODE,
f3 CHAR(10) UNICODE,
f5 VARCHAR(0) UNICODE,
f6 VARCHAR(255) UNICODE,
f7 VARCHAR(260) UNICODE,
f8 TEXT UNICODE,
f9 TINYTEXT UNICODE,
f10 MEDIUMTEXT UNICODE,
f11 LONGTEXT UNICODE
) ENGINE = MyISAM;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 longtext ucs2 ucs2_general_ci
2.0000 mediumtext ucs2 ucs2_general_ci
2.0000 text ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
2.0079 tinytext ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
NULL char ucs2 ucs2_general_ci
NULL varchar ucs2 ucs2_general_ci
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH,
CHARACTER_SET_NAME,
COLLATION_NAME,
COLUMN_TYPE
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text
2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext
2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext
2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
DROP TABLE t1;
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1
(
f1 CHAR UNICODE,
f2 CHAR(0) UNICODE,
f3 CHAR(10) UNICODE,
f5 VARCHAR(0) UNICODE,
f6 VARCHAR(255) UNICODE,
f7 VARCHAR(260) UNICODE,
f8 TEXT UNICODE,
f9 TINYTEXT UNICODE,
f10 MEDIUMTEXT UNICODE,
f11 LONGTEXT UNICODE
) ENGINE = NDB;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 longtext ucs2 ucs2_general_ci
2.0000 mediumtext ucs2 ucs2_general_ci
2.0000 text ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
2.0079 tinytext ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
NULL char ucs2 ucs2_general_ci
NULL varchar ucs2 ucs2_general_ci
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH,
CHARACTER_SET_NAME,
COLLATION_NAME,
COLUMN_TYPE
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text
2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext
2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext
2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
DROP TABLE t1;
......@@ -6,7 +6,7 @@ create table tb1 (
f1 char(0),
f2 char(0) binary,
f3 char(0) ascii,
f4 tinytext unicode,
f4 tinytext,
f5 text,
f6 mediumtext,
f7 longtext,
......@@ -142,7 +142,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f124 longtext,
f125 tinyblob,
f126 blob,
f127 mediumblob,
......@@ -254,13 +254,13 @@ f223 year(3),
f224 year(4),
f225 enum("1enum","2enum"),
f226 set("1set","2set"),
f235 char(0) unicode,
f235 char(0),
f236 char(90),
f237 char(255) ascii,
f238 varchar(0),
f239 varchar(20000) binary,
f240 varchar(2000) unicode,
f241 char(100) unicode
f240 varchar(2000),
f241 char(100)
) engine = innodb;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb4.txt'
into table tb4;
......@@ -460,7 +460,7 @@ NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0
NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
NULL test tb1 f4 4 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
......@@ -542,7 +542,7 @@ NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
NULL test tb3 f124 7 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
......@@ -645,13 +645,13 @@ NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) sele
NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
NULL test tb4 f235 52 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
NULL test tb4 f235 52 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references
NULL test tb4 f236 53 NULL YES char 90 90 NULL NULL latin1 latin1_swedish_ci char(90) select,insert,update,references
NULL test tb4 f237 54 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
NULL test tb4 f238 55 NULL YES varchar 0 0 NULL NULL latin1 latin1_swedish_ci varchar(0) select,insert,update,references
NULL test tb4 f239 56 NULL YES varchar 20000 20000 NULL NULL latin1 latin1_bin varchar(20000) select,insert,update,references
NULL test tb4 f240 57 NULL YES varchar 2000 4000 NULL NULL ucs2 ucs2_general_ci varchar(2000) select,insert,update,references
NULL test tb4 f241 58 NULL YES char 100 200 NULL NULL ucs2 ucs2_general_ci char(100) select,insert,update,references
NULL test tb4 f240 57 NULL YES varchar 2000 2000 NULL NULL latin1 latin1_swedish_ci varchar(2000) select,insert,update,references
NULL test tb4 f241 58 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references
NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
......@@ -736,6 +736,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 set latin1 latin1_swedish_ci
1.0000 text latin1 latin1_swedish_ci
1.0000 tinytext latin1 latin1_swedish_ci
1.0000 varchar latin1 latin1_swedish_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -746,10 +747,6 @@ WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 longtext ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
2.0079 tinytext ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -780,7 +777,6 @@ NULL year NULL NULL
NULL char latin1 latin1_bin
NULL char latin1 latin1_swedish_ci
NULL varchar latin1 latin1_swedish_ci
NULL char ucs2 ucs2_general_ci
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
......@@ -844,7 +840,7 @@ NULL test t9 f3 int NULL NULL NULL NULL int(11)
NULL test tb1 f1 char 0 0 latin1 latin1_swedish_ci char(0)
NULL test tb1 f2 char 0 0 latin1 latin1_bin char(0)
NULL test tb1 f3 char 0 0 latin1 latin1_swedish_ci char(0)
2.0079 test tb1 f4 tinytext 127 255 ucs2 ucs2_general_ci tinytext
1.0000 test tb1 f4 tinytext 255 255 latin1 latin1_swedish_ci tinytext
1.0000 test tb1 f5 text 65535 65535 latin1 latin1_swedish_ci text
1.0000 test tb1 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
......@@ -956,7 +952,7 @@ NULL test tb2 f107 year NULL NULL NULL NULL year(4)
1.0000 test tb3 f121 tinytext 255 255 latin1 latin1_swedish_ci tinytext
1.0000 test tb3 f122 text 65535 65535 latin1 latin1_swedish_ci text
1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
2.0000 test tb3 f124 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
1.0000 test tb3 f124 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
1.0000 test tb3 f125 tinyblob 255 255 NULL NULL tinyblob
1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob
1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob
......@@ -1059,13 +1055,13 @@ NULL test tb4 f223 year NULL NULL NULL NULL year(4)
NULL test tb4 f224 year NULL NULL NULL NULL year(4)
1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum')
1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set')
NULL test tb4 f235 char 0 0 ucs2 ucs2_general_ci char(0)
NULL test tb4 f235 char 0 0 latin1 latin1_swedish_ci char(0)
1.0000 test tb4 f236 char 90 90 latin1 latin1_swedish_ci char(90)
1.0000 test tb4 f237 char 255 255 latin1 latin1_swedish_ci char(255)
NULL test tb4 f238 varchar 0 0 latin1 latin1_swedish_ci varchar(0)
1.0000 test tb4 f239 varchar 20000 20000 latin1 latin1_bin varchar(20000)
2.0000 test tb4 f240 varchar 2000 4000 ucs2 ucs2_general_ci varchar(2000)
2.0000 test tb4 f241 char 100 200 ucs2 ucs2_general_ci char(100)
1.0000 test tb4 f240 varchar 2000 2000 latin1 latin1_swedish_ci varchar(2000)
1.0000 test tb4 f241 char 100 100 latin1 latin1_swedish_ci char(100)
NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned
NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill
......
This diff is collapsed.
......@@ -244,12 +244,12 @@ f223 year(3),
f224 year(4),
f225 enum("1enum","2enum"),
f226 set("1set","2set"),
f236 char(95) unicode,
f241 char(255) unicode,
f236 char(95),
f241 char(255),
f237 char(130) binary,
f238 varchar(25000) binary,
f239 varbinary(0),
f240 varchar(1200) unicode
f240 varchar(1200)
) engine = memory;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb4.txt'
into table tb4;
......@@ -620,12 +620,12 @@ NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) sele
NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
NULL test tb4 f236 52 NULL YES char 95 190 NULL NULL ucs2 ucs2_general_ci char(95) select,insert,update,references
NULL test tb4 f236 52 NULL YES char 95 95 NULL NULL latin1 latin1_swedish_ci char(95) select,insert,update,references
NULL test tb4 f237 54 NULL YES char 130 130 NULL NULL latin1 latin1_bin char(130) select,insert,update,references
NULL test tb4 f238 55 NULL YES varchar 25000 25000 NULL NULL latin1 latin1_bin varchar(25000) select,insert,update,references
NULL test tb4 f239 56 NULL YES varbinary 0 0 NULL NULL NULL NULL varbinary(0) select,insert,update,references
NULL test tb4 f240 57 NULL YES varchar 1200 2400 NULL NULL ucs2 ucs2_general_ci varchar(1200) select,insert,update,references
NULL test tb4 f241 53 NULL YES char 255 510 NULL NULL ucs2 ucs2_general_ci char(255) select,insert,update,references
NULL test tb4 f240 57 NULL YES varchar 1200 1200 NULL NULL latin1 latin1_swedish_ci varchar(1200) select,insert,update,references
NULL test tb4 f241 53 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
......@@ -702,6 +702,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 char latin1 latin1_swedish_ci
1.0000 enum latin1 latin1_swedish_ci
1.0000 set latin1 latin1_swedish_ci
1.0000 varchar latin1 latin1_swedish_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -712,8 +713,6 @@ WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -1006,12 +1005,12 @@ NULL test tb4 f223 year NULL NULL NULL NULL year(4)
NULL test tb4 f224 year NULL NULL NULL NULL year(4)
1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum')
1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set')
2.0000 test tb4 f236 char 95 190 ucs2 ucs2_general_ci char(95)
2.0000 test tb4 f241 char 255 510 ucs2 ucs2_general_ci char(255)
1.0000 test tb4 f236 char 95 95 latin1 latin1_swedish_ci char(95)
1.0000 test tb4 f241 char 255 255 latin1 latin1_swedish_ci char(255)
1.0000 test tb4 f237 char 130 130 latin1 latin1_bin char(130)
1.0000 test tb4 f238 varchar 25000 25000 latin1 latin1_bin varchar(25000)
NULL test tb4 f239 varbinary 0 0 NULL NULL varbinary(0)
2.0000 test tb4 f240 varchar 1200 2400 ucs2 ucs2_general_ci varchar(1200)
1.0000 test tb4 f240 varchar 1200 1200 latin1 latin1_swedish_ci varchar(1200)
NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned
NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill
......
......@@ -7,7 +7,7 @@ create table tb1 (
f1 char,
f2 char binary,
f3 char ascii,
f4 tinytext unicode,
f4 tinytext,
f5 text,
f6 mediumtext,
f7 longtext,
......@@ -154,7 +154,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f124 longtext,
f125 tinyblob,
f126 blob,
f127 mediumblob,
......@@ -274,13 +274,13 @@ f231 VARBINARY(192),
f232 VARBINARY(27),
f233 VARBINARY(64),
f234 VARBINARY(192),
f235 char(255) unicode,
f235 char(255),
f236 char(60) ascii,
f237 char(255) binary,
f238 varchar(0) binary,
f239 varbinary(1000),
f240 varchar(120) unicode,
f241 char(100) unicode,
f240 varchar(120),
f241 char(100),
f242 bit(30)
) engine = myisam;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb4.txt'
......@@ -489,7 +489,7 @@ NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0
NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
NULL test tb1 f4 4 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
......@@ -579,7 +579,7 @@ NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
NULL test tb3 f124 7 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
......@@ -690,13 +690,13 @@ NULL test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(1
NULL test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
NULL test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
NULL test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
NULL test tb4 f235 60 NULL YES char 255 510 NULL NULL ucs2 ucs2_general_ci char(255) select,insert,update,references
NULL test tb4 f235 60 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
NULL test tb4 f236 61 NULL YES char 60 60 NULL NULL latin1 latin1_swedish_ci char(60) select,insert,update,references
NULL test tb4 f237 62 NULL YES char 255 255 NULL NULL latin1 latin1_bin char(255) select,insert,update,references
NULL test tb4 f238 63 NULL YES varchar 0 0 NULL NULL latin1 latin1_bin varchar(0) select,insert,update,references
NULL test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL varbinary(1000) select,insert,update,references
NULL test tb4 f240 65 NULL YES varchar 120 240 NULL NULL ucs2 ucs2_general_ci varchar(120) select,insert,update,references
NULL test tb4 f241 66 NULL YES char 100 200 NULL NULL ucs2 ucs2_general_ci char(100) select,insert,update,references
NULL test tb4 f240 65 NULL YES varchar 120 120 NULL NULL latin1 latin1_swedish_ci varchar(120) select,insert,update,references
NULL test tb4 f241 66 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references
NULL test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL bit(30) select,insert,update,references
NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
......@@ -790,6 +790,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 set latin1 latin1_swedish_ci
1.0000 text latin1 latin1_swedish_ci
1.0000 tinytext latin1 latin1_swedish_ci
1.0000 varchar latin1 latin1_swedish_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -800,10 +801,6 @@ WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 longtext ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
2.0079 tinytext ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -896,7 +893,7 @@ NULL test t9 f3 int NULL NULL NULL NULL int(11)
1.0000 test tb1 f1 char 1 1 latin1 latin1_swedish_ci char(1)
1.0000 test tb1 f2 char 1 1 latin1 latin1_bin char(1)
1.0000 test tb1 f3 char 1 1 latin1 latin1_swedish_ci char(1)
2.0079 test tb1 f4 tinytext 127 255 ucs2 ucs2_general_ci tinytext
1.0000 test tb1 f4 tinytext 255 255 latin1 latin1_swedish_ci tinytext
1.0000 test tb1 f5 text 65535 65535 latin1 latin1_swedish_ci text
1.0000 test tb1 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
......@@ -1016,7 +1013,7 @@ NULL test tb2 f107 year NULL NULL NULL NULL year(4)
1.0000 test tb3 f121 tinytext 255 255 latin1 latin1_swedish_ci tinytext
1.0000 test tb3 f122 text 65535 65535 latin1 latin1_swedish_ci text
1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
2.0000 test tb3 f124 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
1.0000 test tb3 f124 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
1.0000 test tb3 f125 tinyblob 255 255 NULL NULL tinyblob
1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob
1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob
......@@ -1127,13 +1124,13 @@ NULL test tb4 f224 year NULL NULL NULL NULL year(4)
1.0000 test tb4 f232 varbinary 27 27 NULL NULL varbinary(27)
1.0000 test tb4 f233 varbinary 64 64 NULL NULL varbinary(64)
1.0000 test tb4 f234 varbinary 192 192 NULL NULL varbinary(192)
2.0000 test tb4 f235 char 255 510 ucs2 ucs2_general_ci char(255)
1.0000 test tb4 f235 char 255 255 latin1 latin1_swedish_ci char(255)
1.0000 test tb4 f236 char 60 60 latin1 latin1_swedish_ci char(60)
1.0000 test tb4 f237 char 255 255 latin1 latin1_bin char(255)
NULL test tb4 f238 varchar 0 0 latin1 latin1_bin varchar(0)
1.0000 test tb4 f239 varbinary 1000 1000 NULL NULL varbinary(1000)
2.0000 test tb4 f240 varchar 120 240 ucs2 ucs2_general_ci varchar(120)
2.0000 test tb4 f241 char 100 200 ucs2 ucs2_general_ci char(100)
1.0000 test tb4 f240 varchar 120 120 latin1 latin1_swedish_ci varchar(120)
1.0000 test tb4 f241 char 100 100 latin1 latin1_swedish_ci char(100)
NULL test tb4 f242 bit NULL NULL NULL NULL bit(30)
NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned
NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
SHOW TABLES FROM information_schema LIKE 'SCHEMATA';
Tables_in_information_schema (SCHEMATA)
SCHEMATA
#######################################################################
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
#######################################################################
DROP VIEW IF EXISTS test.v1;
DROP PROCEDURE IF EXISTS test.p1;
DROP FUNCTION IF EXISTS test.f1;
CREATE VIEW test.v1 AS SELECT * FROM information_schema.SCHEMATA;
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.SCHEMATA;
CREATE FUNCTION test.f1() returns BIGINT
BEGIN
DECLARE counter BIGINT DEFAULT NULL;
SELECT COUNT(*) INTO counter FROM information_schema.SCHEMATA;
RETURN counter;
END//
# Attention: The printing of the next result sets is disabled.
SELECT * FROM information_schema.SCHEMATA;
SELECT * FROM test.v1;
CALL test.p1;
SELECT test.f1();
DROP VIEW test.v1;
DROP PROCEDURE test.p1;
DROP FUNCTION test.f1;
#########################################################################
# Testcase 3.2.9.1: INFORMATION_SCHEMA.SCHEMATA layout;
#########################################################################
DESCRIBE information_schema.SCHEMATA;
Field Type Null Key Default Extra
CATALOG_NAME varchar(512) YES NULL
SCHEMA_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
DEFAULT_COLLATION_NAME varchar(64) NO
SQL_PATH varchar(512) YES NULL
SHOW CREATE TABLE information_schema.SCHEMATA;
Table Create Table
SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` (
`CATALOG_NAME` varchar(512) default NULL,
`SCHEMA_NAME` varchar(64) NOT NULL default '',
`DEFAULT_CHARACTER_SET_NAME` varchar(64) NOT NULL default '',
`DEFAULT_COLLATION_NAME` varchar(64) NOT NULL default '',
`SQL_PATH` varchar(512) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.SCHEMATA;
Field Type Null Key Default Extra
CATALOG_NAME varchar(512) YES NULL
SCHEMA_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
DEFAULT_COLLATION_NAME varchar(64) NO
SQL_PATH varchar(512) YES NULL
SELECT catalog_name, schema_name, sql_path
FROM information_schema.schemata
WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL;
catalog_name schema_name sql_path
###############################################################################
# Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information
###############################################################################
DROP DATABASE IF EXISTS db_datadict_1;
DROP DATABASE IF EXISTS db_datadict_2;
CREATE DATABASE db_datadict_1;
CREATE DATABASE db_datadict_2;
DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
CREATE USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
CREATE USER 'testuser3'@'localhost';
GRANT SELECT ON db_datadict_1.* to 'testuser1'@'localhost';
GRANT SELECT ON db_datadict_1.* to 'testuser2'@'localhost';
GRANT SELECT ON db_datadict_2.* to 'testuser2'@'localhost';
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
db_datadict_2
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
db_datadict_2
# Establish connection testuser2 (user=testuser2)
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
db_datadict_2
# Establish connection testuser3 (user=testuser3)
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
db_datadict_2
# Switch to connection default and close connections testuser1,testuser2,testuser3
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
DROP DATABASE db_datadict_1;
DROP DATABASE db_datadict_2;
#################################################################################
# Testcases 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.SCHEMATA modifications
#################################################################################
DROP DATABASE IF EXISTS db_datadict;
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL db_datadict latin1 latin1_swedish_ci NULL
SELECT schema_name, default_character_set_name
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
schema_name default_character_set_name
db_datadict latin1
ALTER SCHEMA db_datadict CHARACTER SET 'utf8';
SELECT schema_name, default_character_set_name
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
schema_name default_character_set_name
db_datadict utf8
ALTER SCHEMA db_datadict CHARACTER SET 'latin1';
SELECT schema_name, default_collation_name FROM information_schema.schemata
WHERE schema_name = 'db_datadict';
schema_name default_collation_name
db_datadict latin1_swedish_ci
ALTER SCHEMA db_datadict COLLATE 'latin1_general_cs';
SELECT schema_name, default_collation_name FROM information_schema.schemata
WHERE schema_name = 'db_datadict';
schema_name default_collation_name
db_datadict latin1_general_cs
SELECT schema_name
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
schema_name
db_datadict
DROP DATABASE db_datadict;
SELECT schema_name
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
schema_name
########################################################################
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
# DDL on INFORMATION_SCHEMA tables are not supported
########################################################################
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
INSERT INTO information_schema.schemata
(catalog_name, schema_name, default_character_set_name, sql_path)
VALUES (NULL, 'db1', 'latin1', NULL);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
INSERT INTO information_schema.schemata
SELECT * FROM information_schema.schemata;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
UPDATE information_schema.schemata
SET default_character_set_name = 'utf8'
WHERE schema_name = 'db_datadict';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
UPDATE information_schema.schemata SET catalog_name = 't_4711';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DELETE FROM information_schema.schemata WHERE schema_name = 'db_datadict';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
TRUNCATE information_schema.schemata;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE INDEX i1 ON information_schema.schemata(schema_name);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
ALTER TABLE information_schema.schemata ADD f1 INT;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP TABLE information_schema.schemata;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
ALTER TABLE information_schema.schemata RENAME db_datadict.schemata;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
ALTER TABLE information_schema.schemata RENAME information_schema.xschemata;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP DATABASE db_datadict;
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
SELECT * FROM information_schema.statistics
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
NULL mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
NULL mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
NULL mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
NULL mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
NULL mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
NULL mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
NULL mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
NULL mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
NULL mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
NULL mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
NULL mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
NULL mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
NULL mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
NULL mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
NULL mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
NULL mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
NULL mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
NULL mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
NULL mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.statistics
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
NULL mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
NULL mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
NULL mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
NULL mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
NULL mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
NULL mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
NULL mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
NULL mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
NULL mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
NULL mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
NULL mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
NULL mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
NULL mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
NULL mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
NULL mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
NULL mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
NULL mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
NULL mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
NULL mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
NULL mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
NULL mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
# Switch to connection default and close connection testuser1
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
This diff is collapsed.
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0
......@@ -383,7 +383,7 @@ user_comment
Separator -----------------------------------------------------
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
# Establish connection testuser1 (user=testuser1)
SELECT *,
LEFT( table_comment,
......@@ -768,4 +768,4 @@ user_comment
Separator -----------------------------------------------------
# Switch to connection default and close connection testuser1
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
DROP DATABASE test1;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -14,3 +14,4 @@ innodb_storedproc: (changes of WL#2984, using storeproc_nn instead)
memory_storedproc: (changes of WL#2984, using storeproc_nn instead)
myisam_storedproc: (changes of WL#2984, using storeproc_nn instead)
ndb_trig_1011ext: Bug#32656 NDB: Duplicate key error aborts transaction in handler. Doesn't talk back to SQL
is_tables_ndb: Bug#37198 user without any right on schema sees NDB table
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment