Commit 38ae5d10 authored by Jonathan Perkin's avatar Jonathan Perkin Committed by mysqldev

Merge from trunk.

parents 2244456d dd7bc1a6
...@@ -154,7 +154,7 @@ test-bt: ...@@ -154,7 +154,7 @@ test-bt:
-cd mysql-test ; MTR_BUILD_THREAD=auto \ -cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=ps --ps-protocol @PERL@ ./mysql-test-run.pl --force --comment=ps --ps-protocol
-cd mysql-test ; MTR_BUILD_THREAD=auto \ -cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1 @PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --reorder --suite=funcs_1
-cd mysql-test ; MTR_BUILD_THREAD=auto \ -cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2 @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
-if [ -d mysql-test/suite/nist ] ; then \ -if [ -d mysql-test/suite/nist ] ; then \
...@@ -179,7 +179,7 @@ test-force-full-pl: test-force-full ...@@ -179,7 +179,7 @@ test-force-full-pl: test-force-full
test-ext-funcs: test-ext-funcs:
cd mysql-test ; \ cd mysql-test ; \
@PERL@ ./mysql-test-run.pl --force --suite=funcs_1 ; \ @PERL@ ./mysql-test-run.pl --force --reorder --suite=funcs_1 ; \
@PERL@ ./mysql-test-run.pl --force --suite=funcs_2 @PERL@ ./mysql-test-run.pl --force --suite=funcs_2
test-ext: test-ext-funcs test-ext: test-ext-funcs
......
...@@ -1779,7 +1779,7 @@ static int read_and_execute(bool interactive) ...@@ -1779,7 +1779,7 @@ static int read_and_execute(bool interactive)
the very beginning of a text file when the very beginning of a text file when
you save the file using "Unicode UTF-8" format. you save the file using "Unicode UTF-8" format.
*/ */
if (!line_number && if (line && !line_number &&
(uchar) line[0] == 0xEF && (uchar) line[0] == 0xEF &&
(uchar) line[1] == 0xBB && (uchar) line[1] == 0xBB &&
(uchar) line[2] == 0xBF) (uchar) line[2] == 0xBF)
...@@ -2081,37 +2081,6 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -2081,37 +2081,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
continue; 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)) else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
{ {
// Found a statement. Continue parsing after the delimiter // Found a statement. Continue parsing after the delimiter
...@@ -2156,7 +2125,14 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -2156,7 +2125,14 @@ static bool add_line(String &buffer,char *line,char *in_string,
} }
else if (!*ml_comment && (!*in_string && (inchar == '#' || else if (!*ml_comment && (!*in_string && (inchar == '#' ||
inchar == '-' && pos[1] == '-' && 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 // Flush previously accepted characters
if (out != line) if (out != line)
......
...@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) ...@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line! # The Docs Makefile.am parses this line!
# remember to also change ndb version below and update version.c in ndb # remember to also change ndb version below and update version.c in ndb
AM_INIT_AUTOMAKE(mysql, 5.0.64) AM_INIT_AUTOMAKE(mysql, 5.0.66)
AM_CONFIG_HEADER([include/config.h:config.h.in]) AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
...@@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 ...@@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
# ndb version # ndb version
NDB_VERSION_MAJOR=5 NDB_VERSION_MAJOR=5
NDB_VERSION_MINOR=0 NDB_VERSION_MINOR=0
NDB_VERSION_BUILD=64 NDB_VERSION_BUILD=66
NDB_VERSION_STATUS="" NDB_VERSION_STATUS=""
# Set all version vars based on $VERSION. How do we do this more elegant ? # Set all version vars based on $VERSION. How do we do this more elegant ?
......
...@@ -67,7 +67,7 @@ dist-hook: ...@@ -67,7 +67,7 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_be/BACKUP* $(distdir)/std_data/ndb_backup50_data_be $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_be/BACKUP* $(distdir)/std_data/ndb_backup50_data_be
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_le/BACKUP* $(distdir)/std_data/ndb_backup50_data_le $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_le/BACKUP* $(distdir)/std_data/ndb_backup50_data_le
$(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(distdir)/std_data/funcs_1 $(INSTALL_DATA) $(srcdir)/std_data/funcs_1/*.txt $(distdir)/std_data/funcs_1
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
-rm -rf `find $(distdir)/suite -type d -name SCCS` -rm -rf `find $(distdir)/suite -type d -name SCCS`
...@@ -106,7 +106,7 @@ install-data-local: ...@@ -106,7 +106,7 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50_data_be $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50_data_be
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50_data_le $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50_data_le
$(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(DESTDIR)$(testdir)/std_data/funcs_1 $(INSTALL_DATA) $(srcdir)/std_data/funcs_1/*.txt $(DESTDIR)$(testdir)/std_data/funcs_1
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
for f in `(cd $(srcdir); find suite -type f | grep -v SCCS)`; \ for f in `(cd $(srcdir); find suite -type f | grep -v SCCS)`; \
do \ do \
......
# 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
...@@ -110,6 +110,7 @@ our $glob_basedir; ...@@ -110,6 +110,7 @@ our $glob_basedir;
our $path_charsetsdir; our $path_charsetsdir;
our $path_client_bindir; our $path_client_bindir;
our $path_client_libdir;
our $path_language; our $path_language;
our $path_timefile; our $path_timefile;
our $path_snapshot; our $path_snapshot;
...@@ -623,6 +624,8 @@ sub command_line_setup () { ...@@ -623,6 +624,8 @@ sub command_line_setup () {
'vardir=s' => \$opt_vardir, 'vardir=s' => \$opt_vardir,
'benchdir=s' => \$glob_mysql_bench_dir, 'benchdir=s' => \$glob_mysql_bench_dir,
'mem' => \$opt_mem, 'mem' => \$opt_mem,
'client-bindir=s' => \$path_client_bindir,
'client-libdir=s' => \$path_client_libdir,
# Misc # Misc
'report-features' => \$opt_report_features, 'report-features' => \$opt_report_features,
...@@ -717,11 +720,19 @@ sub command_line_setup () { ...@@ -717,11 +720,19 @@ sub command_line_setup () {
# #
# Look for the client binaries directory # Look for the client binaries directory
if ($path_client_bindir)
{
# --client-bindir=path set on command line, check that the path exists
$path_client_bindir= mtr_path_exists($path_client_bindir);
}
else
{
$path_client_bindir= mtr_path_exists("$glob_basedir/client_release", $path_client_bindir= mtr_path_exists("$glob_basedir/client_release",
"$glob_basedir/client_debug", "$glob_basedir/client_debug",
vs_config_dirs('client', ''), vs_config_dirs('client', ''),
"$glob_basedir/client", "$glob_basedir/client",
"$glob_basedir/bin"); "$glob_basedir/bin");
}
if (!$opt_extern) if (!$opt_extern)
{ {
...@@ -1764,10 +1775,15 @@ sub environment_setup () { ...@@ -1764,10 +1775,15 @@ sub environment_setup () {
my @ld_library_paths; my @ld_library_paths;
# -------------------------------------------------------------------------- if ($path_client_libdir)
{
# Use the --client-libdir passed on commandline
push(@ld_library_paths, "$path_client_libdir");
}
else
{
# Setup LD_LIBRARY_PATH so the libraries from this distro/clone # Setup LD_LIBRARY_PATH so the libraries from this distro/clone
# are used in favor of the system installed ones # are used in favor of the system installed ones
# --------------------------------------------------------------------------
if ( $source_dist ) if ( $source_dist )
{ {
push(@ld_library_paths, "$glob_basedir/libmysql/.libs/", push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
...@@ -1778,6 +1794,7 @@ sub environment_setup () { ...@@ -1778,6 +1794,7 @@ sub environment_setup () {
{ {
push(@ld_library_paths, "$glob_basedir/lib"); push(@ld_library_paths, "$glob_basedir/lib");
} }
}
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Add the path where libndbclient can be found # Add the path where libndbclient can be found
...@@ -2028,6 +2045,9 @@ sub environment_setup () { ...@@ -2028,6 +2045,9 @@ sub environment_setup () {
{ {
$cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir"; $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
} }
# Always use the given tmpdir for the LOAD files created
# by mysqlbinlog
$cmdline_mysqlbinlog .=" --local-load=$opt_tmpdir";
if ( $opt_debug ) if ( $opt_debug )
{ {
...@@ -5244,6 +5264,8 @@ Misc options ...@@ -5244,6 +5264,8 @@ Misc options
warnings | log-warnings Pass --log-warnings to mysqld warnings | log-warnings Pass --log-warnings to mysqld
sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time
client-bindir=PATH Path to the directory where client binaries are located
client-libdir=PATH Path to the directory where client libraries are located
Deprecated options Deprecated options
with-openssl Deprecated option for ssl with-openssl Deprecated option for ssl
......
...@@ -99,41 +99,99 @@ t1 CREATE TABLE `t1` ( ...@@ -99,41 +99,99 @@ t1 CREATE TABLE `t1` (
`length(uuid())` int(10) NOT NULL default '0' `length(uuid())` int(10) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
create table t1 (a timestamp default '2005-05-05 01:01:01', #------------------------------------------------------------------------
b timestamp default '2005-05-05 01:01:01'); # Tests for Bug#6760 and Bug#12689
insert into t1 set a = now(); SET @row_count = 4;
select sleep(3); SET @sleep_time_per_result_row = 1;
sleep(3) SET @max_acceptable_delay = 2;
0 SET @@global.query_cache_size = 1024 * 64;
update t1 set b = now(); DROP TEMPORARY TABLE IF EXISTS t_history;
select timediff(b, a) >= '00:00:03' from t1; DROP TABLE IF EXISTS t1;
timediff(b, a) >= '00:00:03' CREATE TEMPORARY TABLE t_history (attempt SMALLINT,
1 start_ts DATETIME, end_ts DATETIME,
drop table t1; start_cached INTEGER, end_cached INTEGER);
set global query_cache_size=1355776; CREATE TABLE t1 (f1 BIGINT);
create table t1 (a int); INSERT INTO t1 VALUES (1);
insert into t1 values (1),(1),(1); INSERT INTO t1 VALUES (1);
create table t2 (a datetime default null, b datetime default null); INSERT INTO t1 VALUES (1);
insert into t2 set a = now(); INSERT INTO t1 VALUES (1);
select a from t1 where sleep(1); INSERT INTO t_history
a SET attempt = 4 - 4 + 1, start_ts = NOW(),
update t2 set b = now() where b is null; start_cached = 0;
insert into t2 set a = now(); SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
select a from t1 where sleep(a); f1 SLEEP(@sleep_time_per_result_row)
a 1 0
update t2 set b = now() where b is null; 1 0
insert into t2 set a = now(); 1 0
select a from t1 where sleep(1); 1 0
a UPDATE t_history SET end_ts = NOW()
update t2 set b = now() where b is null; WHERE attempt = 4 - 4 + 1;
select timediff(b, a) >= '00:00:03' from t2; UPDATE t_history SET end_cached = 0
timediff(b, a) >= '00:00:03' WHERE attempt = 4 - 4 + 1;
INSERT INTO t_history
SET attempt = 4 - 3 + 1, start_ts = NOW(),
start_cached = 0;
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
f1 SLEEP(@sleep_time_per_result_row)
1 0
1 0
1 0
1 0
UPDATE t_history SET end_ts = NOW()
WHERE attempt = 4 - 3 + 1;
UPDATE t_history SET end_cached = 0
WHERE attempt = 4 - 3 + 1;
INSERT INTO t_history
SET attempt = 4 - 2 + 1, start_ts = NOW(),
start_cached = 0;
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
f1 SLEEP(@sleep_time_per_result_row)
1 0
1 0
1 0
1 0
UPDATE t_history SET end_ts = NOW()
WHERE attempt = 4 - 2 + 1;
UPDATE t_history SET end_cached = 0
WHERE attempt = 4 - 2 + 1;
INSERT INTO t_history
SET attempt = 4 - 1 + 1, start_ts = NOW(),
start_cached = 0;
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
f1 SLEEP(@sleep_time_per_result_row)
1 0
1 0
1 0
1 0
UPDATE t_history SET end_ts = NOW()
WHERE attempt = 4 - 1 + 1;
UPDATE t_history SET end_cached = 0
WHERE attempt = 4 - 1 + 1;
# Test 1: Does the query with SLEEP need a reasonable time?
SELECT COUNT(*) >= 4 - 1 INTO @aux1 FROM t_history
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
BETWEEN 0 AND @max_acceptable_delay;
SELECT @aux1 AS "Expect 1";
Expect 1
1 1
# Test 2: Does the query with SLEEP need a reasonable time even in case
# of the non first execution?
SELECT COUNT(*) >= 4 - 1 - 1 INTO @aux2 FROM t_history
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
BETWEEN 0 AND @max_acceptable_delay
AND attempt > 1;
SELECT @aux2 AS "Expect 1";
Expect 1
1 1
# Test 3: The query with SLEEP must be not cached.
SELECT COUNT(*) = 4 INTO @aux3 FROM t_history
WHERE end_cached = start_cached;
SELECT @aux3 AS "Expect 1";
Expect 1
1 1
drop table t2; DROP TABLE t1;
drop table t1; DROP TEMPORARY TABLE t_history;
set global query_cache_size=default; SET @@global.query_cache_size = default;
create table t1 select INET_ATON('255.255.0.1') as `a`; create table t1 select INET_ATON('255.255.0.1') as `a`;
show create table t1; show create table t1;
Table Create Table Table Create Table
......
...@@ -38,6 +38,8 @@ t2 ...@@ -38,6 +38,8 @@ t2
t3 t3
Tables_in_test Tables_in_test
t1 t1
delimiter
1
_ _
Test delimiter : from command line Test delimiter : from command line
a a
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# #
# The amount and properties of character_sets/collations depend on the # The amount and properties of character_sets/collations depend on the
# build type # build type
# 2007-12 MySQL 5.0 # 2007-12 MySQL 5.0, 2008-06 MySQL 5.1
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
# #
# Variant 1 fits to # Variant 1 fits to
...@@ -33,10 +33,22 @@ ...@@ -33,10 +33,22 @@
# Variant 3 fits to # Variant 3 fits to
# version_comment MySQL Community Server (GPL) # version_comment MySQL Community Server (GPL)
# version_comment MySQL Cluster Server (Commercial) # 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 # Difference between variant 3 and 2 is within the collation properties
# IS_COMPILED and SORTLEN. # 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: # Created:
# 2007-12-18 mleich - remove the unstable character_set/collation subtests # 2007-12-18 mleich - remove the unstable character_set/collation subtests
# from include/datadict-master.inc # from include/datadict-master.inc
......
...@@ -84,4 +84,3 @@ SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, ...@@ -84,4 +84,3 @@ SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
FROM information_schema.columns FROM information_schema.columns
$my_where $my_where
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; 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 @@ ...@@ -2,8 +2,8 @@
# #
# Auxiliary script to be sourced by # Auxiliary script to be sourced by
# is_tables_mysql.test # is_tables_mysql.test
# is_tables_mysql_embedded.test
# is_tables_is.test # is_tables_is.test
# is_tables_<engine>.test
# #
# Author: # Author:
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
...@@ -12,28 +12,27 @@ ...@@ -12,28 +12,27 @@
# #
--disable_warnings --disable_warnings
DROP DATABASE IF EXISTS db_datadict; DROP DATABASE IF EXISTS test1;
--enable_warnings --enable_warnings
CREATE DATABASE db_datadict; CREATE DATABASE test1;
--source suite/funcs_1/datadict/tables2.inc --source suite/funcs_1/datadict/tables2.inc
# Create a low privileged user. # 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. # and not in the focus of testing.
--error 0,ER_CANNOT_USER --error 0,ER_CANNOT_USER
DROP USER testuser1@localhost; DROP USER testuser1@localhost;
CREATE 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) --echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK --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 --source suite/funcs_1/datadict/tables2.inc
--echo # Switch to connection default and close connection testuser1 --echo # Switch to connection default and close connection testuser1
connection default; connection default;
disconnect testuser1; disconnect testuser1;
DROP USER testuser1@localhost; DROP USER testuser1@localhost;
DROP DATABASE db_datadict; DROP DATABASE test1;
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
let $innodb_pattern = 'InnoDB free'; let $innodb_pattern = 'InnoDB free';
let $ndb_pattern = 'number_of_replicas'; let $ndb_pattern = 'number_of_replicas';
--vertical_results --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#" --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 eval
SELECT *, SELECT *,
...@@ -44,4 +46,3 @@ FROM information_schema.tables ...@@ -44,4 +46,3 @@ FROM information_schema.tables
$my_where $my_where
ORDER BY table_schema,table_name; ORDER BY table_schema,table_name;
--horizontal_results --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 ( ...@@ -7,7 +7,7 @@ create table tb1 (
f1 char(0), f1 char(0),
f2 char(0) binary, f2 char(0) binary,
f3 char(0) ascii, f3 char(0) ascii,
f4 tinytext unicode, f4 tinytext,
f5 text, f5 text,
f6 mediumtext, f6 mediumtext,
f7 longtext, f7 longtext,
......
...@@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101', ...@@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext, f121 tinytext,
f122 text, f122 text,
f123 mediumtext, f123 mediumtext,
f124 longtext unicode, f124 longtext,
f125 tinyblob, f125 tinyblob,
f126 blob, f126 blob,
f127 mediumblob, f127 mediumblob,
......
...@@ -55,13 +55,13 @@ f223 year(3), ...@@ -55,13 +55,13 @@ f223 year(3),
f224 year(4), f224 year(4),
f225 enum("1enum","2enum"), f225 enum("1enum","2enum"),
f226 set("1set","2set"), f226 set("1set","2set"),
f235 char(0) unicode, f235 char(0),
f236 char(90), f236 char(90),
f237 char(255) ascii, f237 char(255) ascii,
f238 varchar(0), f238 varchar(0),
f239 varchar(20000) binary, f239 varchar(20000) binary,
f240 varchar(2000) unicode, f240 varchar(2000),
f241 char(100) unicode f241 char(100)
) engine = innodb; ) engine = innodb;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR> --replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
......
...@@ -55,12 +55,12 @@ f223 year(3), ...@@ -55,12 +55,12 @@ f223 year(3),
f224 year(4), f224 year(4),
f225 enum("1enum","2enum"), f225 enum("1enum","2enum"),
f226 set("1set","2set"), f226 set("1set","2set"),
f236 char(95) unicode, f236 char(95),
f241 char(255) unicode, f241 char(255),
f237 char(130) binary, f237 char(130) binary,
f238 varchar(25000) binary, f238 varchar(25000) binary,
f239 varbinary(0), f239 varbinary(0),
f240 varchar(1200) unicode f240 varchar(1200)
) engine = memory; ) engine = memory;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR> --replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
......
...@@ -7,7 +7,7 @@ create table tb1 ( ...@@ -7,7 +7,7 @@ create table tb1 (
f1 char, f1 char,
f2 char binary, f2 char binary,
f3 char ascii, f3 char ascii,
f4 tinytext unicode, f4 tinytext,
f5 text, f5 text,
f6 mediumtext, f6 mediumtext,
f7 longtext, f7 longtext,
......
...@@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101', ...@@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext, f121 tinytext,
f122 text, f122 text,
f123 mediumtext, f123 mediumtext,
f124 longtext unicode, f124 longtext,
f125 tinyblob, f125 tinyblob,
f126 blob, f126 blob,
f127 mediumblob, f127 mediumblob,
......
...@@ -63,13 +63,13 @@ f231 VARBINARY(192), ...@@ -63,13 +63,13 @@ f231 VARBINARY(192),
f232 VARBINARY(27), f232 VARBINARY(27),
f233 VARBINARY(64), f233 VARBINARY(64),
f234 VARBINARY(192), f234 VARBINARY(192),
f235 char(255) unicode, f235 char(255),
f236 char(60) ascii, f236 char(60) ascii,
f237 char(255) binary, f237 char(255) binary,
f238 varchar(0) binary, f238 varchar(0) binary,
f239 varbinary(1000), f239 varbinary(1000),
f240 varchar(120) unicode, f240 varchar(120),
f241 char(100) unicode, f241 char(100),
f242 bit(30) f242 bit(30)
) engine = myisam; ) engine = myisam;
......
##### suite/funcs_1/include/tb3.inc
#
# This auxiliary script is used in several Trigger tests.
#
# If the table need data than the file std_data_ln/funcs_1/memory_tb3.txt
# could be used.
#
--disable_warnings
drop table if exists tb3;
--enable_warnings
--replace_result $engine_type <engine_to_be_used>
eval 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 char(50),
f122 char(50),
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 = $engine_type;
USE test; USE test;
drop table if exists tb3 ; drop table if exists tb3;
create table tb3 ( create table tb3 (
f118 char not null DEFAULT 'a', f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101', f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101', f120 char ascii not null DEFAULT b'101',
f121 tinytext, f121 char(50),
f122 text, f122 char(50),
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101', f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99, f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99, f131 tinyint unsigned not null DEFAULT 99,
...@@ -59,13 +53,11 @@ f172 numeric zerofill, ...@@ -59,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill, f173 numeric unsigned zerofill,
f174 numeric (0), f174 numeric (0),
f175 numeric (64) f175 numeric (64)
) engine = innodb; ) engine = <engine_to_be_used>;
Warnings: Warnings:
Note 1265 Data truncated for column 'f150' at row 1 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 'f151' at row 1
Note 1265 Data truncated for column 'f152' 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: 3.5.1.1: Testcase: 3.5.1.1:
------------------ ------------------
...@@ -194,7 +186,7 @@ Testcase 3.5.1.7: - need to fix ...@@ -194,7 +186,7 @@ Testcase 3.5.1.7: - need to fix
drop table if exists t1; drop table if exists t1;
Warnings: Warnings:
Note 1051 Unknown table 't1' Note 1051 Unknown table 't1'
create table t1 (f1 int, f2 char(25),f3 int) engine=innodb; create table t1 (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1 CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
for each row set new.f3 = '14'; for each row set new.f3 = '14';
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
...@@ -233,7 +225,7 @@ ERROR HY000: Trigger in wrong schema ...@@ -233,7 +225,7 @@ ERROR HY000: Trigger in wrong schema
drop database if exists trig_db; drop database if exists trig_db;
create database trig_db; create database trig_db;
use trig_db; use trig_db;
create table t1 (f1 integer) engine = innodb; create table t1 (f1 integer) engine = <engine_to_be_used>;
use test; use test;
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3 CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5; for each row set @ret_trg6_2 = 5;
...@@ -261,8 +253,8 @@ Testcase 3.5.1.?: ...@@ -261,8 +253,8 @@ Testcase 3.5.1.?:
----------------- -----------------
drop table if exists t1; drop table if exists t1;
drop table if exists t2; drop table if exists t2;
create table t1 (f1 char(50), f2 integer) engine = innodb; create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create table t2 (f1 char(50), f2 integer) engine = innodb; create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1 create trigger trig before insert on t1
for each row set new.f1 ='trig t1'; for each row set new.f1 ='trig t1';
create trigger trig before update on t2 create trigger trig before update on t2
...@@ -294,15 +286,15 @@ create database trig_db1; ...@@ -294,15 +286,15 @@ create database trig_db1;
create database trig_db2; create database trig_db2;
create database trig_db3; create database trig_db3;
use trig_db1; use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = innodb; create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1 create trigger trig before insert on t1
for each row set new.f1 ='trig1', @test_var1='trig1'; for each row set new.f1 ='trig1', @test_var1='trig1';
use trig_db2; use trig_db2;
create table t2 (f1 char(50), f2 integer) engine = innodb; create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t2 create trigger trig before insert on t2
for each row set new.f1 ='trig2', @test_var2='trig2'; for each row set new.f1 ='trig2', @test_var2='trig2';
use trig_db3; use trig_db3;
create table t1 (f1 char(50), f2 integer) engine = innodb; create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig before insert on t1 create trigger trig before insert on t1
for each row set new.f1 ='trig3', @test_var3='trig3'; for each row set new.f1 ='trig3', @test_var3='trig3';
set @test_var1= '', @test_var2= '', @test_var3= ''; set @test_var1= '', @test_var2= '', @test_var3= '';
...@@ -340,8 +332,8 @@ drop database if exists trig_db2; ...@@ -340,8 +332,8 @@ drop database if exists trig_db2;
create database trig_db1; create database trig_db1;
create database trig_db2; create database trig_db2;
use trig_db1; use trig_db1;
create table t1 (f1 char(50), f2 integer) engine = innodb; create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create table trig_db2.t1 (f1 char(50), f2 integer) engine = innodb; create table trig_db2.t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
create trigger trig1_b before insert on t1 create trigger trig1_b before insert on t1
for each row set @test_var1='trig1_b'; for each row set @test_var1='trig1_b';
create trigger trig_db1.trig1_a after insert on t1 create trigger trig_db1.trig1_a after insert on t1
......
USE test; USE test;
drop table if exists tb3 ; drop table if exists tb3;
create table tb3 ( create table tb3 (
f118 char not null DEFAULT 'a', f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101', f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101', f120 char ascii not null DEFAULT b'101',
f121 tinytext, f121 char(50),
f122 text, f122 char(50),
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101', f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99, f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99, f131 tinyint unsigned not null DEFAULT 99,
...@@ -59,20 +53,18 @@ f172 numeric zerofill, ...@@ -59,20 +53,18 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill, f173 numeric unsigned zerofill,
f174 numeric (0), f174 numeric (0),
f175 numeric (64) f175 numeric (64)
) engine = innodb; ) engine = <engine_to_be_used>;
Warnings: Warnings:
Note 1265 Data truncated for column 'f150' at row 1 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 'f151' at row 1
Note 1265 Data truncated for column 'f152' 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 3.5.3: Testcase 3.5.3:
--------------- ---------------
drop database if exists priv_db; drop database if exists priv_db;
create database priv_db; create database priv_db;
use priv_db; use priv_db;
create table t1 (f1 char(20)) engine= innodb; create table t1 (f1 char(20)) engine= <engine_to_be_used>;
create User test_noprivs@localhost; create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD'); set password for test_noprivs@localhost = password('PWD');
create User test_yesprivs@localhost; create User test_yesprivs@localhost;
...@@ -609,8 +601,8 @@ Testcase: 3.5.3.x: ...@@ -609,8 +601,8 @@ Testcase: 3.5.3.x:
use priv_db; use priv_db;
drop table if exists t1; drop table if exists t1;
drop table if exists t2; drop table if exists t2;
create table t1 (f1 int) engine= innodb; create table t1 (f1 int) engine= <engine_to_be_used>;
create table t2 (f2 int) engine= innodb; create table t2 (f2 int) engine= <engine_to_be_used>;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost; revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant SUPER on *.* to test_yesprivs@localhost; grant SUPER on *.* to test_yesprivs@localhost;
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost; grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
...@@ -699,4 +691,5 @@ drop database if exists priv_db; ...@@ -699,4 +691,5 @@ drop database if exists priv_db;
drop user test_yesprivs@localhost; drop user test_yesprivs@localhost;
drop user test_noprivs@localhost; drop user test_noprivs@localhost;
drop user test_noprivs; drop user test_noprivs;
DROP TABLE test.tb3; use test;
drop table tb3;
USE test; USE test;
drop table if exists tb3 ; drop table if exists tb3;
create table tb3 ( create table tb3 (
f118 char not null DEFAULT 'a', f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101', f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101', f120 char ascii not null DEFAULT b'101',
f121 tinytext, f121 char(50),
f122 text, f122 char(50),
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101', f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99, f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99, f131 tinyint unsigned not null DEFAULT 99,
...@@ -59,13 +53,11 @@ f172 numeric zerofill, ...@@ -59,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill, f173 numeric unsigned zerofill,
f174 numeric (0), f174 numeric (0),
f175 numeric (64) f175 numeric (64)
) engine = innodb; ) engine = <engine_to_be_used>;
Warnings: Warnings:
Note 1265 Data truncated for column 'f150' at row 1 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 'f151' at row 1
Note 1265 Data truncated for column 'f152' 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: 3.5: Testcase: 3.5:
-------------- --------------
...@@ -86,7 +78,7 @@ Testcase 3.5.4.1: ...@@ -86,7 +78,7 @@ Testcase 3.5.4.1:
----------------- -----------------
create database db_drop; create database db_drop;
Use db_drop; Use db_drop;
create table t1 (f1 char(30)) engine=innodb; create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop.t1 to test_general; grant INSERT, SELECT on db_drop.t1 to test_general;
Use db_drop; Use db_drop;
Create trigger trg1 BEFORE INSERT on t1 Create trigger trg1 BEFORE INSERT on t1
...@@ -114,7 +106,7 @@ Testcase 3.5.4.2: ...@@ -114,7 +106,7 @@ Testcase 3.5.4.2:
create database db_drop2; create database db_drop2;
Use db_drop2; Use db_drop2;
drop table if exists t1_432 ; drop table if exists t1_432 ;
create table t1_432 (f1 char (30)) engine=innodb; create table t1_432 (f1 char (30)) engine = <engine_to_be_used>;
Drop trigger tr_does_not_exit; Drop trigger tr_does_not_exit;
ERROR HY000: Trigger does not exist ERROR HY000: Trigger does not exist
drop table if exists t1_432 ; drop table if exists t1_432 ;
...@@ -126,8 +118,8 @@ create database db_drop3; ...@@ -126,8 +118,8 @@ create database db_drop3;
Use db_drop3; Use db_drop3;
drop table if exists t1_433 ; drop table if exists t1_433 ;
drop table if exists t1_433a ; drop table if exists t1_433a ;
create table t1_433 (f1 char (30)) engine=innodb; create table t1_433 (f1 char (30)) engine = <engine_to_be_used>;
create table t1_433a (f1a char (5)) engine=innodb; create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
set new.f1 = 'Trigger 3.5.4.3'; set new.f1 = 'Trigger 3.5.4.3';
Drop trigger t1.433.trg3; Drop trigger t1.433.trg3;
...@@ -147,7 +139,7 @@ Testcase 3.5.4.4: ...@@ -147,7 +139,7 @@ Testcase 3.5.4.4:
----------------- -----------------
create database db_drop4; create database db_drop4;
Use db_drop4; Use db_drop4;
create table t1 (f1 char(30)) engine=innodb; create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general; grant INSERT, SELECT on db_drop4.t1 to test_general;
Create trigger trg4 BEFORE INSERT on t1 Create trigger trg4 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.4'; for each row set new.f1='Trigger 3.5.4.4';
...@@ -168,7 +160,7 @@ where information_schema.triggers.trigger_name='trg4'; ...@@ -168,7 +160,7 @@ where information_schema.triggers.trigger_name='trg4';
trigger_schema trigger_name event_object_table trigger_schema trigger_name event_object_table
create database db_drop4; create database db_drop4;
Use db_drop4; Use db_drop4;
create table t1 (f1 char(30)) engine=innodb; create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general; grant INSERT, SELECT on db_drop4.t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.4'); Insert into t1 values ('2nd Insert 3.5.4.4');
Select * from t1; Select * from t1;
...@@ -183,7 +175,7 @@ Testcase 3.5.4.5: ...@@ -183,7 +175,7 @@ Testcase 3.5.4.5:
----------------- -----------------
create database db_drop5; create database db_drop5;
Use db_drop5; Use db_drop5;
create table t1 (f1 char(50)) engine=innodb; create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general; grant INSERT, SELECT on t1 to test_general;
Create trigger trg5 BEFORE INSERT on t1 Create trigger trg5 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.5'; for each row set new.f1='Trigger 3.5.4.5';
...@@ -199,7 +191,7 @@ select trigger_schema, trigger_name, event_object_table ...@@ -199,7 +191,7 @@ select trigger_schema, trigger_name, event_object_table
from information_schema.triggers from information_schema.triggers
where information_schema.triggers.trigger_name='trg5'; where information_schema.triggers.trigger_name='trg5';
trigger_schema trigger_name event_object_table trigger_schema trigger_name event_object_table
create table t1 (f1 char(50)) engine=innodb; create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general; grant INSERT, SELECT on t1 to test_general;
Insert into t1 values ('2nd Insert 3.5.4.5'); Insert into t1 values ('2nd Insert 3.5.4.5');
Select * from t1; Select * from t1;
...@@ -240,7 +232,7 @@ Testcase 3.5.5.4: ...@@ -240,7 +232,7 @@ Testcase 3.5.5.4:
create database dbtest_one; create database dbtest_one;
create database dbtest_two; create database dbtest_two;
use dbtest_two; use dbtest_two;
create table t2 (f1 char(15)) engine=innodb; create table t2 (f1 char(15)) engine = <engine_to_be_used>;
use dbtest_one; use dbtest_one;
create trigger trg4 before INSERT create trigger trg4 before INSERT
on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4'; on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
......
USE test; USE test;
drop table if exists tb3 ; drop table if exists tb3;
create table tb3 ( create table tb3 (
f118 char not null DEFAULT 'a', f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101', f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101', f120 char ascii not null DEFAULT b'101',
f121 tinytext, f121 char(50),
f122 text, f122 char(50),
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101', f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99, f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99, f131 tinyint unsigned not null DEFAULT 99,
...@@ -59,13 +53,11 @@ f172 numeric zerofill, ...@@ -59,13 +53,11 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill, f173 numeric unsigned zerofill,
f174 numeric (0), f174 numeric (0),
f175 numeric (64) f175 numeric (64)
) engine = innodb; ) engine = <engine_to_be_used>;
Warnings: Warnings:
Note 1265 Data truncated for column 'f150' at row 1 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 'f151' at row 1
Note 1265 Data truncated for column 'f152' 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: 3.5: Testcase: 3.5:
-------------- --------------
...@@ -94,17 +86,17 @@ create table t1_i ( ...@@ -94,17 +86,17 @@ create table t1_i (
i120 char ascii not null DEFAULT b'101', i120 char ascii not null DEFAULT b'101',
i136 smallint zerofill not null DEFAULT 999, i136 smallint zerofill not null DEFAULT 999,
i144 int zerofill not null DEFAULT 99999, i144 int zerofill not null DEFAULT 99999,
i163 decimal (63,30)) engine=innodb; i163 decimal (63,30)) engine=<engine_to_be_used>;
create table t1_u ( create table t1_u (
u120 char ascii not null DEFAULT b'101', u120 char ascii not null DEFAULT b'101',
u136 smallint zerofill not null DEFAULT 999, u136 smallint zerofill not null DEFAULT 999,
u144 int zerofill not null DEFAULT 99999, u144 int zerofill not null DEFAULT 99999,
u163 decimal (63,30)) engine=innodb; u163 decimal (63,30)) engine=<engine_to_be_used>;
create table t1_d ( create table t1_d (
d120 char ascii not null DEFAULT b'101', d120 char ascii not null DEFAULT b'101',
d136 smallint zerofill not null DEFAULT 999, d136 smallint zerofill not null DEFAULT 999,
d144 int zerofill not null DEFAULT 99999, d144 int zerofill not null DEFAULT 99999,
d163 decimal (63,30)) engine=innodb; d163 decimal (63,30)) engine=<engine_to_be_used>;
Insert into t1_u values ('a',111,99999,999.99); Insert into t1_u values ('a',111,99999,999.99);
Insert into t1_u values ('b',222,99999,999.99); Insert into t1_u values ('b',222,99999,999.99);
Insert into t1_u values ('c',333,99999,999.99); Insert into t1_u values ('c',333,99999,999.99);
......
USE test; USE test;
drop table if exists tb3 ; drop table if exists tb3;
create table tb3 ( create table tb3 (
f118 char not null DEFAULT 'a', f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101', f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101', f120 char ascii not null DEFAULT b'101',
f121 tinytext, f121 char(50),
f122 text, f122 char(50),
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101', f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99, f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99, f131 tinyint unsigned not null DEFAULT 99,
...@@ -59,12 +53,12 @@ f172 numeric zerofill, ...@@ -59,12 +53,12 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill, f173 numeric unsigned zerofill,
f174 numeric (0), f174 numeric (0),
f175 numeric (64) f175 numeric (64)
) engine = innodb; ) engine = <engine_to_be_used>;
Warnings: Warnings:
Note 1265 Data truncated for column 'f150' at row 1 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 'f151' at row 1
Note 1265 Data truncated for column 'f152' 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' load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3; into table tb3;
Testcase 3.5.9.1/2: Testcase 3.5.9.1/2:
...@@ -74,9 +68,9 @@ set new.f142 = 94087, @counter=@counter+1; ...@@ -74,9 +68,9 @@ set new.f142 = 94087, @counter=@counter+1;
TotalRows TotalRows
10 10
Affected Affected
8 9
NotAffected NotAffected
2 1
NewValuew NewValuew
0 0
set @counter=0; set @counter=0;
...@@ -84,7 +78,7 @@ Update tb3 Set f142='1' where f130<100; ...@@ -84,7 +78,7 @@ Update tb3 Set f142='1' where f130<100;
select count(*) as ExpectedChanged, @counter as TrigCounter select count(*) as ExpectedChanged, @counter as TrigCounter
from tb3 where f142=94087; from tb3 where f142=94087;
ExpectedChanged TrigCounter ExpectedChanged TrigCounter
8 8 9 9
select count(*) as ExpectedNotChange from tb3 select count(*) as ExpectedNotChange from tb3
where f130<100 and f142<>94087; where f130<100 and f142<>94087;
ExpectedNotChange ExpectedNotChange
......
USE test; USE test;
drop table if exists tb3 ; drop table if exists tb3;
create table tb3 ( create table tb3 (
f118 char not null DEFAULT 'a', f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101', f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101', f120 char ascii not null DEFAULT b'101',
f121 tinytext, f121 char(50),
f122 text, f122 char(50),
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101', f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99, f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99, f131 tinyint unsigned not null DEFAULT 99,
...@@ -59,12 +53,12 @@ f172 numeric zerofill, ...@@ -59,12 +53,12 @@ f172 numeric zerofill,
f173 numeric unsigned zerofill, f173 numeric unsigned zerofill,
f174 numeric (0), f174 numeric (0),
f175 numeric (64) f175 numeric (64)
) engine = innodb; ) engine = <engine_to_be_used>;
Warnings: Warnings:
Note 1265 Data truncated for column 'f150' at row 1 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 'f151' at row 1
Note 1265 Data truncated for column 'f152' 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' load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3; into table tb3;
Testcase 3.5.10.1/2/3: Testcase 3.5.10.1/2/3:
...@@ -135,7 +129,7 @@ delete from tb3 where f122 like 'Test 3.5.10.1/2/3%'; ...@@ -135,7 +129,7 @@ delete from tb3 where f122 like 'Test 3.5.10.1/2/3%';
Testcase 3.5.10.4: Testcase 3.5.10.4:
------------------ ------------------
create table tb_load (f1 int, f2 char(25),f3 int) engine=innodb; create table tb_load (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
Create trigger trg4 before insert on tb_load Create trigger trg4 before insert on tb_load
for each row set new.f3=-(new.f1 div 5), @counter= @counter+1; for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
set @counter= 0; set @counter= 0;
...@@ -169,7 +163,7 @@ Testcase 3.5.10.6: (implemented in trig_frkey.test) ...@@ -169,7 +163,7 @@ Testcase 3.5.10.6: (implemented in trig_frkey.test)
Testcase 3.5.10.extra: Testcase 3.5.10.extra:
---------------------- ----------------------
create table t1_sp (var136 tinyint, var151 decimal) engine=innodb; create table t1_sp (var136 tinyint, var151 decimal) engine = <engine_to_be_used>;
create trigger trg before insert on t1_sp create trigger trg before insert on t1_sp
for each row set @counter=@counter+1; for each row set @counter=@counter+1;
create procedure trig_sp() create procedure trig_sp()
...@@ -218,12 +212,12 @@ drop table if exists t2_2; ...@@ -218,12 +212,12 @@ drop table if exists t2_2;
drop table if exists t2_3; drop table if exists t2_3;
drop table if exists t2_4; drop table if exists t2_4;
drop table if exists t3; drop table if exists t3;
create table t1 (f1 integer) engine=innodb; create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2_1 (f1 integer) engine=innodb; create table t2_1 (f1 integer) engine = <engine_to_be_used>;
create table t2_2 (f1 integer) engine=innodb; create table t2_2 (f1 integer) engine = <engine_to_be_used>;
create table t2_3 (f1 integer) engine=innodb; create table t2_3 (f1 integer) engine = <engine_to_be_used>;
create table t2_4 (f1 integer) engine=innodb; create table t2_4 (f1 integer) engine = <engine_to_be_used>;
create table t3 (f1 integer) engine=innodb; create table t3 (f1 integer) engine = <engine_to_be_used>;
insert into t1 values (1); insert into t1 values (1);
create trigger tr1 after insert on t1 for each row create trigger tr1 after insert on t1 for each row
BEGIN BEGIN
...@@ -261,10 +255,10 @@ drop table if exists t1; ...@@ -261,10 +255,10 @@ drop table if exists t1;
drop table if exists t2; drop table if exists t2;
drop table if exists t3; drop table if exists t3;
drop table if exists t4; drop table if exists t4;
create table t1 (f1 integer) engine = innodb; create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2 (f2 integer) engine = innodb; create table t2 (f2 integer) engine = <engine_to_be_used>;
create table t3 (f3 integer) engine = innodb; create table t3 (f3 integer) engine = <engine_to_be_used>;
create table t4 (f4 integer) engine = innodb; create table t4 (f4 integer) engine = <engine_to_be_used>;
insert into t1 values (0); insert into t1 values (0);
create trigger tr1 after insert on t1 create trigger tr1 after insert on t1
for each row insert into t2 (f2) values (new.f1+1); for each row insert into t2 (f2) values (new.f1+1);
...@@ -300,7 +294,7 @@ set @sql_mode='traditional'; ...@@ -300,7 +294,7 @@ set @sql_mode='traditional';
create table t1_sp ( create table t1_sp (
count integer, count integer,
var136 tinyint, var136 tinyint,
var151 decimal) engine=innodb; var151 decimal) engine = <engine_to_be_used>;
create procedure trig_sp() create procedure trig_sp()
begin begin
declare done int default 0; declare done int default 0;
...@@ -354,7 +348,7 @@ drop procedure trig_sp; ...@@ -354,7 +348,7 @@ drop procedure trig_sp;
drop trigger trg; drop trigger trg;
drop table t1_sp; drop table t1_sp;
Testcase y.y.y.5: Roleback of nested trigger references Testcase y.y.y.5: Rollback of nested trigger references
------------------------------------------------------- -------------------------------------------------------
set @@sql_mode='traditional'; set @@sql_mode='traditional';
use test; use test;
...@@ -362,10 +356,10 @@ drop table if exists t1; ...@@ -362,10 +356,10 @@ drop table if exists t1;
drop table if exists t2; drop table if exists t2;
drop table if exists t3; drop table if exists t3;
drop table if exists t4; drop table if exists t4;
create table t1 (f1 integer) engine = innodb; create table t1 (f1 integer) engine = <engine_to_be_used>;
create table t2 (f2 integer) engine = innodb; create table t2 (f2 integer) engine = <engine_to_be_used>;
create table t3 (f3 integer) engine = innodb; create table t3 (f3 integer) engine = <engine_to_be_used>;
create table t4 (f4 tinyint) engine = innodb; create table t4 (f4 tinyint) engine = <engine_to_be_used>;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
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: Testcase x.x.x.1:
----------------- -----------------
DROP TABLE IF EXISTS t0, t1, t2; DROP TABLE IF EXISTS t0, t1, t2;
CREATE TABLE t0 (col1 char(50)) ENGINE=innodb; CREATE TABLE t0 (col1 CHAR(50))
CREATE TABLE t1 (id INT NOT NULL, col1 char(50), ENGINE = <engine_to_be_tested>;
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, CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT,
INDEX par_ind (f_id), col1 char(50), INDEX par_ind (f_id), col1 CHAR(50),
FOREIGN KEY (f_id) REFERENCES t1(id) FOREIGN KEY (f_id) REFERENCES t1(id) ON DELETE SET NULL)
ON DELETE SET NULL) ENGINE=innodb; ENGINE = <engine_to_be_tested>;
insert into t1 values (1,'Department A'); INSERT INTO t1 VALUES (1,'Department A');
insert into t1 values (2,'Department B'); INSERT INTO t1 VALUES (2,'Department B');
insert into t1 values (3,'Department C'); INSERT INTO t1 VALUES (3,'Department C');
insert into t2 values (1,2,'Emp 1'); INSERT INTO t2 VALUES (1,2,'Emp 1');
insert into t2 values (2,2,'Emp 2'); INSERT INTO t2 VALUES (2,2,'Emp 2');
insert into t2 values (3,2,'Emp 3'); INSERT INTO t2 VALUES (3,2,'Emp 3');
create trigger trig after insert on t0 for each row CREATE TRIGGER trig AFTER INSERT ON t0 FOR EACH ROW
delete from t1 where col1=new.col1; DELETE FROM t1 WHERE col1 = new.col1;
select * from t2; SELECT * FROM t2;
id f_id col1 id f_id col1
1 2 Emp 1 1 2 Emp 1
2 2 Emp 2 2 2 Emp 2
3 2 Emp 3 3 2 Emp 3
lock tables t0 write, t1 write; LOCK TABLES t0 WRITE, t1 WRITE;
insert into t0 values ('Department B'); INSERT INTO t0 VALUES ('Department B');
unlock tables; UNLOCK TABLES;
select * from t2; SELECT * FROM t2;
id f_id col1 id f_id col1
1 NULL Emp 1 1 NULL Emp 1
2 NULL Emp 2 2 NULL Emp 2
3 NULL Emp 3 3 NULL Emp 3
drop trigger trig; DROP TRIGGER trig;
drop table t2, t1; DROP TABLE t2, t1;
Testcase x.x.x.2: Testcase x.x.x.2:
----------------- -----------------
DROP TABLE IF EXISTS t1, t2; DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (id INT NOT NULL, col1 char(50), CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id))
PRIMARY KEY (id)) ENGINE=innodb; ENGINE = <engine_to_be_tested>;
CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT, CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT,
INDEX par_ind (f_id), col1 char(50), INDEX par_ind (f_id), col1 CHAR(50),
FOREIGN KEY (f_id) REFERENCES t1(id) FOREIGN KEY (f_id) REFERENCES t1(id) ON UPDATE CASCADE)
ON UPDATE CASCADE) ENGINE=innodb; ENGINE = <engine_to_be_tested>;
insert into t1 values (1,'Department A'); INSERT INTO t1 VALUES (1,'Department A');
insert into t1 values (2,'Department B'); INSERT INTO t1 VALUES (2,'Department B');
insert into t1 values (3,'Department C'); INSERT INTO t1 VALUES (3,'Department C');
insert into t2 values (1,2,'Emp 1'); INSERT INTO t2 VALUES (1,2,'Emp 1');
insert into t2 values (2,3,'Emp 2'); INSERT INTO t2 VALUES (2,3,'Emp 2');
insert into t2 values (3,4,'Emp 3'); 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) 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 CREATE TRIGGER tr_t2 BEFORE INSERT ON t2 FOR EACH ROW
insert into t1 values(new.f_id, concat('New Department ', new.f_id)); INSERT INTO t1 VALUES(new.f_id, CONCAT('New Department ', new.f_id));
lock tables t1 write, t2 write; LOCK TABLES t1 WRITE, t2 WRITE;
insert into t2 values (3,4,'Emp 3'); INSERT INTO t2 VALUES (3,4,'Emp 3');
unlock tables; UNLOCK TABLES;
select * from t1; SELECT * FROM t1;
id col1 id col1
1 Department A 1 Department A
2 Department B 2 Department B
3 Department C 3 Department C
4 New Department 4 4 New Department 4
select * from t2; SELECT * FROM t2;
id f_id col1 id f_id col1
1 2 Emp 1 1 2 Emp 1
2 3 Emp 2 2 3 Emp 2
3 4 Emp 3 3 4 Emp 3
drop trigger tr_t2; DROP TRIGGER tr_t2;
drop table t2, t1, t0; DROP TABLE t2, t1, t0;
Foreign Key tests disabled (bug 11472 - stored in trig_frkey2.test) 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 ( ...@@ -6,7 +6,7 @@ create table tb1 (
f1 char(0), f1 char(0),
f2 char(0) binary, f2 char(0) binary,
f3 char(0) ascii, f3 char(0) ascii,
f4 tinytext unicode, f4 tinytext,
f5 text, f5 text,
f6 mediumtext, f6 mediumtext,
f7 longtext, f7 longtext,
...@@ -142,7 +142,7 @@ f120 char ascii not null DEFAULT b'101', ...@@ -142,7 +142,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext, f121 tinytext,
f122 text, f122 text,
f123 mediumtext, f123 mediumtext,
f124 longtext unicode, f124 longtext,
f125 tinyblob, f125 tinyblob,
f126 blob, f126 blob,
f127 mediumblob, f127 mediumblob,
...@@ -254,13 +254,13 @@ f223 year(3), ...@@ -254,13 +254,13 @@ f223 year(3),
f224 year(4), f224 year(4),
f225 enum("1enum","2enum"), f225 enum("1enum","2enum"),
f226 set("1set","2set"), f226 set("1set","2set"),
f235 char(0) unicode, f235 char(0),
f236 char(90), f236 char(90),
f237 char(255) ascii, f237 char(255) ascii,
f238 varchar(0), f238 varchar(0),
f239 varchar(20000) binary, f239 varchar(20000) binary,
f240 varchar(2000) unicode, f240 varchar(2000),
f241 char(100) unicode f241 char(100)
) engine = innodb; ) engine = innodb;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb4.txt' load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb4.txt'
into table tb4; into table tb4;
...@@ -460,7 +460,7 @@ NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0 ...@@ -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 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 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 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 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 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 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) ...@@ -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 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 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 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 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 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 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 ...@@ -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 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 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 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 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 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 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 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 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 200 NULL NULL ucs2 ucs2_general_ci char(100) 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 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 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 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 ...@@ -736,6 +736,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 set latin1 latin1_swedish_ci 1.0000 set latin1 latin1_swedish_ci
1.0000 text latin1 latin1_swedish_ci 1.0000 text latin1 latin1_swedish_ci
1.0000 tinytext latin1 latin1_swedish_ci 1.0000 tinytext latin1 latin1_swedish_ci
1.0000 varchar latin1 latin1_swedish_ci
SELECT DISTINCT SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE, DATA_TYPE,
...@@ -746,10 +747,6 @@ WHERE table_schema LIKE 'test%' ...@@ -746,10 +747,6 @@ WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME 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 SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE, DATA_TYPE,
...@@ -780,7 +777,6 @@ NULL year NULL NULL ...@@ -780,7 +777,6 @@ NULL year NULL NULL
NULL char latin1 latin1_bin NULL char latin1 latin1_bin
NULL char latin1 latin1_swedish_ci NULL char latin1 latin1_swedish_ci
NULL varchar 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 --> 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 --> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, 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) ...@@ -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 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 f2 char 0 0 latin1 latin1_bin char(0)
NULL test tb1 f3 char 0 0 latin1 latin1_swedish_ci 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 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 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext 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) ...@@ -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 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 f122 text 65535 65535 latin1 latin1_swedish_ci text
1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext 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 f125 tinyblob 255 255 NULL NULL tinyblob
1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob 1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob
1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob 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) ...@@ -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) 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 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') 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 f236 char 90 90 latin1 latin1_swedish_ci char(90)
1.0000 test tb4 f237 char 255 255 latin1 latin1_swedish_ci char(255) 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) 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) 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) 1.0000 test tb4 f240 varchar 2000 2000 latin1 latin1_swedish_ci varchar(2000)
2.0000 test tb4 f241 char 100 200 ucs2 ucs2_general_ci char(100) 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 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 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill 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), ...@@ -244,12 +244,12 @@ f223 year(3),
f224 year(4), f224 year(4),
f225 enum("1enum","2enum"), f225 enum("1enum","2enum"),
f226 set("1set","2set"), f226 set("1set","2set"),
f236 char(95) unicode, f236 char(95),
f241 char(255) unicode, f241 char(255),
f237 char(130) binary, f237 char(130) binary,
f238 varchar(25000) binary, f238 varchar(25000) binary,
f239 varbinary(0), f239 varbinary(0),
f240 varchar(1200) unicode f240 varchar(1200)
) engine = memory; ) engine = memory;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb4.txt' load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb4.txt'
into table tb4; into table tb4;
...@@ -620,12 +620,12 @@ NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) sele ...@@ -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 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 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 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 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 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 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 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 510 NULL NULL ucs2 ucs2_general_ci char(255) 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 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 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 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 ...@@ -702,6 +702,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 char latin1 latin1_swedish_ci 1.0000 char latin1 latin1_swedish_ci
1.0000 enum latin1 latin1_swedish_ci 1.0000 enum latin1 latin1_swedish_ci
1.0000 set latin1 latin1_swedish_ci 1.0000 set latin1 latin1_swedish_ci
1.0000 varchar latin1 latin1_swedish_ci
SELECT DISTINCT SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE, DATA_TYPE,
...@@ -712,8 +713,6 @@ WHERE table_schema LIKE 'test%' ...@@ -712,8 +713,6 @@ WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME 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 SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE, DATA_TYPE,
...@@ -1006,12 +1005,12 @@ NULL test tb4 f223 year NULL NULL NULL NULL year(4) ...@@ -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) 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 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') 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) 1.0000 test tb4 f236 char 95 95 latin1 latin1_swedish_ci char(95)
2.0000 test tb4 f241 char 255 510 ucs2 ucs2_general_ci char(255) 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 f237 char 130 130 latin1 latin1_bin char(130)
1.0000 test tb4 f238 varchar 25000 25000 latin1 latin1_bin varchar(25000) 1.0000 test tb4 f238 varchar 25000 25000 latin1 latin1_bin varchar(25000)
NULL test tb4 f239 varbinary 0 0 NULL NULL varbinary(0) 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 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 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill
......
...@@ -7,7 +7,7 @@ create table tb1 ( ...@@ -7,7 +7,7 @@ create table tb1 (
f1 char, f1 char,
f2 char binary, f2 char binary,
f3 char ascii, f3 char ascii,
f4 tinytext unicode, f4 tinytext,
f5 text, f5 text,
f6 mediumtext, f6 mediumtext,
f7 longtext, f7 longtext,
...@@ -154,7 +154,7 @@ f120 char ascii not null DEFAULT b'101', ...@@ -154,7 +154,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext, f121 tinytext,
f122 text, f122 text,
f123 mediumtext, f123 mediumtext,
f124 longtext unicode, f124 longtext,
f125 tinyblob, f125 tinyblob,
f126 blob, f126 blob,
f127 mediumblob, f127 mediumblob,
...@@ -274,13 +274,13 @@ f231 VARBINARY(192), ...@@ -274,13 +274,13 @@ f231 VARBINARY(192),
f232 VARBINARY(27), f232 VARBINARY(27),
f233 VARBINARY(64), f233 VARBINARY(64),
f234 VARBINARY(192), f234 VARBINARY(192),
f235 char(255) unicode, f235 char(255),
f236 char(60) ascii, f236 char(60) ascii,
f237 char(255) binary, f237 char(255) binary,
f238 varchar(0) binary, f238 varchar(0) binary,
f239 varbinary(1000), f239 varbinary(1000),
f240 varchar(120) unicode, f240 varchar(120),
f241 char(100) unicode, f241 char(100),
f242 bit(30) f242 bit(30)
) engine = myisam; ) engine = myisam;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb4.txt' 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 ...@@ -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 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 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 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 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 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 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) ...@@ -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 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 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 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 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 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 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 ...@@ -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 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 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 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 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 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 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 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 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 200 NULL NULL ucs2 ucs2_general_ci char(100) 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 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 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 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 ...@@ -790,6 +790,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 set latin1 latin1_swedish_ci 1.0000 set latin1 latin1_swedish_ci
1.0000 text latin1 latin1_swedish_ci 1.0000 text latin1 latin1_swedish_ci
1.0000 tinytext latin1 latin1_swedish_ci 1.0000 tinytext latin1 latin1_swedish_ci
1.0000 varchar latin1 latin1_swedish_ci
SELECT DISTINCT SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE, DATA_TYPE,
...@@ -800,10 +801,6 @@ WHERE table_schema LIKE 'test%' ...@@ -800,10 +801,6 @@ WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME 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 SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE, DATA_TYPE,
...@@ -896,7 +893,7 @@ NULL test t9 f3 int NULL NULL NULL NULL int(11) ...@@ -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 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 f2 char 1 1 latin1 latin1_bin char(1)
1.0000 test tb1 f3 char 1 1 latin1 latin1_swedish_ci 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 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 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext 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) ...@@ -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 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 f122 text 65535 65535 latin1 latin1_swedish_ci text
1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext 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 f125 tinyblob 255 255 NULL NULL tinyblob
1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob 1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob
1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob 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) ...@@ -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 f232 varbinary 27 27 NULL NULL varbinary(27)
1.0000 test tb4 f233 varbinary 64 64 NULL NULL varbinary(64) 1.0000 test tb4 f233 varbinary 64 64 NULL NULL varbinary(64)
1.0000 test tb4 f234 varbinary 192 192 NULL NULL varbinary(192) 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 f236 char 60 60 latin1 latin1_swedish_ci char(60)
1.0000 test tb4 f237 char 255 255 latin1 latin1_bin char(255) 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) NULL test tb4 f238 varchar 0 0 latin1 latin1_bin varchar(0)
1.0000 test tb4 f239 varbinary 1000 1000 NULL NULL varbinary(1000) 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) 1.0000 test tb4 f240 varchar 120 120 latin1 latin1_swedish_ci varchar(120)
2.0000 test tb4 f241 char 100 200 ucs2 ucs2_general_ci char(100) 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 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 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 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.
This diff is collapsed.
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;
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.table_constraints
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name,constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL mysql PRIMARY mysql columns_priv PRIMARY KEY
NULL mysql PRIMARY mysql db PRIMARY KEY
NULL mysql PRIMARY mysql func PRIMARY KEY
NULL mysql name mysql help_category UNIQUE
NULL mysql PRIMARY mysql help_category PRIMARY KEY
NULL mysql name mysql help_keyword UNIQUE
NULL mysql PRIMARY mysql help_keyword PRIMARY KEY
NULL mysql PRIMARY mysql help_relation PRIMARY KEY
NULL mysql name mysql help_topic UNIQUE
NULL mysql PRIMARY mysql help_topic PRIMARY KEY
NULL mysql PRIMARY mysql host PRIMARY KEY
NULL mysql PRIMARY mysql proc PRIMARY KEY
NULL mysql PRIMARY mysql procs_priv PRIMARY KEY
NULL mysql PRIMARY mysql tables_priv PRIMARY KEY
NULL mysql PRIMARY mysql time_zone PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
NULL mysql PRIMARY mysql user PRIMARY KEY
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name,constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL mysql PRIMARY mysql columns_priv PRIMARY KEY
NULL mysql PRIMARY mysql db PRIMARY KEY
NULL mysql PRIMARY mysql func PRIMARY KEY
NULL mysql name mysql help_category UNIQUE
NULL mysql PRIMARY mysql help_category PRIMARY KEY
NULL mysql name mysql help_keyword UNIQUE
NULL mysql PRIMARY mysql help_keyword PRIMARY KEY
NULL mysql PRIMARY mysql help_relation PRIMARY KEY
NULL mysql name mysql help_topic UNIQUE
NULL mysql PRIMARY mysql help_topic PRIMARY KEY
NULL mysql PRIMARY mysql host PRIMARY KEY
NULL mysql PRIMARY mysql proc PRIMARY KEY
NULL mysql PRIMARY mysql procs_priv PRIMARY KEY
NULL mysql PRIMARY mysql tables_priv PRIMARY KEY
NULL mysql PRIMARY mysql time_zone PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
NULL mysql PRIMARY mysql user PRIMARY KEY
# Switch to connection default and close connection testuser1
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
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