From f988a7e600b2eb997d0211ee0c9e7cb436fd260a Mon Sep 17 00:00:00 2001
From: "jperkin/jonathan@chorlton.adsl.perkin.org.uk" <>
Date: Wed, 19 Dec 2007 13:24:43 +0000
Subject: [PATCH 01/28] Add new pkgplugindir handling to seperate plugins from
libraries, and allow override for binary distributions. Extend mysql_config
to print compiled-in plugin location for third-party plugins to use.
Resolves bug#31736.
---
libmysqld/Makefile.am | 3 ++-
mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++
mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++
plugin/daemon_example/Makefile.am | 5 ++--
plugin/fulltext/Makefile.am | 6 ++---
scripts/Makefile.am | 3 +++
scripts/make_binary_distribution.sh | 3 +++
scripts/mysql_config.sh | 4 +++
sql/Makefile.am | 3 ++-
sql/mysqld.cc | 2 +-
sql/unireg.h | 4 +--
storage/archive/Makefile.am | 5 ++--
storage/blackhole/Makefile.am | 5 ++--
storage/example/Makefile.am | 5 ++--
storage/federated/Makefile.am | 5 ++--
storage/innobase/Makefile.am | 3 ++-
16 files changed, 110 insertions(+), 19 deletions(-)
create mode 100644 mysql-test/r/bdb_notembedded.result
create mode 100644 mysql-test/t/bdb_notembedded.test
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index c0784447216..117f8752629 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -21,13 +21,14 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(libdir)
+pkgplugindir = $(libdir)/@PACKAGE@/plugin
EXTRA_DIST = libmysqld.def CMakeLists.txt
DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
- -DLIBDIR="\"$(MYSQLLIBdir)\""
+ -DPLUGINDIR="\"$(pkgplugindir)\""
INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_builddir)/sql -I$(top_srcdir)/sql \
-I$(top_srcdir)/sql/examples \
diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result
new file mode 100644
index 00000000000..14cb5fad915
--- /dev/null
+++ b/mysql-test/r/bdb_notembedded.result
@@ -0,0 +1,35 @@
+set autocommit=1;
+reset master;
+create table bug16206 (a int);
+insert into bug16206 values(1);
+start transaction;
+insert into bug16206 values(2);
+commit;
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
+f n Query 1 n use `test`; create table bug16206 (a int)
+f n Query 1 n use `test`; insert into bug16206 values(1)
+f n Query 1 n use `test`; insert into bug16206 values(2)
+drop table bug16206;
+reset master;
+create table bug16206 (a int) engine= bdb;
+insert into bug16206 values(0);
+insert into bug16206 values(1);
+start transaction;
+insert into bug16206 values(2);
+commit;
+insert into bug16206 values(3);
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
+f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
+f n Query 1 n use `test`; insert into bug16206 values(0)
+f n Query 1 n use `test`; insert into bug16206 values(1)
+f n Query 1 n use `test`; BEGIN
+f n Query 1 n use `test`; insert into bug16206 values(2)
+f n Query 1 n use `test`; COMMIT
+f n Query 1 n use `test`; insert into bug16206 values(3)
+drop table bug16206;
+set autocommit=0;
+End of 5.0 tests
diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test
new file mode 100644
index 00000000000..24e64ebbfb2
--- /dev/null
+++ b/mysql-test/t/bdb_notembedded.test
@@ -0,0 +1,38 @@
+-- source include/not_embedded.inc
+-- source include/have_bdb.inc
+
+#
+# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode
+#
+set autocommit=1;
+
+let $VERSION=`select version()`;
+
+reset master;
+create table bug16206 (a int);
+insert into bug16206 values(1);
+start transaction;
+insert into bug16206 values(2);
+commit;
+--replace_result $VERSION VERSION
+--replace_column 1 f 2 n 5 n
+show binlog events;
+drop table bug16206;
+
+reset master;
+create table bug16206 (a int) engine= bdb;
+insert into bug16206 values(0);
+insert into bug16206 values(1);
+start transaction;
+insert into bug16206 values(2);
+commit;
+insert into bug16206 values(3);
+--replace_result $VERSION VERSION
+--replace_column 1 f 2 n 5 n
+show binlog events;
+drop table bug16206;
+
+set autocommit=0;
+
+
+--echo End of 5.0 tests
diff --git a/plugin/daemon_example/Makefile.am b/plugin/daemon_example/Makefile.am
index 92b1ab040fb..4256fecd873 100644
--- a/plugin/daemon_example/Makefile.am
+++ b/plugin/daemon_example/Makefile.am
@@ -18,14 +18,15 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
+pkgplugindir = $(libdir)/@PACKAGE@/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
-I$(srcdir) @ZLIB_INCLUDES@
EXTRA_LTLIBRARIES = libdaemon_example.la
-pkglib_LTLIBRARIES = @plugin_daemon_example_shared_target@
-libdaemon_example_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
+pkgplugin_LTLIBRARIES = @plugin_daemon_example_shared_target@
+libdaemon_example_la_LDFLAGS = -module -rpath $(pkgplugindir)
libdaemon_example_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libdaemon_example_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libdaemon_example_la_SOURCES = daemon_example.cc
diff --git a/plugin/fulltext/Makefile.am b/plugin/fulltext/Makefile.am
index ec033018a00..2b9d075bae0 100644
--- a/plugin/fulltext/Makefile.am
+++ b/plugin/fulltext/Makefile.am
@@ -15,12 +15,12 @@
#Makefile.am example for a plugin
-pkglibdir=$(libdir)/mysql
+pkgplugindir=$(libdir)/@PACKAGE@/plugin
INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include
#noinst_LTLIBRARIES= mypluglib.la
-pkglib_LTLIBRARIES= mypluglib.la
+pkgplugin_LTLIBRARIES= mypluglib.la
mypluglib_la_SOURCES= plugin_example.c
-mypluglib_la_LDFLAGS= -module -rpath $(pkglibdir)
+mypluglib_la_LDFLAGS= -module -rpath $(pkgplugindir)
mypluglib_la_CFLAGS= -DMYSQL_DYNAMIC_PLUGIN
# Don't update the files from bitkeeper
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index fc4359fd872..8669e075959 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -90,6 +90,8 @@ CLEANFILES = @server_scripts@ \
mysql_tableinfo \
mysqld_multi
+pkgplugindir = $(libdir)/@PACKAGE@/plugin
+
# Default same as 'pkgdatadir', but we can override it
pkgsuppdir = $(datadir)/@PACKAGE@
@@ -137,6 +139,7 @@ SUFFIXES = .sh
-e 's!@''pkglibdir''@!$(pkglibdir)!g' \
-e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \
-e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \
+ -e 's!@''pkgplugindir''@!$(pkgplugindir)!g' \
-e 's!@''pkgsuppdir''@!$(pkgsuppdir)!g' \
-e 's!@''sysconfdir''@!$(sysconfdir)!g' \
-e 's!@''mandir''@!$(mandir)!g' \
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 8d3e2133a45..88397052815 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -30,6 +30,8 @@
# "pkglibdir" is set to the same as "libdir"
# "pkgincludedir" is set to the same as "includedir"
# "pkgdatadir" is set to the same as "datadir"
+# "pkgplugindir" is set to "@prefix@/lib/plugin",
+# normally "$libdir/plugin"
# "pkgsuppdir" is set to "@prefix@/support-files",
# normally the same as "datadir"
#
@@ -204,6 +206,7 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then
pkglibdir=@pkglibdir@ \
pkgincludedir=@pkgincludedir@ \
pkgdatadir=@pkgdatadir@ \
+ pkgplugindir=@pkgplugindir@ \
pkgsuppdir=@pkgsuppdir@ \
mandir=@mandir@ \
infodir=@infodir@
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index ae58655ed0f..110c425ea5b 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -87,6 +87,8 @@ pkglibdir='@pkglibdir@'
pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"`
fix_path pkglibdir $pkglibdir_rel lib/mysql lib
+plugindir='@pkgplugindir@'
+
pkgincludedir='@pkgincludedir@'
fix_path pkgincludedir include/mysql include
@@ -147,6 +149,7 @@ Options:
--include [$include]
--libs [$libs]
--libs_r [$libs_r]
+ --plugindir [$plugindir]
--socket [$socket]
--port [$port]
--version [$version]
@@ -163,6 +166,7 @@ while test $# -gt 0; do
--include) echo "$include" ;;
--libs) echo "$libs" ;;
--libs_r) echo "$libs_r" ;;
+ --plugindir) echo "$plugindir" ;;
--socket) echo "$socket" ;;
--port) echo "$port" ;;
--version) echo "$version" ;;
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 0081417d492..02a92dee7a7 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -19,6 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
+pkgplugindir = $(libdir)/@PACKAGE@/plugin
INCLUDES = @ZLIB_INCLUDES@ \
-I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_srcdir)/regex -I$(srcdir) $(openssl_includes)
@@ -136,7 +137,7 @@ DEFS = -DMYSQL_SERVER \
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
- -DLIBDIR="\"$(MYSQLLIBdir)\"" \
+ -DPLUGINDIR="\"$(pkgplugindir)\"" \
@DEFS@
BUILT_MAINT_SRC = sql_yacc.cc sql_yacc.h
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 2f264482d94..48e486f8d02 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -8032,7 +8032,7 @@ static void fix_paths(void)
(void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home);
(void) my_load_path(pidfile_name,pidfile_name,mysql_real_data_home);
(void) my_load_path(opt_plugin_dir, opt_plugin_dir_ptr ? opt_plugin_dir_ptr :
- get_relative_path(LIBDIR), mysql_home);
+ get_relative_path(PLUGINDIR), mysql_home);
opt_plugin_dir_ptr= opt_plugin_dir;
char *sharedir=get_relative_path(SHAREDIR);
diff --git a/sql/unireg.h b/sql/unireg.h
index f0b4a88c7f8..d6a72e6589f 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -35,8 +35,8 @@
#ifndef SHAREDIR
#define SHAREDIR "share/"
#endif
-#ifndef LIBDIR
-#define LIBDIR "lib/"
+#ifndef PLUGINDIR
+#define PLUGINDIR "lib/plugin"
#endif
#define ER(X) errmesg[(X) - ER_ERROR_FIRST]
diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am
index 4920527e0e9..55f2380ec31 100644
--- a/storage/archive/Makefile.am
+++ b/storage/archive/Makefile.am
@@ -19,6 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
+pkgplugindir = $(libdir)/@PACKAGE@/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
@@ -33,8 +34,8 @@ noinst_HEADERS = ha_archive.h azlib.h
noinst_PROGRAMS = archive_test archive_reader
EXTRA_LTLIBRARIES = ha_archive.la
-pkglib_LTLIBRARIES = @plugin_archive_shared_target@
-ha_archive_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
+pkgplugin_LTLIBRARIES = @plugin_archive_shared_target@
+ha_archive_la_LDFLAGS = -module -rpath $(pkgplugindir)
ha_archive_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_archive_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_archive_la_SOURCES = ha_archive.cc azio.c
diff --git a/storage/blackhole/Makefile.am b/storage/blackhole/Makefile.am
index 9dd533dd4fa..9810dff5866 100644
--- a/storage/blackhole/Makefile.am
+++ b/storage/blackhole/Makefile.am
@@ -19,6 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
+pkgplugindir = $(libdir)/@PACKAGE@/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
@@ -32,8 +33,8 @@ DEFS = @DEFS@
noinst_HEADERS = ha_blackhole.h
EXTRA_LTLIBRARIES = ha_blackhole.la
-pkglib_LTLIBRARIES = @plugin_blackhole_shared_target@
-ha_blackhole_la_LDFLAGS=-module -rpath $(MYSQLLIBdir)
+pkgplugin_LTLIBRARIES = @plugin_blackhole_shared_target@
+ha_blackhole_la_LDFLAGS=-module -rpath $(pkgplugindir)
ha_blackhole_la_CXXFLAGS=$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_blackhole_la_CFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_blackhole_la_SOURCES=ha_blackhole.cc
diff --git a/storage/example/Makefile.am b/storage/example/Makefile.am
index 73016d24b57..bf121e70f29 100644
--- a/storage/example/Makefile.am
+++ b/storage/example/Makefile.am
@@ -19,6 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
+pkgplugindir = $(libdir)/@PACKAGE@/libdir
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
@@ -32,8 +33,8 @@ DEFS = @DEFS@
noinst_HEADERS = ha_example.h
EXTRA_LTLIBRARIES = ha_example.la
-pkglib_LTLIBRARIES = @plugin_example_shared_target@
-ha_example_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
+pkgplugin_LTLIBRARIES = @plugin_example_shared_target@
+ha_example_la_LDFLAGS = -module -rpath $(pkgplugindir)
ha_example_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_example_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_example_la_SOURCES = ha_example.cc
diff --git a/storage/federated/Makefile.am b/storage/federated/Makefile.am
index 287b2cb1696..d2ee37c402a 100644
--- a/storage/federated/Makefile.am
+++ b/storage/federated/Makefile.am
@@ -19,6 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
+pkgplugindir = $(libdir)/@PACKAGE@/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
@@ -32,8 +33,8 @@ DEFS = @DEFS@
noinst_HEADERS = ha_federated.h
EXTRA_LTLIBRARIES = ha_federated.la
-pkglib_LTLIBRARIES = @plugin_federated_shared_target@
-ha_federated_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
+pkgplugin_LTLIBRARIES = @plugin_federated_shared_target@
+ha_federated_la_LDFLAGS = -module -rpath $(pkgplugindir)
ha_federated_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_federated_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_federated_la_SOURCES = ha_federated.cc
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
index 30e056d68fb..8a5ce6d8a4b 100644
--- a/storage/innobase/Makefile.am
+++ b/storage/innobase/Makefile.am
@@ -19,6 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
+pkgplugindir = $(libdir)/@PACKAGE@/libdir
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/storage/innobase/include \
@@ -160,7 +161,7 @@ libinnobase_a_CFLAGS = $(AM_CFLAGS)
EXTRA_LTLIBRARIES = ha_innodb.la
pkglib_LTLIBRARIES = @plugin_innobase_shared_target@
-ha_innodb_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
+ha_innodb_la_LDFLAGS = -module -rpath $(pkgplugindir)
ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_innodb_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_innodb_la_SOURCES = $(libinnobase_a_SOURCES)
From e286ac998c4225fbafb5016717a6bf8c979b314c Mon Sep 17 00:00:00 2001
From: "jperkin/jonathan@chorlton.adsl.perkin.org.uk" <>
Date: Wed, 2 Jan 2008 13:00:46 +0000
Subject: [PATCH 02/28] Use pkglibdir to simplify pkgplugindir, and fix the
path in a couple of Makefiles. Continuation of the fix for bug#31736.
---
libmysqld/Makefile.am | 2 +-
plugin/daemon_example/Makefile.am | 2 +-
plugin/fulltext/Makefile.am | 2 +-
scripts/Makefile.am | 2 +-
scripts/make_binary_distribution.sh | 3 +--
sql/Makefile.am | 2 +-
storage/archive/Makefile.am | 2 +-
storage/blackhole/Makefile.am | 2 +-
storage/example/Makefile.am | 2 +-
storage/federated/Makefile.am | 2 +-
storage/innobase/Makefile.am | 2 +-
11 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 117f8752629..446f2bf7f91 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -21,7 +21,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(libdir)
-pkgplugindir = $(libdir)/@PACKAGE@/plugin
+pkgplugindir = $(pkglibdir)/plugin
EXTRA_DIST = libmysqld.def CMakeLists.txt
DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
diff --git a/plugin/daemon_example/Makefile.am b/plugin/daemon_example/Makefile.am
index 4256fecd873..c5414cd46c7 100644
--- a/plugin/daemon_example/Makefile.am
+++ b/plugin/daemon_example/Makefile.am
@@ -18,7 +18,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(libdir)/@PACKAGE@/plugin
+pkgplugindir = $(pkglibdir)/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
diff --git a/plugin/fulltext/Makefile.am b/plugin/fulltext/Makefile.am
index 2b9d075bae0..343416072dd 100644
--- a/plugin/fulltext/Makefile.am
+++ b/plugin/fulltext/Makefile.am
@@ -15,7 +15,7 @@
#Makefile.am example for a plugin
-pkgplugindir=$(libdir)/@PACKAGE@/plugin
+pkgplugindir=$(pkglibdir)/plugin
INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include
#noinst_LTLIBRARIES= mypluglib.la
pkgplugin_LTLIBRARIES= mypluglib.la
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 8669e075959..73c22031990 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -90,7 +90,7 @@ CLEANFILES = @server_scripts@ \
mysql_tableinfo \
mysqld_multi
-pkgplugindir = $(libdir)/@PACKAGE@/plugin
+pkgplugindir = $(pkglibdir)/plugin
# Default same as 'pkgdatadir', but we can override it
pkgsuppdir = $(datadir)/@PACKAGE@
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 88397052815..864e78657b0 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -30,8 +30,7 @@
# "pkglibdir" is set to the same as "libdir"
# "pkgincludedir" is set to the same as "includedir"
# "pkgdatadir" is set to the same as "datadir"
-# "pkgplugindir" is set to "@prefix@/lib/plugin",
-# normally "$libdir/plugin"
+# "pkgplugindir" is set to "$pkglibdir/plugin"
# "pkgsuppdir" is set to "@prefix@/support-files",
# normally the same as "datadir"
#
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 02a92dee7a7..92ae7a05df7 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -19,7 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(libdir)/@PACKAGE@/plugin
+pkgplugindir = $(pkglibdir)/plugin
INCLUDES = @ZLIB_INCLUDES@ \
-I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_srcdir)/regex -I$(srcdir) $(openssl_includes)
diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am
index 55f2380ec31..d092f091798 100644
--- a/storage/archive/Makefile.am
+++ b/storage/archive/Makefile.am
@@ -19,7 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(libdir)/@PACKAGE@/plugin
+pkgplugindir = $(pkglibdir)/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
diff --git a/storage/blackhole/Makefile.am b/storage/blackhole/Makefile.am
index 9810dff5866..db4f67cf847 100644
--- a/storage/blackhole/Makefile.am
+++ b/storage/blackhole/Makefile.am
@@ -19,7 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(libdir)/@PACKAGE@/plugin
+pkgplugindir = $(pkglibdir)/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
diff --git a/storage/example/Makefile.am b/storage/example/Makefile.am
index bf121e70f29..4b2f165377c 100644
--- a/storage/example/Makefile.am
+++ b/storage/example/Makefile.am
@@ -19,7 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(libdir)/@PACKAGE@/libdir
+pkgplugindir = $(pkglibdir)/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
diff --git a/storage/federated/Makefile.am b/storage/federated/Makefile.am
index d2ee37c402a..64ea0207017 100644
--- a/storage/federated/Makefile.am
+++ b/storage/federated/Makefile.am
@@ -19,7 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(libdir)/@PACKAGE@/plugin
+pkgplugindir = $(pkglibdir)/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/sql \
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
index 8a5ce6d8a4b..563522cd032 100644
--- a/storage/innobase/Makefile.am
+++ b/storage/innobase/Makefile.am
@@ -19,7 +19,7 @@ MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(libdir)/@PACKAGE@/libdir
+pkgplugindir = $(pkglibdir)/plugin
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex \
-I$(top_srcdir)/storage/innobase/include \
From ff25b925431efde1b032b26f13a893c25128d789 Mon Sep 17 00:00:00 2001
From: "kent@mysql.com/kent-amd64.(none)" <>
Date: Tue, 26 Feb 2008 18:18:03 +0100
Subject: [PATCH 03/28] configure.in: Corrected calculation of version id,
incorrect last two digits if < 10 Keep "sp1" or "a" in
MYSQL_NO_DASH_VERSION, to set correct version in RPM spec file Added
MYSQL_NUMERIC_VERSION that is like MYSQL_NO_DASH_VERSION before Added clear
doc how the different version variables differ SocketServer.cpp: Corrected
typo in debug error message
---
configure.in | 16 +++++++++++++---
ndb/src/common/util/SocketServer.cpp | 2 +-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/configure.in b/configure.in
index 1643426f827..a0fe8ac5f8b 100644
--- a/configure.in
+++ b/configure.in
@@ -26,9 +26,19 @@ NDB_VERSION_STATUS=""
# Set all version vars based on $VERSION. How do we do this more elegant ?
# Remember that regexps needs to quote [ and ] since this is run through m4
-MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"`
-MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"`
-MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/[[^0-9.]]//g; s/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'`
+# We take some made up examples
+#
+# VERSION 5.1.40sp1-alpha 5.0.34a
+# MYSQL_NO_DASH_VERSION 5.1.40sp1 5.0.34a
+# MYSQL_NUMERIC_VERSION 5.1.40 5.0.34
+# MYSQL_BASE_VERSION 5.1 5.0
+# MYSQL_VERSION_ID 50140 50034
+#
+MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
+MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
+MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
+MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
+ awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
# The port should be constant for a LONG time
MYSQL_TCP_PORT_DEFAULT=3306
diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp
index 755764c7700..3486567e33d 100644
--- a/ndb/src/common/util/SocketServer.cpp
+++ b/ndb/src/common/util/SocketServer.cpp
@@ -111,7 +111,7 @@ SocketServer::setup(SocketServer::Service * service,
const int on = 1;
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
(const char*)&on, sizeof(on)) == -1) {
- DBUG_PRINT("error",("getsockopt() - %d - %s",
+ DBUG_PRINT("error",("setsockopt() - %d - %s",
errno, strerror(errno)));
NDB_CLOSE_SOCKET(sock);
DBUG_RETURN(false);
From ac15eee942b492764690b634570ca32bda446b6c Mon Sep 17 00:00:00 2001
From: "kent@mysql.com/kent-amd64.(none)" <>
Date: Tue, 26 Feb 2008 18:36:06 +0100
Subject: [PATCH 04/28] Makefile.am, Info.plist.sh: Use
MYSQL_NUMERIC_VERSION, only three numbers separated with dot misc.m4,
character_sets.m4, openssl.m4: Removed unneded semicolon
---
config/ac-macros/character_sets.m4 | 6 +++---
config/ac-macros/misc.m4 | 2 +-
config/ac-macros/openssl.m4 | 4 ++--
support-files/MacOSX/Info.plist.sh | 2 +-
support-files/MacOSX/Makefile.am | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4
index 8c3e8ca73b7..ea2763a1cd4 100644
--- a/config/ac-macros/character_sets.m4
+++ b/config/ac-macros/character_sets.m4
@@ -199,7 +199,7 @@ do
;;
*)
AC_MSG_ERROR([Charset '$cs' not available. (Available are: $CHARSETS_AVAILABLE).
- See the Installation chapter in the Reference Manual.]);
+ See the Installation chapter in the Reference Manual.])
esac
done
@@ -380,7 +380,7 @@ case $default_charset in
;;
*)
AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE).
- See the Installation chapter in the Reference Manual.]);
+ See the Installation chapter in the Reference Manual.])
esac
if test "$default_collation" = default; then
@@ -405,7 +405,7 @@ else
Collation $default_collation is not valid for character set $default_charset.
Valid collations are: $default_charset_collations.
See the Installation chapter in the Reference Manual.
- ]);
+ ])
fi
AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_CHARSET_NAME], ["$default_charset"],
diff --git a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4
index 9c7b9aeb171..8c3b51ebc5e 100644
--- a/config/ac-macros/misc.m4
+++ b/config/ac-macros/misc.m4
@@ -756,7 +756,7 @@ case $SYSTEM_TYPE in
esac
if test "$CXX_VERSION"
then
- AC_MSG_CHECKING("C++ compiler version");
+ AC_MSG_CHECKING("C++ compiler version")
AC_MSG_RESULT("$CXX $CXX_VERSION")
fi
AC_SUBST(CXX_VERSION)
diff --git a/config/ac-macros/openssl.m4 b/config/ac-macros/openssl.m4
index 3130cdc3437..9de69b8a1b4 100644
--- a/config/ac-macros/openssl.m4
+++ b/config/ac-macros/openssl.m4
@@ -126,11 +126,11 @@ AC_MSG_CHECKING(for OpenSSL)
AC_MSG_RESULT(no)
if test ! -z "$openssl_includes"
then
- AC_MSG_ERROR(Can't have --with-openssl-includes without --with-openssl);
+ AC_MSG_ERROR(Can't have --with-openssl-includes without --with-openssl)
fi
if test ! -z "$openssl_libs"
then
- AC_MSG_ERROR(Can't have --with-openssl-libs without --with-openssl);
+ AC_MSG_ERROR(Can't have --with-openssl-libs without --with-openssl)
fi
fi
AC_SUBST(openssl_libs)
diff --git a/support-files/MacOSX/Info.plist.sh b/support-files/MacOSX/Info.plist.sh
index fdfb0c7a17c..7df9c5ac710 100644
--- a/support-files/MacOSX/Info.plist.sh
+++ b/support-files/MacOSX/Info.plist.sh
@@ -9,7 +9,7 @@
CFBundleNameMySQLCFBundleShortVersionString
- @MYSQL_NO_DASH_VERSION@
+ @MYSQL_NUMERIC_VERSION@IFPkgFlagAllowBackRevIFPkgFlagAuthorizationAction
diff --git a/support-files/MacOSX/Makefile.am b/support-files/MacOSX/Makefile.am
index 85ccb9c126d..3f11107d714 100644
--- a/support-files/MacOSX/Makefile.am
+++ b/support-files/MacOSX/Makefile.am
@@ -47,7 +47,7 @@ SUFFIXES = .sh
@SED@ \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''VERSION''@!@VERSION@!' \
- -e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
+ -e 's!@''MYSQL_NUMERIC_VERSION''@!@MYSQL_NUMERIC_VERSION@!' \
-e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
-e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
$< > $@-t
From 79929827d86aa8e31fcfee4da4da2f0065968981 Mon Sep 17 00:00:00 2001
From: "kent@mysql.com/kent-amd64.(none)" <>
Date: Tue, 26 Feb 2008 18:43:48 +0100
Subject: [PATCH 05/28] ha_ndbcluster.m4: Use MYSQL_NUMERIC_VERSION, to make
sure NDB_VERSION_BUILD is numeric
---
config/ac-macros/ha_ndbcluster.m4 | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/config/ac-macros/ha_ndbcluster.m4 b/config/ac-macros/ha_ndbcluster.m4
index 9ea2e9972f7..9df96a7750b 100644
--- a/config/ac-macros/ha_ndbcluster.m4
+++ b/config/ac-macros/ha_ndbcluster.m4
@@ -2,9 +2,9 @@ dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_NDBCLUSTER
dnl ---------------------------------------------------------------------------
-NDB_VERSION_MAJOR=`echo $MYSQL_NO_DASH_VERSION | cut -d. -f1`
-NDB_VERSION_MINOR=`echo $MYSQL_NO_DASH_VERSION | cut -d. -f2`
-NDB_VERSION_BUILD=`echo $MYSQL_NO_DASH_VERSION | cut -d. -f3`
+NDB_VERSION_MAJOR=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f1`
+NDB_VERSION_MINOR=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f2`
+NDB_VERSION_BUILD=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f3`
NDB_VERSION_STATUS=`echo $VERSION | sed 's/^[[-.0-9]]*//'`
TEST_NDBCLUSTER=""
From efacf8caa6ffeeb636d097c5efeb94c1873e8239 Mon Sep 17 00:00:00 2001
From: "iggy@alf.(none)" <>
Date: Wed, 27 Feb 2008 16:17:05 -0500
Subject: [PATCH 06/28] Bug #23839 Multiple declarations of macros - Remove
duplicate macro defintions.
---
CMakeLists.txt | 8 +++++++
include/config-win.h | 54 --------------------------------------------
include/my_global.h | 11 ++++-----
3 files changed, 13 insertions(+), 60 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 27b2bf9b70e..55489da784c 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -125,6 +125,14 @@ ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
+# This definition is necessary to work around a bug with Intellisense described
+# here: http://tinyurl.com/2cb428. Syntax highlighting is important for proper
+# debugger functionality.
+IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
+ MESSAGE(STATUS "Detected 64-bit platform.")
+ ADD_DEFINITIONS("-D_WIN64")
+ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)
+
IF(EMBED_MANIFESTS)
# Search for the tools (mt, makecat, signtool) necessary for embedding
# manifests and signing executables with the MySQL AB authenticode cert.
diff --git a/include/config-win.h b/include/config-win.h
index 45bfeb5ba26..e5abe580b3f 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -254,60 +254,6 @@ inline double ulonglong2double(ulonglong value)
#define STACK_DIRECTION -1
-
-/* Optimized store functions for Intel x86 */
-
-#ifndef _WIN64
-#define sint2korr(A) (*((int16 *) (A)))
-#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
- (((uint32) 255L << 24) | \
- (((uint32) (uchar) (A)[2]) << 16) |\
- (((uint32) (uchar) (A)[1]) << 8) | \
- ((uint32) (uchar) (A)[0])) : \
- (((uint32) (uchar) (A)[2]) << 16) |\
- (((uint32) (uchar) (A)[1]) << 8) | \
- ((uint32) (uchar) (A)[0])))
-#define sint4korr(A) (*((long *) (A)))
-#define uint2korr(A) (*((uint16 *) (A)))
-/*
- ATTENTION !
-
- Please, note, uint3korr reads 4 bytes (not 3) !
- It means, that you have to provide enough allocated space !
-*/
-#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
-#define uint4korr(A) (*((unsigned long *) (A)))
-#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
- (((uint32) ((uchar) (A)[1])) << 8) +\
- (((uint32) ((uchar) (A)[2])) << 16) +\
- (((uint32) ((uchar) (A)[3])) << 24)) +\
- (((ulonglong) ((uchar) (A)[4])) << 32))
-#define uint8korr(A) (*((ulonglong *) (A)))
-#define sint8korr(A) (*((longlong *) (A)))
-#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
-#define int3store(T,A) { *(T)= (uchar) ((A));\
- *(T+1)=(uchar) (((uint) (A) >> 8));\
- *(T+2)=(uchar) (((A) >> 16)); }
-#define int4store(T,A) *((long *) (T))= (long) (A)
-#define int5store(T,A) { *(T)= (uchar)((A));\
- *((T)+1)=(uchar) (((A) >> 8));\
- *((T)+2)=(uchar) (((A) >> 16));\
- *((T)+3)=(uchar) (((A) >> 24)); \
- *((T)+4)=(uchar) (((A) >> 32)); }
-#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
-
-#define doubleget(V,M) do { *((long *) &V) = *((long*) M); \
- *(((long *) &V)+1) = *(((long*) M)+1); } while(0)
-#define doublestore(T,V) do { *((long *) T) = *((long*) &V); \
- *(((long *) T)+1) = *(((long*) &V)+1); } while(0)
-#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
-#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float))
-#define floatget(V,M) memcpy((byte*)(&V), (byte*)(M), sizeof(float))
-#define float8get(V,M) doubleget((V),(M))
-#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
-#define float8store(V,M) doublestore((V),(M))
-#endif /* _WIN64 */
-
#define HAVE_PERROR
#define HAVE_VFPRINT
#define HAVE_RENAME /* Have rename() as function */
diff --git a/include/my_global.h b/include/my_global.h
index 08877300d8a..e05100fa288 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1053,7 +1053,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
*/
/* Optimized store functions for Intel x86 */
-#if defined(__i386__) && !defined(_WIN64)
+#if defined(__i386__) || (defined(_WIN32) && !defined(_WIN64))
#define sint2korr(A) (*((int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \
@@ -1065,7 +1065,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
((uint32) (uchar) (A)[0])))
#define sint4korr(A) (*((long *) (A)))
#define uint2korr(A) (*((uint16 *) (A)))
-#ifdef HAVE_purify
+#if defined(HAVE_purify) && !defined(_WIN32)
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16))
@@ -1077,7 +1077,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
It means, that you have to provide enough allocated space !
*/
#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
-#endif
+#endif /* HAVE_purify && !_WIN32 */
#define uint4korr(A) (*((uint32 *) (A)))
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
@@ -1116,9 +1116,8 @@ do { doubleget_union _tmp; \
#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float))
#define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
-#endif /* __i386__ */
+#else
-#ifndef sint2korr
/*
We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines
were done before)
@@ -1243,7 +1242,7 @@ do { doubleget_union _tmp; \
#define float8store(V,M) doublestore((V),(M))
#endif /* WORDS_BIGENDIAN */
-#endif /* sint2korr */
+#endif /* __i386__ OR _WIN32 AND !_WIN64 */
/*
Macro for reading 32-bit integer from network byte order (big-endian)
From 52d337bae802ec916ebf94aa16ba6ae996246861 Mon Sep 17 00:00:00 2001
From: "iggy@alf.(none)" <>
Date: Thu, 28 Feb 2008 23:53:01 -0500
Subject: [PATCH 07/28] Bug #24992 Enabling Shared Memory support on Windows
x64 causes client to fail - Mistaken macro defintions cause mysys to read
packets in the wrong order.
---
include/my_global.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/my_global.h b/include/my_global.h
index e05100fa288..f290b690630 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1053,7 +1053,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
*/
/* Optimized store functions for Intel x86 */
-#if defined(__i386__) || (defined(_WIN32) && !defined(_WIN64))
+#if defined(__i386__) || defined(_WIN32)
#define sint2korr(A) (*((int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \
@@ -1242,7 +1242,7 @@ do { doubleget_union _tmp; \
#define float8store(V,M) doublestore((V),(M))
#endif /* WORDS_BIGENDIAN */
-#endif /* __i386__ OR _WIN32 AND !_WIN64 */
+#endif /* __i386__ OR _WIN32 */
/*
Macro for reading 32-bit integer from network byte order (big-endian)
From ab30949123be35e10bc368cdc60d8731ad9ab2a0 Mon Sep 17 00:00:00 2001
From: "kent@mysql.com/kent-amd64.(none)" <>
Date: Sat, 1 Mar 2008 18:25:41 +0100
Subject: [PATCH 08/28] mysql.spec.sh: - Aligned copyright headers and text
with 5.0 - Don't strip binaries on SuSE 9 - Formatting alignment with
spec file in 5.0 - Run full test on "normal" binary, and less on "Max" -
Let test runs on "Max" identify the runs with "max" and "max+ps"
---
support-files/mysql.spec.sh | 92 ++++++++++++++++++++++++-------------
1 file changed, 60 insertions(+), 32 deletions(-)
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index b28af51d43e..1a737b70083 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -1,4 +1,22 @@
-%define mysql_version @VERSION@
+# Copyright (C) 2000-2007 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
+# MA 02110-1301 USA.
+
+%define mysql_version @VERSION@
+%define mysql_vendor MySQL AB
+
# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x)
# to enable static linking (off by default)
%{?_with_static:%define STATIC_BUILD 1}
@@ -9,7 +27,7 @@
%define release 0.glibc23
%endif
%define license GPL
-%define mysqld_user mysql
+%define mysqld_user mysql
%define mysqld_group mysql
%define server_suffix -standard
%define mysqldatadir /var/lib/mysql
@@ -20,6 +38,23 @@
%define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
+# On SuSE 9 no separate "debuginfo" package is built. To enable basic
+# debugging on that platform, we don't strip binaries on SuSE 9. We
+# disable the strip of binaries by redefining the RPM macro
+# "__os_install_post" leaving out the script calls that normally does
+# this. We do this in all cases, as on platforms where "debuginfo" is
+# created, a script "find-debuginfo.sh" will be called that will do
+# the strip anyway, part of separating the executable and debug
+# information into separate files put into separate packages.
+#
+# Some references (shows more advanced conditional usage):
+# http://www.redhat.com/archives/rpm-list/2001-November/msg00257.html
+# http://www.redhat.com/archives/rpm-list/2003-February/msg00275.html
+# http://www.redhat.com/archives/rhl-devel-list/2004-January/msg01546.html
+# http://lists.opensuse.org/archive/opensuse-commit/2006-May/1171.html
+
+%define __os_install_post /usr/lib/rpm/brp-compress
+
Name: MySQL
Summary: MySQL: a very fast and reliable SQL database server
Group: Applications/Databases
@@ -29,7 +64,7 @@ License: %{license}
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz
URL: http://www.mysql.com/
Packager: MySQL Production Engineering Team
-Vendor: MySQL AB
+Vendor: %{mysql_vendor}
Provides: msqlormysql MySQL-server mysql
BuildRequires: ncurses-devel
Obsoletes: mysql
@@ -46,12 +81,9 @@ is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
MySQL AB.
-The MySQL software has Dual Licensing, which means you can use the MySQL
-software free of charge under the GNU General Public License
-(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
-licenses from MySQL AB if you do not wish to be bound by the terms of
-the GPL. See the chapter "Licensing and Support" in the manual for
-further info.
+Copyright (C) 2000-2007 MySQL AB
+This software comes with ABSOLUTELY NO WARRANTY. This is free software,
+and you are welcome to modify and redistribute it under the GPL license.
The MySQL web site (http://www.mysql.com/) provides the latest
news and information about the MySQL software. Also please see the
@@ -71,12 +103,9 @@ is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
MySQL AB.
-The MySQL software has Dual Licensing, which means you can use the MySQL
-software free of charge under the GNU General Public License
-(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
-licenses from MySQL AB if you do not wish to be bound by the terms of
-the GPL. See the chapter "Licensing and Support" in the manual for
-further info.
+Copyright (C) 2000-2007 MySQL AB
+This software comes with ABSOLUTELY NO WARRANTY. This is free software,
+and you are welcome to modify and redistribute it under the GPL license.
The MySQL web site (http://www.mysql.com/) provides the latest
news and information about the MySQL software. Also please see the
@@ -86,7 +115,7 @@ This package includes the MySQL server binary (incl. InnoDB) as well
as related utilities to run and administrate a MySQL server.
If you want to access and work with the database, you have to install
-package "MySQL-client" as well!
+the package "MySQL-client" as well!
%package client
Summary: MySQL - Client
@@ -253,7 +282,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--includedir=%{_includedir} \
--mandir=%{_mandir} \
--enable-thread-safe-client \
- --with-readline ;
+ --with-readline ; \
# Add this for more debugging support
# --with-debug
# Add this for MyISAM RAID support:
@@ -319,7 +348,10 @@ then
cp -fp config.log "$MYSQL_MAXCONFLOG_DEST"
fi
-make test-bt
+( cd mysql-test
+ perl ./mysql-test-run.pl --comment="max" --force --report-features
+ perl ./mysql-test-run.pl --comment="max+ps" --force --ps-protocol
+ true )
# Save mysqld-max
./libtool --mode=execute cp sql/mysqld sql/mysqld-max
@@ -332,7 +364,7 @@ make test-bt
(cd ndb; make install DESTDIR=$RBR)
# Install embedded server library in the build root
-install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/
+install -m644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/
# Include libgcc.a in the devel subpackage (BUG 4921)
if expr "$CC" : ".*gcc.*" > /dev/null ;
@@ -341,7 +373,7 @@ then
if [ -f $libgcc ]
then
%define have_libgcc 1
- install -m 644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a
+ install -m644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a
fi
fi
@@ -382,10 +414,8 @@ then
cp -fp config.log "$MYSQL_CONFLOG_DEST"
fi
-( cd mysql-test
- perl ./mysql-test-run.pl --force --report-features
- perl ./mysql-test-run.pl --force --ps-protocol
- true )
+echo "# standard"
+make test-bt
%install
RBR=$RPM_BUILD_ROOT
@@ -400,7 +430,6 @@ install -d $RBR%{_libdir}
install -d $RBR%{_mandir}
install -d $RBR%{_sbindir}
-
# Install all binaries stripped
make install-strip DESTDIR=$RBR benchdir_root=%{_datadir}
@@ -414,12 +443,12 @@ install -s -m755 $MBD/sql/mysqld-max $RBR%{_sbindir}/mysqld-max
install -s -m755 $MBD/extra/perror.ndb $RBR%{_bindir}/perror
# install symbol files ( for stack trace resolution)
-install -m644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym
-install -m644 $MBD/sql/mysqld.sym $RBR%{_libdir}/mysql/mysqld.sym
+install -m 644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym
+install -m 644 $MBD/sql/mysqld.sym $RBR%{_libdir}/mysql/mysqld.sym
# Install logrotate and autostart
-install -m644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
-install -m755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
+install -m 644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
+install -m 755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
# Create a symlink "rcmysql", pointing to the init.script. SuSE users
# will appreciate that, as all services usually offer this.
@@ -451,7 +480,7 @@ fi
mysql_datadir=%{mysqldatadir}
# Create data directory if needed
-if test ! -d $mysql_datadir; then mkdir -m755 $mysql_datadir; fi
+if test ! -d $mysql_datadir; then mkdir -m 755 $mysql_datadir; fi
if test ! -d $mysql_datadir/mysql; then mkdir $mysql_datadir/mysql; fi
if test ! -d $mysql_datadir/test; then mkdir $mysql_datadir/test; fi
@@ -493,12 +522,11 @@ chmod -R og-rw $mysql_datadir/mysql
# Allow safe_mysqld to start mysqld and print a message before we exit
sleep 2
-
%post ndb-storage
mysql_clusterdir=/var/lib/mysql-cluster
# Create cluster directory if needed
-if test ! -d $mysql_clusterdir; then mkdir -m755 $mysql_clusterdir; fi
+if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi
%post Max
From 40d4d3f1a709b14c29e593b4018d29dbcdc54935 Mon Sep 17 00:00:00 2001
From: "hhunger@hh-nb.hungers" <>
Date: Mon, 3 Mar 2008 15:58:56 +0100
Subject: [PATCH 09/28] As result of WL#4204 all charset tests are now
disabled.
---
mysql-test/suite/funcs_2/t/disabled.def | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 mysql-test/suite/funcs_2/t/disabled.def
diff --git a/mysql-test/suite/funcs_2/t/disabled.def b/mysql-test/suite/funcs_2/t/disabled.def
new file mode 100644
index 00000000000..c903662e052
--- /dev/null
+++ b/mysql-test/suite/funcs_2/t/disabled.def
@@ -0,0 +1,6 @@
+# Disabled by hhunger (2008-03-03) due to WL4204
+innodb_charset : Due to bug#20447
+myisam_charset : Due to bug#20477
+memory_charset : Due to bug#20447
+ndb_charset : Due to bug#20447
+
From 773855c8006b21dd9c5b1161130fbda57da6f697 Mon Sep 17 00:00:00 2001
From: "joerg@trift2." <>
Date: Tue, 4 Mar 2008 22:00:53 +0100
Subject: [PATCH 10/28] scripts/CMakeLists.txt : Treat
"mysql_upgrade_shell" the same way as all the other scripts.
---
scripts/CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index d7bcb8fd4e7..8aca7792e7c 100755
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -73,6 +73,9 @@ CONFIGURE_FILE(mysql_secure_installation.pl.in
CONFIGURE_FILE(mysql_tableinfo.sh
scripts/mysql_tableinfo.pl ESCAPE_QUOTES @ONLY)
+CONFIGURE_FILE(mysql_upgrade_shell.sh
+ scripts/mysql_upgrade_shell.pl ESCAPE_QUOTES @ONLY)
+
CONFIGURE_FILE(mysqld_multi.sh
scripts/mysqld_multi.pl ESCAPE_QUOTES @ONLY)
From 00160fe9e9ae3c0c1836dbc428fd33c90699df72 Mon Sep 17 00:00:00 2001
From: "joerg@trift2." <>
Date: Wed, 5 Mar 2008 14:03:05 +0100
Subject: [PATCH 11/28] Include "mysql_upgrade_shell.pl" in a binary
distribution on Windows.
---
scripts/make_win_bin_dist | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist
index 56510dc857b..2b2477c52cd 100755
--- a/scripts/make_win_bin_dist
+++ b/scripts/make_win_bin_dist
@@ -337,6 +337,7 @@ mysql_explain_log.pl \
mysql_install_db.pl \
mysql_secure_installation.pl \
mysql_tableinfo.pl \
+mysql_upgrade_shell.pl \
mysqld_multi.pl \
mysqldumpslow.pl \
mysqlhotcopy.pl \
From 6217dd728a142253a1302067196154bf57319ca9 Mon Sep 17 00:00:00 2001
From: "cmiller@zippy.cornsilk.net" <>
Date: Wed, 5 Mar 2008 09:33:32 -0500
Subject: [PATCH 12/28] Bug#33464: DROP FUNCTION caused a crash
The cause of the crash is an assertion failure that we do not emit
an error message (grant not found) and then return "ok". The
assertion is valid, and we were ignoring the buggy behavior prior
to the "Diagnostics" result-verification.
Use an error handler to mutate innocuous missing-grant errors, when
removing routines, into warnings.
---
mysql-test/r/drop.result | 39 +++++++++++++++
mysql-test/t/drop.test | 62 +++++++++++++++++++++++
sql/sql_acl.cc | 105 +++++++++++++++++++++++++++++++--------
3 files changed, 184 insertions(+), 22 deletions(-)
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index 71d6fcc7cd0..b4f6395819f 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -91,4 +91,43 @@ create table mysql_test.`#sql-347f_7` (f1 int);
create table mysql_test.`#sql-347f_8` (f1 int);
drop table mysql_test.`#sql-347f_8`;
drop database mysql_test;
+CREATE DATABASE dbbug33464;
+CREATE USER 'userbug33464'@'localhost';
+GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
+
+userbug33464@localhost dbbug33464
+DROP PROCEDURE IF EXISTS sp3;
+DROP FUNCTION IF EXISTS fn1;
+CREATE PROCEDURE sp3(v1 char(20))
+BEGIN
+SELECT * from dbbug33464.t6 where t6.f2= 'xyz';
+END//
+CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER
+BEGIN
+return 1;
+END//
+CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER
+BEGIN
+return 2;
+END//
+USE dbbug33464;
+
+root@localhost dbbug33464
+SELECT fn1();
+fn1()
+1
+SELECT fn2();
+fn2()
+2
+DROP USER 'userbug33464'@'localhost';
+DROP FUNCTION fn1;
+Warnings:
+Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn1'
+DROP FUNCTION fn2;
+Warnings:
+Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2'
+DROP PROCEDURE sp3;
+DROP USER 'userbug33464'@'localhost';
+use test;
+DROP DATABASE dbbug33464;
End of 5.1 tests
diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test
index a79044436eb..3dd180f2d78 100644
--- a/mysql-test/t/drop.test
+++ b/mysql-test/t/drop.test
@@ -134,4 +134,66 @@ drop table mysql_test.`#sql-347f_8`;
copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm $MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm;
drop database mysql_test;
+
+#
+# Bug#33464: DROP FUNCTION caused a crash.
+#
+CREATE DATABASE dbbug33464;
+CREATE USER 'userbug33464'@'localhost';
+
+GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
+
+--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
+connect (connbug33464, localhost, userbug33464, , dbbug33464);
+--source suite/funcs_1/include/show_connection.inc
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS sp3;
+DROP FUNCTION IF EXISTS fn1;
+--enable_warnings
+
+delimiter //;
+CREATE PROCEDURE sp3(v1 char(20))
+BEGIN
+ SELECT * from dbbug33464.t6 where t6.f2= 'xyz';
+END//
+delimiter ;//
+
+delimiter //;
+CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER
+BEGIN
+ return 1;
+END//
+delimiter ;//
+
+delimiter //;
+CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER
+BEGIN
+ return 2;
+END//
+delimiter ;//
+
+disconnect connbug33464;
+
+# cleanup
+connection default;
+USE dbbug33464;
+--source suite/funcs_1/include/show_connection.inc
+
+SELECT fn1();
+SELECT fn2();
+
+--error 0, ER_CANNOT_USER
+DROP USER 'userbug33464'@'localhost';
+
+DROP FUNCTION fn1;
+DROP FUNCTION fn2;
+DROP PROCEDURE sp3;
+
+--error 0, ER_CANNOT_USER
+DROP USER 'userbug33464'@'localhost';
+
+use test;
+DROP DATABASE dbbug33464;
+
--echo End of 5.1 tests
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 0d563ab9051..b9d72998933 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -2779,6 +2779,10 @@ table_error:
}
+/**
+ @retval 0 success
+ @retval -1 error
+*/
static int replace_routine_table(THD *thd, GRANT_NAME *grant_name,
TABLE *table, const LEX_USER &combo,
const char *db, const char *routine_name,
@@ -2800,14 +2804,11 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name,
thd->security_ctx->host_or_ip, NullS);
/*
- The following should always succeed as new users are created before
- this function is called!
+ New users are created before this function is called.
+
+ There may be some cases where a routine's definer is removed but the
+ routine remains.
*/
- if (!find_acl_user(combo.host.str, combo.user.str, FALSE))
- {
- my_error(ER_PASSWORD_NO_MATCH,MYF(0));
- DBUG_RETURN(-1);
- }
table->use_all_columns();
restore_record(table, s->default_values); // Get empty record
@@ -3321,7 +3322,8 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
}
if (replace_routine_table(thd, grant_name, tables[1].table, *Str,
- db_name, table_name, is_proc, rights, revoke_grant))
+ db_name, table_name, is_proc, rights,
+ revoke_grant) != 0)
{
result= TRUE;
continue;
@@ -5949,11 +5951,11 @@ bool mysql_revoke_all(THD *thd, List &list)
if (!strcmp(lex_user->user.str,user) &&
!strcmp(lex_user->host.str, host))
{
- if (!replace_routine_table(thd,grant_proc,tables[4].table,*lex_user,
+ if (replace_routine_table(thd,grant_proc,tables[4].table,*lex_user,
grant_proc->db,
grant_proc->tname,
is_proc,
- ~(ulong)0, 1))
+ ~(ulong)0, 1) == 0)
{
revoked= 1;
continue;
@@ -5979,17 +5981,73 @@ bool mysql_revoke_all(THD *thd, List &list)
}
-/*
- Revoke privileges for all users on a stored procedure
- SYNOPSIS
- sp_revoke_privileges()
+
+/**
+ If the defining user for a routine does not exist, then the ACL lookup
+ code should raise two errors which we should intercept. We convert the more
+ descriptive error into a warning, and consume the other.
+
+ If any other errors are raised, then we set a flag that should indicate
+ that there was some failure we should complain at a higher level.
+*/
+class Silence_routine_definer_errors : public Internal_error_handler
+{
+public:
+ Silence_routine_definer_errors()
+ : is_grave(FALSE)
+ {}
+
+ virtual ~Silence_routine_definer_errors()
+ {}
+
+ virtual bool handle_error(uint sql_errno, const char *message,
+ MYSQL_ERROR::enum_warning_level level,
+ THD *thd);
+
+ bool has_errors() { return is_grave; }
+
+private:
+ bool is_grave;
+};
+
+bool
+Silence_routine_definer_errors::handle_error(uint sql_errno,
+ const char *message,
+ MYSQL_ERROR::enum_warning_level level,
+ THD *thd)
+{
+ if (level == MYSQL_ERROR::WARN_LEVEL_ERROR)
+ {
+ switch (sql_errno)
+ {
+ case ER_NONEXISTING_PROC_GRANT:
+ /* Convert the error into a warning. */
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, sql_errno, message);
+ return TRUE;
+ default:
+ is_grave= TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
+/**
+ Revoke privileges for all users on a stored procedure. Use an error handler
+ that converts errors about missing grants into warnings.
+
+ @param
thd The current thread.
+ @param
db DB of the stored procedure
+ @param
name Name of the stored procedure
- RETURN
+ @retval
0 OK.
+ @retval
< 0 Error. Error message not yet sent.
*/
@@ -6000,11 +6058,15 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
int result;
TABLE_LIST tables[GRANT_TABLES];
HASH *hash= is_proc ? &proc_priv_hash : &func_priv_hash;
+ Silence_routine_definer_errors error_handler;
DBUG_ENTER("sp_revoke_privileges");
if ((result= open_grant_tables(thd, tables)))
DBUG_RETURN(result != 1);
+ /* Be sure to pop this before exiting this scope! */
+ thd->push_internal_handler(&error_handler);
+
rw_wrlock(&LOCK_grant);
VOID(pthread_mutex_lock(&acl_cache->lock));
@@ -6031,14 +6093,14 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
grant_proc->host.hostname : (char*)"";
lex_user.host.length= grant_proc->host.hostname ?
strlen(grant_proc->host.hostname) : 0;
- if (!replace_routine_table(thd,grant_proc,tables[4].table,lex_user,
- grant_proc->db, grant_proc->tname,
- is_proc, ~(ulong)0, 1))
+
+ if (replace_routine_table(thd,grant_proc,tables[4].table,lex_user,
+ grant_proc->db, grant_proc->tname,
+ is_proc, ~(ulong)0, 1) == 0)
{
revoked= 1;
continue;
}
- result= -1; // Something went wrong
}
counter++;
}
@@ -6048,10 +6110,9 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
- if (result)
- my_message(ER_REVOKE_GRANTS, ER(ER_REVOKE_GRANTS), MYF(0));
+ thd->pop_internal_handler();
- DBUG_RETURN(result);
+ DBUG_RETURN(error_handler.has_errors());
}
From c1c9cbe0d8b1581e3a2f4d7e8abd98285267c90c Mon Sep 17 00:00:00 2001
From: "cmiller@zippy.cornsilk.net" <>
Date: Wed, 5 Mar 2008 11:23:58 -0500
Subject: [PATCH 13/28] Bug#34726: open_tables() crashes server if running with
--debug
The DBUG code emits the current value of the proc_info member of THD,
which may be set to NULL. It was wrong to dereference that value
with the format string %s without verifying that it was valid.
Now, insert an inline test that substitutes the string "(null)" for
NULL pointers.
---
sql/sql_class.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 75376c53f68..ead7439bc81 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -253,7 +253,8 @@ const char *set_thd_proc_info(THD *thd, const char *info,
const unsigned int calling_line)
{
const char *old_info= thd->proc_info;
- DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line, info));
+ DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line,
+ (info != NULL) ? info : "(null)"));
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
thd->profiling.status_change(info, calling_function, calling_file, calling_line);
#endif
From 8dacb206ae602ecf769a878f10febce46cc91896 Mon Sep 17 00:00:00 2001
From: "cmiller@zippy.cornsilk.net" <>
Date: Wed, 5 Mar 2008 14:18:35 -0500
Subject: [PATCH 14/28] Move test that has more to do with grants than DROP.
We shouldn't have grant warnings on embedded server.
---
mysql-test/r/drop.result | 39 ------------------------
mysql-test/r/grant.result | 39 ++++++++++++++++++++++++
mysql-test/t/drop.test | 62 ---------------------------------------
mysql-test/t/grant.test | 62 +++++++++++++++++++++++++++++++++++++++
4 files changed, 101 insertions(+), 101 deletions(-)
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index b4f6395819f..71d6fcc7cd0 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -91,43 +91,4 @@ create table mysql_test.`#sql-347f_7` (f1 int);
create table mysql_test.`#sql-347f_8` (f1 int);
drop table mysql_test.`#sql-347f_8`;
drop database mysql_test;
-CREATE DATABASE dbbug33464;
-CREATE USER 'userbug33464'@'localhost';
-GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
-
-userbug33464@localhost dbbug33464
-DROP PROCEDURE IF EXISTS sp3;
-DROP FUNCTION IF EXISTS fn1;
-CREATE PROCEDURE sp3(v1 char(20))
-BEGIN
-SELECT * from dbbug33464.t6 where t6.f2= 'xyz';
-END//
-CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER
-BEGIN
-return 1;
-END//
-CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER
-BEGIN
-return 2;
-END//
-USE dbbug33464;
-
-root@localhost dbbug33464
-SELECT fn1();
-fn1()
-1
-SELECT fn2();
-fn2()
-2
-DROP USER 'userbug33464'@'localhost';
-DROP FUNCTION fn1;
-Warnings:
-Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn1'
-DROP FUNCTION fn2;
-Warnings:
-Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2'
-DROP PROCEDURE sp3;
-DROP USER 'userbug33464'@'localhost';
-use test;
-DROP DATABASE dbbug33464;
End of 5.1 tests
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 0df3ac6de8a..d99de0beda6 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1283,4 +1283,43 @@ CALL mysqltest1.test();
DROP DATABASE mysqltest1;
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
FLUSH PRIVILEGES;
+CREATE DATABASE dbbug33464;
+CREATE USER 'userbug33464'@'localhost';
+GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
+
+userbug33464@localhost dbbug33464
+DROP PROCEDURE IF EXISTS sp3;
+DROP FUNCTION IF EXISTS fn1;
+CREATE PROCEDURE sp3(v1 char(20))
+BEGIN
+SELECT * from dbbug33464.t6 where t6.f2= 'xyz';
+END//
+CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER
+BEGIN
+return 1;
+END//
+CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER
+BEGIN
+return 2;
+END//
+USE dbbug33464;
+
+root@localhost dbbug33464
+SELECT fn1();
+fn1()
+1
+SELECT fn2();
+fn2()
+2
+DROP USER 'userbug33464'@'localhost';
+DROP FUNCTION fn1;
+Warnings:
+Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn1'
+DROP FUNCTION fn2;
+Warnings:
+Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2'
+DROP PROCEDURE sp3;
+DROP USER 'userbug33464'@'localhost';
+use test;
+DROP DATABASE dbbug33464;
End of 5.1 tests
diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test
index 3dd180f2d78..a79044436eb 100644
--- a/mysql-test/t/drop.test
+++ b/mysql-test/t/drop.test
@@ -134,66 +134,4 @@ drop table mysql_test.`#sql-347f_8`;
copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm $MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm;
drop database mysql_test;
-
-#
-# Bug#33464: DROP FUNCTION caused a crash.
-#
-CREATE DATABASE dbbug33464;
-CREATE USER 'userbug33464'@'localhost';
-
-GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (connbug33464, localhost, userbug33464, , dbbug33464);
---source suite/funcs_1/include/show_connection.inc
-
---disable_warnings
-DROP PROCEDURE IF EXISTS sp3;
-DROP FUNCTION IF EXISTS fn1;
---enable_warnings
-
-delimiter //;
-CREATE PROCEDURE sp3(v1 char(20))
-BEGIN
- SELECT * from dbbug33464.t6 where t6.f2= 'xyz';
-END//
-delimiter ;//
-
-delimiter //;
-CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER
-BEGIN
- return 1;
-END//
-delimiter ;//
-
-delimiter //;
-CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER
-BEGIN
- return 2;
-END//
-delimiter ;//
-
-disconnect connbug33464;
-
-# cleanup
-connection default;
-USE dbbug33464;
---source suite/funcs_1/include/show_connection.inc
-
-SELECT fn1();
-SELECT fn2();
-
---error 0, ER_CANNOT_USER
-DROP USER 'userbug33464'@'localhost';
-
-DROP FUNCTION fn1;
-DROP FUNCTION fn2;
-DROP PROCEDURE sp3;
-
---error 0, ER_CANNOT_USER
-DROP USER 'userbug33464'@'localhost';
-
-use test;
-DROP DATABASE dbbug33464;
-
--echo End of 5.1 tests
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 16cccd1a1f4..eb02433c71e 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1377,4 +1377,66 @@ RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
FLUSH PRIVILEGES;
+#
+# Bug#33464: DROP FUNCTION caused a crash.
+#
+CREATE DATABASE dbbug33464;
+CREATE USER 'userbug33464'@'localhost';
+
+GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
+
+--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
+connect (connbug33464, localhost, userbug33464, , dbbug33464);
+--source suite/funcs_1/include/show_connection.inc
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS sp3;
+DROP FUNCTION IF EXISTS fn1;
+--enable_warnings
+
+delimiter //;
+CREATE PROCEDURE sp3(v1 char(20))
+BEGIN
+ SELECT * from dbbug33464.t6 where t6.f2= 'xyz';
+END//
+delimiter ;//
+
+delimiter //;
+CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER
+BEGIN
+ return 1;
+END//
+delimiter ;//
+
+delimiter //;
+CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER
+BEGIN
+ return 2;
+END//
+delimiter ;//
+
+disconnect connbug33464;
+
+# cleanup
+connection default;
+USE dbbug33464;
+--source suite/funcs_1/include/show_connection.inc
+
+SELECT fn1();
+SELECT fn2();
+
+--error 0, ER_CANNOT_USER
+DROP USER 'userbug33464'@'localhost';
+
+DROP FUNCTION fn1;
+DROP FUNCTION fn2;
+DROP PROCEDURE sp3;
+
+--error 0, ER_CANNOT_USER
+DROP USER 'userbug33464'@'localhost';
+
+use test;
+DROP DATABASE dbbug33464;
+
+
--echo End of 5.1 tests
From b077981fbb76c095598eb1385b8c4b0eadd986a5 Mon Sep 17 00:00:00 2001
From: "cmiller@zippy.cornsilk.net" <>
Date: Thu, 6 Mar 2008 14:07:49 -0500
Subject: [PATCH 15/28] Bug#28269: FEDERATED engine fails to quote reserved
words for \ field names
Add a test that proves the bug is fixed. This doesn't add any
new server code.
---
mysql-test/r/federated.result | 30 +++++++++++++++++++++++++++---
mysql-test/t/federated.test | 21 +++++++++++++++++++++
2 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result
index 00287338459..f43e1efc643 100644
--- a/mysql-test/r/federated.result
+++ b/mysql-test/r/federated.result
@@ -14,6 +14,9 @@ Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+`group` int NOT NULL default 0,
+`a\\b` int NOT NULL default 0,
+`a\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
@@ -22,6 +25,9 @@ Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+`group` int NOT NULL default 0,
+`a\\b` inT NOT NULL default 0,
+`a\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
@@ -29,6 +35,9 @@ CONNECTION='mysql://root@127.0.0.1:@/too/many/items/federated/t1';
ERROR HY000: Can't create federated table. The data source connection string 'mysql://root@127.0.0.1:@/too/many/items/federated/t1' is not in the correct format
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+`group` int NOT NULL default 0,
+`a\\b` iNt NOT NULL default 0,
+`a\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
@@ -36,6 +45,9 @@ CONNECTION='mysql://root@127.0.0.1';
ERROR HY000: Can't create federated table. The data source connection string 'mysql://root@127.0.0.1' is not in the correct format
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+`group` int NOT NULL default 0,
+`a\\b` iNT NOT NULL default 0,
+`a\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
@@ -45,6 +57,9 @@ ERROR HY000: The foreign data source you are trying to reference does not exist.
DROP TABLE federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+`group` int NOT NULL default 0,
+`a\\b` Int NOT NULL default 0,
+`a\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
@@ -54,16 +69,25 @@ ERROR HY000: Unable to connect to foreign data source: Access denied for user 'u
DROP TABLE federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+`group` int NOT NULL default 0,
+`a\\b` InT NOT NULL default 0,
+`a\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
+INSERT INTO federated.t1 (id, `group`) VALUES (3, 42);
+INSERT INTO federated.t1 (id, `a\\b`) VALUES (4, 23);
+INSERT INTO federated.t1 (id, `a\\`) VALUES (5, 1);
SELECT * FROM federated.t1;
-id name
-1 foo
-2 fee
+id group a\\b a\\ name
+1 0 0 0 foo
+2 0 0 0 fee
+3 42 0 0
+4 0 23 0
+5 0 0 1
DELETE FROM federated.t1;
DROP TABLE federated.t1;
DROP TABLE IF EXISTS federated.t2;
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index 76cb5fd4793..191bba244c3 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -6,6 +6,9 @@ connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+ `group` int NOT NULL default 0,
+ `a\\b` int NOT NULL default 0,
+ `a\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
@@ -16,6 +19,9 @@ DROP TABLE IF EXISTS federated.t1;
--error 1432
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+ `group` int NOT NULL default 0,
+ `a\\b` inT NOT NULL default 0,
+ `a\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
@@ -25,6 +31,9 @@ CREATE TABLE federated.t1 (
--error 1432
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+ `group` int NOT NULL default 0,
+ `a\\b` iNt NOT NULL default 0,
+ `a\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
@@ -34,6 +43,9 @@ CREATE TABLE federated.t1 (
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+ `group` int NOT NULL default 0,
+ `a\\\\b` iNT NOT NULL default 0,
+ `a\\\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
@@ -46,6 +58,9 @@ DROP TABLE federated.t1;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+ `group` int NOT NULL default 0,
+ `a\\\\b` Int NOT NULL default 0,
+ `a\\\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
@@ -58,6 +73,9 @@ DROP TABLE federated.t1;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
+ `group` int NOT NULL default 0,
+ `a\\\\b` InT NOT NULL default 0,
+ `a\\\\` int NOT NULL default 0,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
@@ -65,6 +83,9 @@ eval CREATE TABLE federated.t1 (
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
+INSERT INTO federated.t1 (id, `group`) VALUES (3, 42);
+INSERT INTO federated.t1 (id, `a\\b`) VALUES (4, 23);
+INSERT INTO federated.t1 (id, `a\\`) VALUES (5, 1);
SELECT * FROM federated.t1;
DELETE FROM federated.t1;
From 30091e23f94fdee9e83b616d2dc56cdcc69b18d3 Mon Sep 17 00:00:00 2001
From: "mleich@five.local.lan" <>
Date: Fri, 7 Mar 2008 17:33:07 +0100
Subject: [PATCH 16/28] WL#4203 Reorganize and fix the data dictionary tests of
testsuite funcs_1 1. Fix the following bugs Bug#30440 "datadict"
tests (all engines) fail: Character sets depend on configuration
Solution: Test variants charset_collation_* adjusted to different builds
Bug#32603 "datadict" tests (all engines) fail in "community" tree:
"PROFILING" table Solution: Excluding "PROFILING" table from queries
Bug#33654 "slow log" is missing a line Solution: Unify the content of
the fields TABLES.TABLE_ROWS and STATISTICS.CARDINALITY
within result sets Bug#34532 Some funcs_1 tests do not clean up at end of
testing Solution: DROP objects/reset global server variables modified
during testing + let tests missing implementation end before
loading of tables Bug#31421 funcs_1: ndb__datadict fails, discrepancy
between scripts and expected results Solution: Cut __datadict
tests into smaller tests + generate new results. Bug#33599
INFORMATION_SCHEMA.STATISTICS got a new column INDEX_COMMENT: tests fail (2)
Generation of new results during post merge fix Bug#33600
CHARACTER_OCTET_LENGTH is now CHARACTER_MAXIMUM_LENGTH * 4 Generation
of new results during post merge fix Bug#33631 Platform-specific replace
of CHARACTER_MAXIMUM_LENGTH broken by 4-byte encoding Generation of new
results during post merge fix + removal of platform-specific replace
routine (no more needed) 2. Restructure the tests - Test not more than one
INFORMATION_SCHEMA view per testscript - Separate tests of I_S view
layout+functionality from content related to the all time existing
databases "information_schema", "mysql" and "test" - Avoid storage engine
related variants of tests which are not sensible to storage engines at
all. 3. Reimplement or add some subtests + cleanup There is a some
probability that even the reviewed changeset - does not fix all bugs from
above or - contains new bugs which show up on some platforms <> Linux or
on one of the various build types 4. The changeset contains fixes
according to - one code review - minor bugs within testing code found
after code review (accepted by reviewer) - problems found during tests
with 5.0.56 in build environment
---
mysql-test/suite/funcs_1/README.txt | 170 +-
.../suite/funcs_1/datadict/basics_mixed1.inc | 53 +
.../suite/funcs_1/datadict/basics_mixed2.inc | 55 +
.../suite/funcs_1/datadict/basics_mixed3.inc | 42 +
.../funcs_1/datadict/charset_collation.inc | 122 +
mysql-test/suite/funcs_1/datadict/columns.inc | 87 +
.../suite/funcs_1/datadict/datadict.pre | 54 +
.../funcs_1/datadict/datadict_master.inc | 3955 -----
.../funcs_1/datadict/datadict_show_schema.inc | 57 -
.../datadict/datadict_show_table_design.inc | 28 -
.../funcs_1/datadict/datadict_tables.inc | 62 -
.../datadict/datadict_tables_error.inc | 33 -
.../datadict/datadict_tables_error_1.inc | 80 -
.../datadict/datadict_tables_error_1044.inc | 51 -
.../datadict/datadict_tables_error_1049.inc | 49 -
.../datadict/datadict_tables_error_1051.inc | 49 -
.../datadict/datadict_tables_error_1146.inc | 49 -
.../datadict/datadict_tables_error_1288.inc | 49 -
.../suite/funcs_1/datadict/is_table_query.inc | 42 +
.../suite/funcs_1/datadict/statistics.inc | 55 +
.../funcs_1/datadict/table_constraints.inc | 45 +
mysql-test/suite/funcs_1/datadict/tables1.inc | 39 +
mysql-test/suite/funcs_1/datadict/tables2.inc | 47 +
mysql-test/suite/funcs_1/include/cleanup.inc | 21 +
.../suite/funcs_1/include/create_database.inc | 6 -
.../include/create_user_lowest_priv.inc | 10 -
.../funcs_1/include/create_user_no_super.inc | 11 -
.../suite/funcs_1/include/memory_tb1.inc | 3 -
.../suite/funcs_1/include/memory_tb2.inc | 3 -
.../suite/funcs_1/include/memory_tb3.inc | 3 -
.../suite/funcs_1/include/memory_tb4.inc | 3 -
mysql-test/suite/funcs_1/include/sp_tb.inc | 4 -
.../funcs_1/r/charset_collation_1.result | 309 +
.../funcs_1/r/charset_collation_2.result | 311 +
.../funcs_1/r/charset_collation_3.result | 309 +
.../r/datadict_help_tables_build.result | 22 -
.../funcs_1/r/datadict_help_tables_dev.result | 18 -
.../suite/funcs_1/r/innodb__datadict.result | 12916 ---------------
.../suite/funcs_1/r/innodb__load.result | 1 -
.../suite/funcs_1/r/innodb_bitdata.result | 64 -
.../suite/funcs_1/r/innodb_cursors.result | 78 -
.../funcs_1/r/innodb_storedproc_02.result | 2 -
.../funcs_1/r/innodb_storedproc_03.result | 2 -
.../funcs_1/r/innodb_storedproc_06.result | 2 -
.../funcs_1/r/innodb_storedproc_07.result | 2 -
.../funcs_1/r/innodb_storedproc_08.result | 2 -
.../funcs_1/r/innodb_storedproc_10.result | 2 -
.../suite/funcs_1/r/innodb_trig_0102.result | 2 +-
.../suite/funcs_1/r/innodb_trig_03.result | 2 +-
.../suite/funcs_1/r/innodb_trig_0407.result | 2 +-
.../suite/funcs_1/r/innodb_trig_08.result | 2 +-
.../suite/funcs_1/r/innodb_trig_09.result | 2 +-
.../funcs_1/r/innodb_trig_1011ext.result | 2 +-
.../suite/funcs_1/r/innodb_trig_frkey.result | 2 +-
.../suite/funcs_1/r/innodb_views.result | 4 +-
.../suite/funcs_1/r/is_basics_mixed.result | 602 +
.../suite/funcs_1/r/is_character_sets.result | 78 +
...llation_character_set_applicability.result | 76 +
.../suite/funcs_1/r/is_collations.result | 90 +
.../funcs_1/r/is_column_privileges.result | 370 +
.../is_column_privileges_is_mysql_test.result | 37 +
mysql-test/suite/funcs_1/r/is_columns.result | 486 +
.../suite/funcs_1/r/is_columns_innodb.result | 1130 ++
.../suite/funcs_1/r/is_columns_is.result | 380 +
.../suite/funcs_1/r/is_columns_memory.result | 1076 ++
.../suite/funcs_1/r/is_columns_myisam.result | 1207 ++
.../suite/funcs_1/r/is_columns_mysql.result | 361 +
.../suite/funcs_1/r/is_columns_ndb.result | 223 +
.../funcs_1/r/is_key_column_usage.result | 370 +
mysql-test/suite/funcs_1/r/is_routines.result | 605 +
.../funcs_1/r/is_schema_privileges.result | 304 +
.../is_schema_privileges_is_mysql_test.result | 51 +
mysql-test/suite/funcs_1/r/is_schemata.result | 181 +
.../r/is_schemata_is_mysql_test.result | 42 +
.../suite/funcs_1/r/is_statistics.result | 352 +
.../suite/funcs_1/r/is_statistics_is.result | 17 +
.../funcs_1/r/is_statistics_mysql.result | 60 +
.../funcs_1/r/is_table_constraints.result | 310 +
.../funcs_1/r/is_table_constraints_is.result | 17 +
.../r/is_table_constraints_mysql.result | 37 +
.../funcs_1/r/is_table_privileges.result | 332 +
mysql-test/suite/funcs_1/r/is_tables.result | 419 +
.../suite/funcs_1/r/is_tables_innodb.result | 1063 ++
.../suite/funcs_1/r/is_tables_is.result | 771 +
.../suite/funcs_1/r/is_tables_memory.result | 1052 ++
.../suite/funcs_1/r/is_tables_myisam.result | 1092 ++
.../suite/funcs_1/r/is_tables_mysql.result | 424 +
.../suite/funcs_1/r/is_tables_ndb.result | 560 +
mysql-test/suite/funcs_1/r/is_triggers.result | 212 +
.../suite/funcs_1/r/is_user_privileges.result | 400 +
mysql-test/suite/funcs_1/r/is_views.result | 238 +
.../suite/funcs_1/r/memory__datadict.result | 12814 ---------------
.../suite/funcs_1/r/memory__load.result | 1 -
.../suite/funcs_1/r/memory_bitdata.result | 65 -
.../suite/funcs_1/r/memory_cursors.result | 75 -
.../funcs_1/r/memory_storedproc_02.result | 2 -
.../funcs_1/r/memory_storedproc_03.result | 2 -
.../funcs_1/r/memory_storedproc_06.result | 2 -
.../funcs_1/r/memory_storedproc_07.result | 2 -
.../funcs_1/r/memory_storedproc_08.result | 2 -
.../funcs_1/r/memory_storedproc_10.result | 2 -
.../suite/funcs_1/r/memory_trig_0102.result | 4 +-
.../suite/funcs_1/r/memory_trig_03.result | 4 +-
.../suite/funcs_1/r/memory_trig_0407.result | 4 +-
.../suite/funcs_1/r/memory_trig_08.result | 4 +-
.../suite/funcs_1/r/memory_trig_09.result | 4 +-
.../funcs_1/r/memory_trig_1011ext.result | 4 +-
.../suite/funcs_1/r/memory_views.result | 8 +-
.../suite/funcs_1/r/myisam__datadict.result | 13068 ----------------
.../suite/funcs_1/r/myisam__load.result | 1 -
.../suite/funcs_1/r/myisam_bitdata.result | 73 -
.../suite/funcs_1/r/myisam_cursors.result | 81 -
.../funcs_1/r/myisam_storedproc_02.result | 2 -
.../funcs_1/r/myisam_storedproc_03.result | 2 -
.../funcs_1/r/myisam_storedproc_06.result | 2 -
.../funcs_1/r/myisam_storedproc_07.result | 2 -
.../funcs_1/r/myisam_storedproc_08.result | 2 -
.../funcs_1/r/myisam_storedproc_10.result | 2 -
.../suite/funcs_1/r/myisam_trig_0102.result | 2 +-
.../suite/funcs_1/r/myisam_trig_03.result | 2 +-
.../suite/funcs_1/r/myisam_trig_0407.result | 2 +-
.../suite/funcs_1/r/myisam_trig_08.result | 2 +-
.../suite/funcs_1/r/myisam_trig_09.result | 2 +-
.../funcs_1/r/myisam_trig_1011ext.result | 2 +-
.../suite/funcs_1/r/myisam_views.result | 4 +-
.../suite/funcs_1/storedproc/load_sp_tb.inc | 3 -
.../funcs_1/storedproc/storedproc_02.inc | 0
.../funcs_1/storedproc/storedproc_03.inc | 0
.../funcs_1/storedproc/storedproc_06.inc | 0
.../funcs_1/storedproc/storedproc_07.inc | 0
.../funcs_1/storedproc/storedproc_08.inc | 0
.../funcs_1/storedproc/storedproc_08_show.inc | 0
.../funcs_1/storedproc/storedproc_10.inc | 0
.../suite/funcs_1/t/charset_collation_1.test | 30 +
.../suite/funcs_1/t/charset_collation_2.test | 24 +
.../suite/funcs_1/t/charset_collation_3.test | 24 +
.../funcs_1/t/datadict_help_tables_build.test | 73 -
.../funcs_1/t/datadict_help_tables_dev.test | 27 -
.../suite/funcs_1/t/innodb__datadict.test | 11 -
mysql-test/suite/funcs_1/t/innodb__load.test | 47 -
.../suite/funcs_1/t/innodb_bitdata.test | 29 +-
.../suite/funcs_1/t/innodb_cursors.test | 27 +-
.../suite/funcs_1/t/innodb_storedproc_02.test | 0
.../suite/funcs_1/t/innodb_storedproc_03.test | 0
.../suite/funcs_1/t/innodb_storedproc_06.test | 0
.../suite/funcs_1/t/innodb_storedproc_07.test | 0
.../suite/funcs_1/t/innodb_storedproc_08.test | 0
.../suite/funcs_1/t/innodb_storedproc_10.test | 0
.../suite/funcs_1/t/innodb_trig_0102.test | 26 +-
.../suite/funcs_1/t/innodb_trig_03.test | 26 +-
.../suite/funcs_1/t/innodb_trig_0407.test | 26 +-
.../suite/funcs_1/t/innodb_trig_08.test | 26 +-
.../suite/funcs_1/t/innodb_trig_09.test | 26 +-
.../suite/funcs_1/t/innodb_trig_1011ext.test | 26 +-
.../suite/funcs_1/t/innodb_trig_frkey.test | 26 +-
mysql-test/suite/funcs_1/t/innodb_views.test | 46 +-
.../suite/funcs_1/t/is_basics_mixed.test | 503 +
.../suite/funcs_1/t/is_character_sets.test | 107 +
...collation_character_set_applicability.test | 108 +
mysql-test/suite/funcs_1/t/is_collations.test | 114 +
.../suite/funcs_1/t/is_column_privileges.test | 351 +
.../t/is_column_privileges_is_mysql_test.test | 58 +
mysql-test/suite/funcs_1/t/is_columns.test | 444 +
.../suite/funcs_1/t/is_columns_innodb.test | 21 +
mysql-test/suite/funcs_1/t/is_columns_is.test | 19 +
.../suite/funcs_1/t/is_columns_memory.test | 21 +
.../suite/funcs_1/t/is_columns_myisam.test | 21 +
.../suite/funcs_1/t/is_columns_mysql.test | 13 +
.../suite/funcs_1/t/is_columns_ndb.test | 33 +
.../suite/funcs_1/t/is_key_column_usage.test | 344 +
mysql-test/suite/funcs_1/t/is_routines.test | 471 +
.../suite/funcs_1/t/is_schema_privileges.test | 336 +
.../t/is_schema_privileges_is_mysql_test.test | 58 +
mysql-test/suite/funcs_1/t/is_schemata.test | 246 +
.../funcs_1/t/is_schemata_is_mysql_test.test | 58 +
mysql-test/suite/funcs_1/t/is_statistics.test | 379 +
.../suite/funcs_1/t/is_statistics_is.test | 14 +
.../suite/funcs_1/t/is_statistics_mysql.test | 15 +
.../suite/funcs_1/t/is_table_constraints.test | 331 +
.../funcs_1/t/is_table_constraints_is.test | 14 +
.../funcs_1/t/is_table_constraints_mysql.test | 14 +
.../suite/funcs_1/t/is_table_privileges.test | 349 +
mysql-test/suite/funcs_1/t/is_tables.test | 474 +
.../suite/funcs_1/t/is_tables_innodb.test | 22 +
mysql-test/suite/funcs_1/t/is_tables_is.test | 18 +
.../suite/funcs_1/t/is_tables_memory.test | 22 +
.../suite/funcs_1/t/is_tables_myisam.test | 22 +
.../suite/funcs_1/t/is_tables_mysql.test | 14 +
mysql-test/suite/funcs_1/t/is_tables_ndb.test | 34 +
mysql-test/suite/funcs_1/t/is_triggers.test | 253 +
.../suite/funcs_1/t/is_user_privileges.test | 347 +
mysql-test/suite/funcs_1/t/is_views.test | 305 +
.../suite/funcs_1/t/memory__datadict.test | 9 -
mysql-test/suite/funcs_1/t/memory__load.test | 45 -
.../suite/funcs_1/t/memory_bitdata.test | 28 +-
.../suite/funcs_1/t/memory_cursors.test | 27 +-
.../suite/funcs_1/t/memory_storedproc_02.test | 0
.../suite/funcs_1/t/memory_storedproc_03.test | 0
.../suite/funcs_1/t/memory_storedproc_06.test | 0
.../suite/funcs_1/t/memory_storedproc_07.test | 0
.../suite/funcs_1/t/memory_storedproc_08.test | 0
.../suite/funcs_1/t/memory_storedproc_10.test | 0
.../suite/funcs_1/t/memory_trig_0102.test | 26 +-
.../suite/funcs_1/t/memory_trig_03.test | 26 +-
.../suite/funcs_1/t/memory_trig_0407.test | 26 +-
.../suite/funcs_1/t/memory_trig_08.test | 26 +-
.../suite/funcs_1/t/memory_trig_09.test | 26 +-
.../suite/funcs_1/t/memory_trig_1011ext.test | 26 +-
mysql-test/suite/funcs_1/t/memory_views.test | 46 +-
.../suite/funcs_1/t/myisam__datadict.test | 10 -
mysql-test/suite/funcs_1/t/myisam__load.test | 45 -
.../suite/funcs_1/t/myisam_bitdata.test | 28 +-
.../suite/funcs_1/t/myisam_cursors.test | 27 +-
.../suite/funcs_1/t/myisam_storedproc_02.test | 0
.../suite/funcs_1/t/myisam_storedproc_03.test | 0
.../suite/funcs_1/t/myisam_storedproc_06.test | 0
.../suite/funcs_1/t/myisam_storedproc_07.test | 0
.../suite/funcs_1/t/myisam_storedproc_08.test | 0
.../suite/funcs_1/t/myisam_storedproc_10.test | 0
.../suite/funcs_1/t/myisam_trig_0102.test | 26 +-
.../suite/funcs_1/t/myisam_trig_03.test | 26 +-
.../suite/funcs_1/t/myisam_trig_0407.test | 26 +-
.../suite/funcs_1/t/myisam_trig_08.test | 26 +-
.../suite/funcs_1/t/myisam_trig_09.test | 26 +-
.../suite/funcs_1/t/myisam_trig_1011ext.test | 17 +-
mysql-test/suite/funcs_1/t/myisam_views.test | 45 +-
226 files changed, 22861 insertions(+), 44898 deletions(-)
create mode 100644 mysql-test/suite/funcs_1/datadict/basics_mixed1.inc
create mode 100644 mysql-test/suite/funcs_1/datadict/basics_mixed2.inc
create mode 100644 mysql-test/suite/funcs_1/datadict/basics_mixed3.inc
create mode 100644 mysql-test/suite/funcs_1/datadict/charset_collation.inc
create mode 100644 mysql-test/suite/funcs_1/datadict/columns.inc
create mode 100644 mysql-test/suite/funcs_1/datadict/datadict.pre
delete mode 100644 mysql-test/suite/funcs_1/datadict/datadict_master.inc
delete mode 100644 mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc
delete mode 100644 mysql-test/suite/funcs_1/datadict/datadict_show_table_design.inc
delete mode 100644 mysql-test/suite/funcs_1/datadict/datadict_tables.inc
delete mode 100644 mysql-test/suite/funcs_1/datadict/datadict_tables_error.inc
delete mode 100644 mysql-test/suite/funcs_1/datadict/datadict_tables_error_1.inc
delete mode 100755 mysql-test/suite/funcs_1/datadict/datadict_tables_error_1044.inc
delete mode 100644 mysql-test/suite/funcs_1/datadict/datadict_tables_error_1049.inc
delete mode 100644 mysql-test/suite/funcs_1/datadict/datadict_tables_error_1051.inc
delete mode 100644 mysql-test/suite/funcs_1/datadict/datadict_tables_error_1146.inc
delete mode 100644 mysql-test/suite/funcs_1/datadict/datadict_tables_error_1288.inc
create mode 100644 mysql-test/suite/funcs_1/datadict/is_table_query.inc
create mode 100644 mysql-test/suite/funcs_1/datadict/statistics.inc
create mode 100644 mysql-test/suite/funcs_1/datadict/table_constraints.inc
create mode 100644 mysql-test/suite/funcs_1/datadict/tables1.inc
create mode 100644 mysql-test/suite/funcs_1/datadict/tables2.inc
create mode 100644 mysql-test/suite/funcs_1/include/cleanup.inc
delete mode 100644 mysql-test/suite/funcs_1/include/create_database.inc
delete mode 100644 mysql-test/suite/funcs_1/include/create_user_lowest_priv.inc
delete mode 100644 mysql-test/suite/funcs_1/include/create_user_no_super.inc
create mode 100644 mysql-test/suite/funcs_1/r/charset_collation_1.result
create mode 100644 mysql-test/suite/funcs_1/r/charset_collation_2.result
create mode 100644 mysql-test/suite/funcs_1/r/charset_collation_3.result
delete mode 100644 mysql-test/suite/funcs_1/r/datadict_help_tables_build.result
delete mode 100644 mysql-test/suite/funcs_1/r/datadict_help_tables_dev.result
delete mode 100644 mysql-test/suite/funcs_1/r/innodb__datadict.result
delete mode 100644 mysql-test/suite/funcs_1/r/innodb__load.result
create mode 100644 mysql-test/suite/funcs_1/r/is_basics_mixed.result
create mode 100644 mysql-test/suite/funcs_1/r/is_character_sets.result
create mode 100644 mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result
create mode 100644 mysql-test/suite/funcs_1/r/is_collations.result
create mode 100644 mysql-test/suite/funcs_1/r/is_column_privileges.result
create mode 100644 mysql-test/suite/funcs_1/r/is_column_privileges_is_mysql_test.result
create mode 100644 mysql-test/suite/funcs_1/r/is_columns.result
create mode 100644 mysql-test/suite/funcs_1/r/is_columns_innodb.result
create mode 100644 mysql-test/suite/funcs_1/r/is_columns_is.result
create mode 100644 mysql-test/suite/funcs_1/r/is_columns_memory.result
create mode 100644 mysql-test/suite/funcs_1/r/is_columns_myisam.result
create mode 100644 mysql-test/suite/funcs_1/r/is_columns_mysql.result
create mode 100644 mysql-test/suite/funcs_1/r/is_columns_ndb.result
create mode 100644 mysql-test/suite/funcs_1/r/is_key_column_usage.result
create mode 100644 mysql-test/suite/funcs_1/r/is_routines.result
create mode 100644 mysql-test/suite/funcs_1/r/is_schema_privileges.result
create mode 100644 mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result
create mode 100644 mysql-test/suite/funcs_1/r/is_schemata.result
create mode 100644 mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result
create mode 100644 mysql-test/suite/funcs_1/r/is_statistics.result
create mode 100644 mysql-test/suite/funcs_1/r/is_statistics_is.result
create mode 100644 mysql-test/suite/funcs_1/r/is_statistics_mysql.result
create mode 100644 mysql-test/suite/funcs_1/r/is_table_constraints.result
create mode 100644 mysql-test/suite/funcs_1/r/is_table_constraints_is.result
create mode 100644 mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
create mode 100644 mysql-test/suite/funcs_1/r/is_table_privileges.result
create mode 100644 mysql-test/suite/funcs_1/r/is_tables.result
create mode 100644 mysql-test/suite/funcs_1/r/is_tables_innodb.result
create mode 100644 mysql-test/suite/funcs_1/r/is_tables_is.result
create mode 100644 mysql-test/suite/funcs_1/r/is_tables_memory.result
create mode 100644 mysql-test/suite/funcs_1/r/is_tables_myisam.result
create mode 100644 mysql-test/suite/funcs_1/r/is_tables_mysql.result
create mode 100644 mysql-test/suite/funcs_1/r/is_tables_ndb.result
create mode 100644 mysql-test/suite/funcs_1/r/is_triggers.result
create mode 100644 mysql-test/suite/funcs_1/r/is_user_privileges.result
create mode 100644 mysql-test/suite/funcs_1/r/is_views.result
delete mode 100644 mysql-test/suite/funcs_1/r/memory__datadict.result
delete mode 100644 mysql-test/suite/funcs_1/r/memory__load.result
delete mode 100644 mysql-test/suite/funcs_1/r/myisam__datadict.result
delete mode 100644 mysql-test/suite/funcs_1/r/myisam__load.result
mode change 100755 => 100644 mysql-test/suite/funcs_1/storedproc/storedproc_02.inc
mode change 100755 => 100644 mysql-test/suite/funcs_1/storedproc/storedproc_03.inc
mode change 100755 => 100644 mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
mode change 100755 => 100644 mysql-test/suite/funcs_1/storedproc/storedproc_07.inc
mode change 100755 => 100644 mysql-test/suite/funcs_1/storedproc/storedproc_08.inc
mode change 100755 => 100644 mysql-test/suite/funcs_1/storedproc/storedproc_08_show.inc
mode change 100755 => 100644 mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
create mode 100644 mysql-test/suite/funcs_1/t/charset_collation_1.test
create mode 100644 mysql-test/suite/funcs_1/t/charset_collation_2.test
create mode 100644 mysql-test/suite/funcs_1/t/charset_collation_3.test
delete mode 100644 mysql-test/suite/funcs_1/t/datadict_help_tables_build.test
delete mode 100644 mysql-test/suite/funcs_1/t/datadict_help_tables_dev.test
delete mode 100644 mysql-test/suite/funcs_1/t/innodb__datadict.test
delete mode 100644 mysql-test/suite/funcs_1/t/innodb__load.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/innodb_storedproc_02.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/innodb_storedproc_03.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/innodb_storedproc_06.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/innodb_storedproc_07.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/innodb_storedproc_08.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/innodb_storedproc_10.test
create mode 100644 mysql-test/suite/funcs_1/t/is_basics_mixed.test
create mode 100644 mysql-test/suite/funcs_1/t/is_character_sets.test
create mode 100644 mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test
create mode 100644 mysql-test/suite/funcs_1/t/is_collations.test
create mode 100644 mysql-test/suite/funcs_1/t/is_column_privileges.test
create mode 100644 mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test
create mode 100644 mysql-test/suite/funcs_1/t/is_columns.test
create mode 100644 mysql-test/suite/funcs_1/t/is_columns_innodb.test
create mode 100644 mysql-test/suite/funcs_1/t/is_columns_is.test
create mode 100644 mysql-test/suite/funcs_1/t/is_columns_memory.test
create mode 100644 mysql-test/suite/funcs_1/t/is_columns_myisam.test
create mode 100644 mysql-test/suite/funcs_1/t/is_columns_mysql.test
create mode 100644 mysql-test/suite/funcs_1/t/is_columns_ndb.test
create mode 100644 mysql-test/suite/funcs_1/t/is_key_column_usage.test
create mode 100644 mysql-test/suite/funcs_1/t/is_routines.test
create mode 100644 mysql-test/suite/funcs_1/t/is_schema_privileges.test
create mode 100644 mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test
create mode 100644 mysql-test/suite/funcs_1/t/is_schemata.test
create mode 100644 mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test
create mode 100644 mysql-test/suite/funcs_1/t/is_statistics.test
create mode 100644 mysql-test/suite/funcs_1/t/is_statistics_is.test
create mode 100644 mysql-test/suite/funcs_1/t/is_statistics_mysql.test
create mode 100644 mysql-test/suite/funcs_1/t/is_table_constraints.test
create mode 100644 mysql-test/suite/funcs_1/t/is_table_constraints_is.test
create mode 100644 mysql-test/suite/funcs_1/t/is_table_constraints_mysql.test
create mode 100644 mysql-test/suite/funcs_1/t/is_table_privileges.test
create mode 100644 mysql-test/suite/funcs_1/t/is_tables.test
create mode 100644 mysql-test/suite/funcs_1/t/is_tables_innodb.test
create mode 100644 mysql-test/suite/funcs_1/t/is_tables_is.test
create mode 100644 mysql-test/suite/funcs_1/t/is_tables_memory.test
create mode 100644 mysql-test/suite/funcs_1/t/is_tables_myisam.test
create mode 100644 mysql-test/suite/funcs_1/t/is_tables_mysql.test
create mode 100644 mysql-test/suite/funcs_1/t/is_tables_ndb.test
create mode 100644 mysql-test/suite/funcs_1/t/is_triggers.test
create mode 100644 mysql-test/suite/funcs_1/t/is_user_privileges.test
create mode 100644 mysql-test/suite/funcs_1/t/is_views.test
delete mode 100644 mysql-test/suite/funcs_1/t/memory__datadict.test
delete mode 100644 mysql-test/suite/funcs_1/t/memory__load.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/memory_storedproc_02.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/memory_storedproc_03.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/memory_storedproc_06.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/memory_storedproc_07.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/memory_storedproc_08.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/memory_storedproc_10.test
delete mode 100644 mysql-test/suite/funcs_1/t/myisam__datadict.test
delete mode 100644 mysql-test/suite/funcs_1/t/myisam__load.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/myisam_storedproc_02.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/myisam_storedproc_03.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/myisam_storedproc_06.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/myisam_storedproc_07.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/myisam_storedproc_08.test
mode change 100755 => 100644 mysql-test/suite/funcs_1/t/myisam_storedproc_10.test
diff --git a/mysql-test/suite/funcs_1/README.txt b/mysql-test/suite/funcs_1/README.txt
index bf6ac945cb1..7e98d1bc117 100644
--- a/mysql-test/suite/funcs_1/README.txt
+++ b/mysql-test/suite/funcs_1/README.txt
@@ -1,134 +1,46 @@
-Matthias 17.06.2005
--------------------
-1. I changed the database test1 (dropped + created in SP test)
- to test4.
- Please adjust the SP test cases.
-2. There is a difference between my definition of
- innodb_tb4 + memory_tb4
- to the latest table definition used by disha.
- Please adjust the table definition if needed.
-3. The data load files are product of the Disha data generation script
- (downloaded ~20 May ?) + modified by Omer
- These load data fit fairly to the table definitions.
+2008-02-29 Matthias Leich
+=========================
-4. How to execute the "small" test with 10 rows per table.
- Do NOT set the environment variable NO_REFRESH to a
- value <> ''.
- Start the test for example by
- ./mysql-test-run.pl --vardir=/dev/shm/var \
- --force --suite=funcs_1 --do-test=myisam
- The "result" files fit mostly to this variant.
+1. The testsuite "funcs_1" is mostly intended for additional (compared
+ to the common regression tests stored in mysql-test/t) checks
+ of features (VIEWS, INFORMATION_SCHEMA, STORED PROCEDURES,...)
+ introduced with MySQL 5.0.
- Any database not in ('mysql','test') and any tables
- needed within a testcase ( t/_.test )
- will be (re)created at the beginning of the test.
+2. There were some extensions of this suite when new information_schema
+ views were introduced. But in most cases the tests for these views
+ were stored within the regression testsuite (mysql-test/t).
-5. How to execute the "big" test with many rows per table.
- Replace the directories
- suite/funcs_1/data and
- suite/funcs_1/r
- with the appropriate ones for the "big" test.
- Set the environment variable NO_REFRESH to a value <> ''.
- Start the test for example by
- ./mysql-test-run.pl --vardir=/dev/shm/var \
- --force --suite=funcs_1 --do-test=myisam
+ INFORMATION_SCHEMA views introduced with MySQL 5.1
+ ==================================================
+ ENGINES (partially tested here)
+ EVENTS (partially tested here)
+ FILES
+ GLOBAL_STATUS
+ GLOBAL_VARIABLES
+ PARTITIONS
+ PLUGINS
+ PROCESSLIST (full tested here)
+ PROFILING
+ REFERENTIAL_CONSTRAINTS
+ SESSION_STATUS
+ SESSION_VARIABLES
- All databases and tables will be (re)created by the script
- __load.test .
+3. Some hints:
+ - SHOW TABLES ... LIKE ''
+ does a case sensitive comparison between the tablename and
+ the pattern.
+ The names of the tables within the informationschema are in uppercase.
+ So please use something like
+ SHOW TABLES FOR information_schema LIKE 'TABLES'
+ when you intend to get the same non empty result set on OS with and
+ without case sensitive filesystems and default configuration.
+ - The name of the data dictionary is 'information_schema' (lowercase).
+ - Server on OS with filesystem with case sensitive filenames
+ (= The files 'abc' and 'Abc' can coexist.)
+ + default configuration
+ Example of behaviour:
+ DROP DATABASE information_schema;
+ ERROR 42000: Access denied for user ... to database 'information_schema'
+ DROP DATABASE INFORMATION_SCHEMA;
+ ERROR 42000: Access denied for user ... to database 'INFORMATION_SCHEMA'
-6. I am not sure of the files
- ./funcs_1/include/create_.inc
- are in the moment needed. I included them, because I
- guess my VIEW testcase example needs them.
-
-I guess the pushed files are far away from being perfect.
-It is a 8 hours hack.
-Please try them, create missing files and come up with improvements.
-
-Good luck !
-
-Matthias 17.06.2005
-===================================================================
-Omer 19.06.2005
----------------
-1. Changed the structure of the memory_tb3 table to include two
- additional column f121, f122. These columns exist for the table in
- the other storage engines as TEXT. Since memory does not support
- TEXT, Disha did not include them. How ever I am using them in the
- Trigger tests so added them to the memory definition as CHAR(50);.
- Also modifyed the DataGen_modiy.pl file to account for these two
- column when generating the data.
- - checked in a new DataGen_modify.pl (create a 'lib' directory
- under 'funcs_1').
- - checked in a new memory_tb3.txt
-2. Added three _triggers.test files based on Matthias's
- structure above.
-3. Added three __triggers.result files
-4. Added the Trigger_master.test file in the trigger dierctory
- Note: This is not complete and is still under work
-5. Created a 'lib' directory and added the DataGen*.pl scripts to it
- (exists under the disha suite) but should be here as well).
-Omer 19.06.2005
-===================================================================
-Matthias 12.09.2005
--------------------
- Replace the geometry data types by VARBINARY
- The removal of the geometry data types was necessary, because the
- execution of the funcs_1 testsuite should not depend on the
- availability of the geometry feature.
- Note: There are servers compiled without the geometry feature.
-
- The columns are not removed, but their data type was changed
- VARBINARY. This allows us to omit any changes within the loader
- input files or data generation scripts.
- The replacement of geometry by VARCHAR allows us to use our
-
-Matthias 12.09.2005
-===================================================================
-Matthias 14.09.2005
--------------------
- The results of the _views testcases suffer when
- executed in "--ps-protocol" mode from the open
- Bug#11589: mysqltest, --ps-protocol, strange output,
- float/double/real with zerofill .
- Implementation of a workaround:
- At the beginning of views_master.inc is a variable $have_bug_11589 .
- If this varable is set to 1, the ps-protocol will be switched
- of for the critical statements.
-Matthias 14.09.2005
-===================================================================
-Carsten 16.09.2005
-------------------
-1. The results of the datadict_ testcases have been changed in nearly
- all occurrencies of --error because now for the INFORMATION_SCHEMA only
- the --error 1044 (ERROR 42000: Access denied for user '..' to database
- 'information_schema') seems to be used.
-2. To get identical results when using "--ps-protocol" some SELECTs FROM
- information_schema has been wrapped to suppress using ps-protocol because
- there are differences.
-3. The test using SELECT .. OUTFILE has been disabled due to bug #13202.
-4. Fixed datadict_.result files after the change that added 2 columns to
- the VIEWS table (DEFINER varchar(77), SECURITY_TYPE varchar(7)).
-===================================================================
-Matthias 25.08.2007
--------------------
-Fixes for Bugs 30418,30420,30438,30440
-1. Replace error numbers with error names
-2. Replace static "InnoDB" (not all time available) used within an
- "alter table" by $OTHER_ENGINE_TYPE (set to MEMORY or MyISAM).
- Minor adjustment of column data type.
-3. Use mysqltest result set sorting in several cases.
-4. Avoid any statistics about help tables, because their content
- depends on configuration:
- developer release - help tables are empty
- build release - help tables have content + growing with version
-5. Add two help table related tests (one for build, one for developer)
- to ensure that informations about help tables within
- INFORMATION_SCHEMA.TABLES/STATISTICS are checked.
-General note:
- Most INFORMATION_SCHEMA properties (table layout, permissions etc.)
- are not affected by our variation of the storage engines except
- that some properties of our tables using a specific storage
- engine become visible. So it makes sense to decompose
- this test into a storage engine specific part and a non
- storage engine specific part in future.
diff --git a/mysql-test/suite/funcs_1/datadict/basics_mixed1.inc b/mysql-test/suite/funcs_1/datadict/basics_mixed1.inc
new file mode 100644
index 00000000000..2cb9cbc700b
--- /dev/null
+++ b/mysql-test/suite/funcs_1/datadict/basics_mixed1.inc
@@ -0,0 +1,53 @@
+# suite/funcs_1/datadict/basics_mixed1.inc
+#
+# Auxiliary script to be sourced by suite/funcs_1/t/is_basics_mixed.test
+#
+# Author:
+# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
+# testsuite funcs_1
+# Create this script based on older scripts and new code.
+#
+
+# 1 Attempt to create tables and views when residing in information_schema
+# 1.1 CREATE TABLE
+USE information_schema;
+let $message= root: create a table with a name of an IS table directly in IS;
+let $dd_part1= CREATE TABLE;
+let $dd_part2= ( c1 INT );
+--source suite/funcs_1/datadict/basics_mixed2.inc
+# FIXME 3.2.1.6: error message ER_UNKNOWN_TABLE is misleading
+--error ER_UNKNOWN_TABLE
+CREATE TABLE t1 (f1 INT, f2 INT, f3 INT);
+#
+# 1.2 CREATE VIEW
+# 1.2.1 Hit on existing INFORMATION_SCHEMA table
+--error ER_DBACCESS_DENIED_ERROR
+CREATE VIEW tables AS SELECT 'garbage';
+--error ER_DBACCESS_DENIED_ERROR
+CREATE VIEW tables AS SELECT * FROM information_schema.tables;
+# 1.2.2 New view
+# ER_DBACCESS_DENIED_ERROR would be better.
+--error ER_UNKNOWN_TABLE
+CREATE VIEW v1 AS SELECT 'garbage';
+
+# 2 Attempt to create tables and views when residing in information_schema
+# 1.1 CREATE TABLE
+USE test;
+let $message= root: create a table with a name of an IS table from other db;
+let $dd_part1= CREATE TABLE information_schema.;
+let $dd_part2= ( c1 INT );
+--source suite/funcs_1/datadict/basics_mixed2.inc
+# FIXME 3.2.1.6: error message ER_UNKNOWN_TABLE is misleading
+--error ER_UNKNOWN_TABLE
+CREATE TABLE information_schema.t1 (f1 INT, f2 INT, f3 INT);
+#
+# Hit on existing INFORMATION_SCHEMA table
+--error ER_DBACCESS_DENIED_ERROR
+CREATE VIEW information_schema.tables AS SELECT 'garbage';
+--error ER_DBACCESS_DENIED_ERROR
+CREATE VIEW information_schema.tables AS
+SELECT * FROM information_schema.tables;
+# New table
+# ER_DBACCESS_DENIED_ERROR would be better.
+--error ER_UNKNOWN_TABLE
+CREATE VIEW information_schema.v1 AS SELECT 'garbage';
diff --git a/mysql-test/suite/funcs_1/datadict/basics_mixed2.inc b/mysql-test/suite/funcs_1/datadict/basics_mixed2.inc
new file mode 100644
index 00000000000..6b1f07798fb
--- /dev/null
+++ b/mysql-test/suite/funcs_1/datadict/basics_mixed2.inc
@@ -0,0 +1,55 @@
+#### suite/funcs_1/datadict/basics_mixed2.inc
+#
+# Auxiliary script to be sourced by suite/funcs_1/datadict/is_basics_mixed1.inc
+#
+# contains all tables from INFORMATION_SCHEMA
+#
+# Usage example(snip of script):
+# let $dd_part1= CREATE TABLE information_schema.;
+# let $dd_part2= ( c1 INT );
+# --source suite/funcs_1/datadict/basics_mixed2.inc
+#
+# We expect to get
+# ERROR 42000: Access denied for user 'root'@'localhost'
+# to database 'information_schema'
+# for every statement.
+#
+# Author:
+# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
+# testsuite funcs_1
+# Create this script based on older scripts and new code.
+#
+
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 schemata $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 tables $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 columns $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 character_sets $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 collations $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 collation_character_set_applicability $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 routines $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 statistics $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 views $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 user_privileges $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 schema_privileges $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 table_privileges $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 column_privileges $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 table_constraints $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 key_column_usage $dd_part2;
+--error ER_DBACCESS_DENIED_ERROR
+eval $dd_part1 triggers $dd_part2;
+
diff --git a/mysql-test/suite/funcs_1/datadict/basics_mixed3.inc b/mysql-test/suite/funcs_1/datadict/basics_mixed3.inc
new file mode 100644
index 00000000000..f6a290636d9
--- /dev/null
+++ b/mysql-test/suite/funcs_1/datadict/basics_mixed3.inc
@@ -0,0 +1,42 @@
+#### suite/funcs_1/datadict/basics_mixed3.inc
+#
+# Auxiliary routine to be sourced by suite/funcs_1/t/is_basics_mixed.test
+#
+# Check if INFORMATION_SCHEMA tables contain a schema_name like 'db_data%'.
+#
+# Author:
+# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
+# testsuite funcs_1
+# Create this script based on older scripts and new code.
+#
+
+# No column with the name of a database contained in:
+# character_sets collations collation_character_set_applicability
+# user_privileges
+SELECT DISTINCT table_schema FROM information_schema.columns
+WHERE table_schema LIKE 'db_data%';
+SELECT DISTINCT table_schema FROM information_schema.column_privileges
+WHERE table_schema LIKE 'db_data%';
+SELECT DISTINCT constraint_schema,table_schema
+FROM information_schema.key_column_usage
+WHERE constraint_schema LIKE 'db_data%' OR table_schema LIKE 'db_data%';
+SELECT DISTINCT routine_schema FROM information_schema.routines
+WHERE routine_schema LIKE 'db_data%';
+SELECT DISTINCT schema_name FROM information_schema.schemata
+WHERE schema_name LIKE 'db_data%';
+SELECT DISTINCT table_schema FROM information_schema.schema_privileges
+WHERE table_schema LIKE 'db_data%';
+SELECT DISTINCT table_schema,index_schema FROM information_schema.statistics
+WHERE table_schema LIKE 'db_data%' OR index_schema LIKE 'db_data%';
+SELECT DISTINCT table_schema FROM information_schema.tables
+WHERE table_schema LIKE 'db_data%';
+SELECT DISTINCT constraint_schema,table_schema
+FROM information_schema.table_constraints
+WHERE constraint_schema LIKE 'db_data%' OR table_schema LIKE 'db_data%';
+SELECT DISTINCT table_schema FROM information_schema.table_privileges
+WHERE table_schema LIKE 'db_data%';
+SELECT DISTINCT trigger_schema,event_object_schema
+FROM information_schema.triggers
+WHERE trigger_schema LIKE 'db_data%' OR event_object_schema LIKE 'db_data%';
+SELECT DISTINCT table_schema FROM information_schema.views
+WHERE table_schema LIKE 'db_data%';
diff --git a/mysql-test/suite/funcs_1/datadict/charset_collation.inc b/mysql-test/suite/funcs_1/datadict/charset_collation.inc
new file mode 100644
index 00000000000..f8fc58b082b
--- /dev/null
+++ b/mysql-test/suite/funcs_1/datadict/charset_collation.inc
@@ -0,0 +1,122 @@
+# suite/funcs_1/datadict/charset_collation.inc
+#
+# Tests checking the content of the information_schema tables
+# character_sets
+# collations
+# collation_character_set_applicability
+#
+#
+# The amount and properties of character_sets/collations depend on the
+# build type
+# 2007-12 MySQL 5.0
+# ---------------------------------------------------------------------
+#
+# Variant 1 fits to
+# version_comment MySQL Enterprise Server (Commercial)
+# version_comment MySQL Enterprise Server (GPL)
+# version_comment MySQL Classic Server (Commercial)
+# version_comment MySQL Pushbuild Edition, build
+# (version_comment Source distribution
+# and
+# compile was without "max" - > no collation 'utf8_general_ci')
+#
+# Variant 2 fits to
+# version_comment MySQL Enterprise Server (GPL)
+# version_comment MySQL Classic Server (Commercial)
+# version_comment MySQL Pushbuild Edition, build
+# (version_comment Source distribution
+# and
+# compile was without "max" - > collation 'utf8_general_ci' exists)
+#
+# Difference between variant 1 and 2 is the collation 'utf8_general_ci'.
+#
+# Variant 3 fits to
+# version_comment MySQL Community Server (GPL)
+# version_comment MySQL Cluster Server (Commercial)
+#
+# Difference between variant 3 and 2 is within the collation properties
+# IS_COMPILED and SORTLEN.
+#
+# Created:
+# 2007-12-18 mleich - remove the unstable character_set/collation subtests
+# from include/datadict-master.inc
+# - create this new test
+#
+
+# Create a low privileged user.
+--error 0, ER_CANNOT_USER
+DROP USER dbdict_test@localhost;
+CREATE USER dbdict_test@localhost;
+
+--echo # Establish connection con (user=dbdict_test)
+--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
+connect (con,localhost,dbdict_test,,);
+################################################################################
+#
+# The original requirements for the following tests were:
+#
+# 3.2.2.2: Ensure that the table (information_schema.character_sets) shows the
+# relevant information on every character set for which the current
+# user or PUBLIC have the USAGE privilege.
+#
+# 3.2.2.3: Ensure that the table (information_schema.character_sets) does not
+# show any information on any character set for which the current user
+# or PUBLIC have no USAGE privilege.
+#
+#
+# 3.2.3.2: Ensure that the table (information_schema.collations) shows the
+# relevant information on every collation for which the current user
+# or PUBLIC have the USAGE privilege.
+#
+# 3.2.3.3: Ensure that the table (information_schema.collations) does not show
+# any information on any collations for which the current user and
+# PUBLIC have no USAGE privilege.
+#
+#
+# 3.2.4.2: Ensure that the table
+# information_schema.collation_character_set_applicability
+# shows the relevant information on every collation/character set
+# combination for which the current user or PUBLIC have the USAGE
+# privilege.
+#
+# 3.2.4.3: Ensure that the table
+# information_schema.collation_character_set_applicability
+# does not show any information on any collation/character set
+# combinations for which the current user and PUBLIC have no
+# USAGE privilege.
+#
+# Notes (2007-12-19 mleich):
+# - The requirements are outdated because grant/revoke privilege for using a
+# characterset/collation were never implemented.
+# Therefore the tests should simply check the content of these tables.
+#
+# - The amount of collations/character sets grows with new MySQL releases.
+#
+# - Even within the same release the amount of records within these tables
+# can differ between different build types (community, enterprise, source,...)
+#
+#
+################################################################################
+--echo
+SELECT *
+FROM information_schema.character_sets
+ORDER BY character_set_name;
+
+--echo
+SELECT *
+FROM information_schema.collations
+ORDER BY collation_name;
+
+echo;
+--echo
+SELECT *
+FROM information_schema.collation_character_set_applicability
+ORDER BY collation_name, character_set_name;
+
+
+# Cleanup
+--echo # Switch to connection default + disconnect con
+connection default;
+disconnect con;
+DROP USER dbdict_test@localhost;
+
diff --git a/mysql-test/suite/funcs_1/datadict/columns.inc b/mysql-test/suite/funcs_1/datadict/columns.inc
new file mode 100644
index 00000000000..86f8afeff73
--- /dev/null
+++ b/mysql-test/suite/funcs_1/datadict/columns.inc
@@ -0,0 +1,87 @@
+# suite/funcs_1/datadict/is_columns.inc
+#
+# Auxiliary script to be sourced by
+# is_columns_is
+# is_columns_mysql
+# is_columns_
+#
+# Purpose:
+# Check the content of information_schema.columns about tables within certain
+# database/s.
+#
+# Usage:
+# The variable $my_where has to
+# - be set before sourcing this script.
+# - contain the first part of the WHERE qualification
+# Example:
+# let $my_where = WHERE table_schema = 'information_schema'
+# AND table_name <> 'profiling';
+# --source suite/funcs_1/datadict/is_columns.inc
+#
+# Author:
+# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
+# testsuite funcs_1
+# Create this script based on older scripts and new code.
+#
+
+--source suite/funcs_1/datadict/datadict_bug_12777.inc
+eval
+SELECT * FROM information_schema.columns
+$my_where
+ORDER BY table_schema, table_name, column_name;
+
+--echo ##########################################################################
+--echo # Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
+--echo ##########################################################################
+eval
+SELECT DISTINCT
+ CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
+ DATA_TYPE,
+ CHARACTER_SET_NAME,
+ COLLATION_NAME
+FROM information_schema.columns
+$my_where
+AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
+ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
+
+#FIXME 3.2.6.2: check the value 2.0079 tinytext ucs2 ucs2_general_ci
+eval
+SELECT DISTINCT
+ CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
+ DATA_TYPE,
+ CHARACTER_SET_NAME,
+ COLLATION_NAME
+FROM information_schema.columns
+$my_where
+AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
+ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
+
+eval
+SELECT DISTINCT
+ CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
+ DATA_TYPE,
+ CHARACTER_SET_NAME,
+ COLLATION_NAME
+FROM information_schema.columns
+$my_where
+ AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
+ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
+
+echo --> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values;
+echo --> are 0, which is intended behavior, and the result of 0 / 0 IS NULL;
+--source suite/funcs_1/datadict/datadict_bug_12777.inc
+eval
+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
+$my_where
+ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
+
diff --git a/mysql-test/suite/funcs_1/datadict/datadict.pre b/mysql-test/suite/funcs_1/datadict/datadict.pre
new file mode 100644
index 00000000000..cedc24aad13
--- /dev/null
+++ b/mysql-test/suite/funcs_1/datadict/datadict.pre
@@ -0,0 +1,54 @@
+#### suite/funcs_1/datadict/datadict.pre
+#
+# Auxiliary script which loads prerequisites
+# (variables needed for --replace_result ...)
+# in datadictionary tests.
+#
+# Author:
+# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
+# testsuite funcs_1
+# Create this script based on older scripts and new code.
+#
+--disable_query_log
+
+# Bug#12777 Different size shown for VARCHAR(n) columns (with n> 64)
+# in INFORMATION_SCHEMA
+# This bug was unfortunately (for testers) declared to be no bug.
+# So CHARACTER_MAXIMUM_LENGTH of several _CATALOG columns within
+# the INFORMATION_SCHEMA depends on PATH_MAX of the operating system.
+# Workaround for this problem:
+# Get the size of ONE known colum and check the size against some values to
+# be able to use the correct --replace_result statement. Using this only the
+# one pair of 'wrong' values is replaced and not all occurrencies of all
+# possible pairs of values. See bug #12777 for details.
+SELECT character_maximum_length INTO @CML
+FROM information_schema.columns
+WHERE table_schema = 'information_schema'
+ AND table_name = 'columns'
+ AND column_name = 'table_catalog';
+
+let $bug_12777_0512= `SELECT @CML = 512`;
+let $bug_12777_1023= `SELECT @CML = 1023`;
+let $bug_12777_1024= `SELECT @CML = 1024`;
+let $bug_12777_2048= `SELECT @CML = 2048`;
+# 4096 is the value used in the files with expected results.
+let $bug_12777_4095= `SELECT @CML = 4095`;
+if (0)
+{
+ # enable this for debugging only, but NOT in a pushed version, as then the
+ # result changes from OS to OS ...
+ eval SELECT @CML AS 'CML',
+ $bug_12777_0512 AS '512',
+ $bug_12777_1023 AS '1023',
+ $bug_12777_1024 AS '1024',
+ $bug_12777_2048 AS '2048',
+ $bug_12777_4095 AS '4095';
+}
+
+
+# Prepare a variable to be able to suppress machine dependant diffs
+# this can be used in: --replace_result $SERVER_NAME
+let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user
+ WHERE host NOT In ("localhost", "127.0.0.1", "%")`;
+--enable_query_log
+
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_master.inc b/mysql-test/suite/funcs_1/datadict/datadict_master.inc
deleted file mode 100644
index 0499d3945e2..00000000000
--- a/mysql-test/suite/funcs_1/datadict/datadict_master.inc
+++ /dev/null
@@ -1,3955 +0,0 @@
-#### suite/funcs_1/datadict/datadict_master.inc
-#
-# Checks of INFORMATION_SCHEMA table properties and content.
-# (mostly only the features introduced with MySQL 5.1)
-#
-# Please set the variable $OTHER_ENGINE_TYPE before sourcing this script.
-# $OTHER_ENGINE_TYPE must be
-# - <> $engine_type
-# - all time available like MyISAM or MEMORY
-#
-# Last change:
-# 2007-08-24 mleich Fixes for the bugs
-# #30438 "{memory,myisam,ndb}__datadict" tests fail:
-# Use "InnoDB" without checking
-# #30418 "datadict" tests (all engines) fail:
-# Dependency on the host name for ordering
-# #30420 "datadict" tests (all engines) fail:
-# Release build has help tables loaded
-#
-
---disable_abort_on_error
-let $message=
-.
-. It is intended that the 3 __datadict.test files are named this way to be
-. sure they are - in a *full run* of the suite - the first tests done for each
-. storage engine. Using two _ and the order of processing in mysql-test-run.pl
-. ensures this in an easy way.
-.
-. If needed a restart could be implemented later between the storage engines if
-. values changes in the result depending from the position where the
-. *__datadict.test are started. This can be a result of showing e.g. maximum
-. values of the number of rows of tables.
-.
-. This .result file has been checked OK with Linux 5.0.48,
-. build tree ChangeSet@1.2477.6.3, 2007-07-30
-. except that the not fixed Bug#30020 causes a difference.
-.;
---source include/show_msg80.inc
-
-################################################################################
-#
- let $message= FIXME: There are subtests that are switched off due to known bugs:;
- --source include/show_msg.inc
- #set variable(s) here to be able to switch crashing sub tests with ONE change HERE.
- #change the variable(s) to enable / disable the crashing parts.
-
- # different 'logics' are used because sometimes codelines needs to be switched off
- # and otherwise some extra statements needs to be executed as long as the bug is not
- # fixed:
- let $have_bug_11589= 1;
-
- #seems not to work: --vertical_results
- eval SELECT $have_bug_11589 AS "have_bug_11589";
- #seems not to work: --horizontal_results
-
- # As long as
- # Bug#11589: mysqltest, --ps-protocol, strange output, float/double/real with zerofill
- # is not fixed, we must switch the ps-protocol for some statements off.
- # If this bug is fixed, please
- # 1. set the following variable to 0
- # 2. check, if the test passes
- # 3. remove the workarounds
- if ($have_bug_11589)
- {
- let $message= There are some statements where the ps-protocol is switched off.
- This may come from the bug listed below, ir from other problems.
- Bug#11589: mysqltest, --ps-protocol, strange output, float/double/real with zerofill;
- --source include/show_msg80.inc
- }
-#
-################################################################################
-
-
-# loading the tables (data is not really needed in this test) is separated to
-# make it easier in this file to show the message above.
---source suite/funcs_1/datadict/datadict_load.inc
-
-#FIXME: - check for remaining change of object names to standards: db_, tb_, v_, u_, ...
-#FIXME: - check warnings when data is loaded (Data truncated for column ...)
-#FIXME: - change connect() to use less users / connections
-#
-#FIXME: - check for additional 'FIXME' here in the script
-
-use information_schema;
---source suite/funcs_1/include/show_connection.inc
-
-
-################################################################################
-#
-# Data Dictionary
-#
-################################################################################
-
-let $message= Testcase 3.2.1.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.1: Ensure that every INFORMATION_SCHEMA table can be queried
-# with a SELECT statement, just as if it were an ordinary
-# user-defined table.
-################################################################################
-
-# create at least one object for all 'tables' to be checked
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-CREATE DATABASE db_datadict;
-USE db_datadict;
-
-CREATE VIEW v1 AS SELECT * FROM information_schema.tables;
-
-# try to get the server's name to be able to clean-up the result from machine
-# specific stuff.
-CREATE OR REPLACE VIEW db_datadict.vu1 as
-SELECT grantee AS u
- FROM information_schema.user_privileges;
-CREATE OR REPLACE VIEW db_datadict.vu as
-SELECT DISTINCT u,
- SUBSTRING( u, LENGTH(SUBSTRING_INDEX(u,_utf8'@',1))+3 )
- AS server,
- SUBSTRING( u, LENGTH(SUBSTRING_INDEX(u,_utf8'@',1))+3,
- LENGTH( SUBSTRING( u,
- LENGTH( SUBSTRING_INDEX(u, _utf8'@',1)) +3 )) - 1 )
- AS Server_Clean
-FROM db_datadict.vu1;
---replace_result $SERVER_NAME
---sorted_result
-SELECT * FROM db_datadict.vu order by u;
-
-delimiter //;
-CREATE PROCEDURE db_datadict.sp_1()
- BEGIN
- SELECT * FROM db_datadict.v1;
- END//
-delimiter ;//
-
-#FIXME 3.2.1.1: add missing objects of each type to have something to select
-#FIXME 3.2.1.1: - FUNCTION
-#FIXME 3.2.1.1: - TRIGGER
-
-USE information_schema;
-SHOW tables;
-
-select * from schemata ORDER BY 2 DESC, 1 ASC;
-
-if ($have_bug_11589)
-{
---disable_ps_protocol
-}
---vertical_results
-#SELECT * FROM tables;
-#
-#FIXME 3.2.1.1: we split the "SELECT * FROM tables" in two parts until
-#FIXME 3.2.1.1: Bug #12397: wrong values shown in column CREATE_OPTIONS of
-#FIXME 3.2.1.1: INFORMATION_SCHEMA.TABLES is solved, one with 'more' and one
-#FIXME 3.2.1.1: with 'less' replace
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHECK_TIME
-# 20 CREATE_OPTIONS
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
-SELECT * FROM tables
- WHERE table_schema = 'information_schema';
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHECK_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-SELECT * FROM tables
-WHERE NOT( table_schema = 'information_schema')
- AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%');
---horizontal_results
---enable_ps_protocol
-
-select s.catalog_name, s.schema_name, s.default_character_set_name,
- t.table_type, t.engine
- from schemata s inner join tables t
- ORDER BY s.schema_name, s.default_character_set_name, table_type, engine;
---source suite/funcs_1/datadict/datadict_bug_12777.inc
-select * from columns;
-select * from character_sets;
-select sum(id) from collations where collation_name <> 'utf8_general_cs';
-select collation_name, character_set_name into @x,@y
- from collation_character_set_applicability limit 1;
- select @x, @y;
-
---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-select * from routines;
-
-select count(*) from routines;
-select * from statistics
-where not (table_schema = 'mysql' and table_name like 'help_%');
-select * from views;
---replace_result $SERVER_NAME
---sorted_result
-select * from user_privileges order by grantee, privilege_type;
-select * from schema_privileges;
-select * from table_privileges;
-select * from column_privileges;
-select * from table_constraints;
-select * from key_column_usage;
-select count(*) as max_recs from key_column_usage;
-
-select max(cardinality) from statistics
-where not (table_schema = 'mysql' and table_name like 'help_%');
-
-select concat("View '",
- table_name, "' is associated with the database '", table_schema, "'.")
- AS "Who is Who for the Views"
- from views;
-
-select concat("Table or view '", table_name,
- "' is associated with the database '", table_schema, "'.") as "Who is Who"
- from tables;
-
---replace_result $SERVER_NAME
---sorted_result
-select grantee as "user's having select privilege",
- substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
- from user_privileges where privilege_type = 'select'
- order by grantee;
-
-select all table_schema from schema_privileges limit 0,5;
-
-select distinct(privilege_type) from table_privileges;
-
-select * from column_privileges
- group by table_schema having table_schema = 'db_datadict';
-
-select * from table_constraints limit 0,5;
-select count(*) as max_recs from key_column_usage limit 0,5;
-
-select information_schema.tables.table_name as "table name",
- count(distinct(column_name)) as "no of columns in the table"
- from information_schema.tables left outer join information_schema.columns on
- information_schema.tables.table_name = information_schema.columns.table_name
- group by information_schema.tables.table_name;
-
-# Reference Manual 22.1.16 - we will add more ...:
-# select * from parameters;
-# select * from referential_constraints;
-# select * from triggers;
-
-let $message= root: simple select to check all - and never forget some - tables;
-let $dd_part1= SELECT * FROM;
-let $dd_part2= LIMIT 1;
---source suite/funcs_1/datadict/datadict_tables.inc
-
-# check again, but from different database (will fail due to missing database name)
-use db_datadict;
-
---error ER_NO_SUCH_TABLE
-select * from schemata;
---error ER_NO_SUCH_TABLE
-select * from tables;
---error ER_NO_SUCH_TABLE
-select s.catalog_name, s.schema_name, s.default_character_set_name,
- t.table_type, t.engine
- from schemata s inner join tables t
- ORDER BY s.catalog_name, s.schema_name, s.default_character_set_name;
---error ER_NO_SUCH_TABLE
-select * from columns limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from character_sets limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from collations limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from collation_character_set_applicability limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from routines limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from statistics limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from views limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from user_privileges limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from schema_privileges limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from table_privileges limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from column_privileges limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from table_constraints limit 0, 5;
---error ER_NO_SUCH_TABLE
-select * from key_column_usage limit 0, 5;
-# Reference Manual 22.1.16 - we will add more ...:
-# --error ER_NO_SUCH_TABLE
-# select * from parameters;
-# --error ER_NO_SUCH_TABLE
-# select * from referential_constraints;
-# --error ER_NO_SUCH_TABLE
-# select * from triggers;
-let $message= will fail due to missing database name;
-let $dd_part1= SELECT * FROM;
-let $dd_part2=;
---source suite/funcs_1/datadict/datadict_tables_error_1146.inc
-
-# now check from "other" database, but with database name
-select * from information_schema.schemata ORDER BY 2 DESC;
-
-#SELECT * FROM information_schema.tables;
-#
-#FIXME 3.2.1.1: we split the "SELECT * FROM tables" in two parts until
-#FIXME 3.2.1.1: Bug #12397: wrong values shown in column CREATE_OPTIONS of
-#FIXME 3.2.1.1: INFORMATION_SCHEMA.TABLES is solved, one with 'more' and one
-#FIXME 3.2.1.1: with 'less' replace
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHRCK_TIME
-# 20 CREATE_OPTIONS
-if ($have_bug_11589)
-{
---disable_ps_protocol
-}
---vertical_results
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
-SELECT * FROM information_schema.tables
- WHERE table_schema = 'information_schema';
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHRCK_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-SELECT * FROM information_schema.tables
-WHERE NOT( table_schema = 'information_schema')
- AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%');
---horizontal_results
---enable_ps_protocol
-
-select s.catalog_name, s.schema_name, s.default_character_set_name,
- t.table_type, t.engine
- from information_schema.schemata s inner join information_schema.tables t
- ORDER BY s.schema_name, s.default_character_set_name, table_type, engine;
-
---source suite/funcs_1/datadict/datadict_bug_12777.inc
-select * from information_schema.columns limit 0, 5;
-select * from information_schema.character_sets limit 0, 5;
-select * from information_schema.collations limit 0, 5;
-select * from information_schema.collation_character_set_applicability limit 0, 5;
---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-select * from information_schema.routines limit 0, 5;
-select * from information_schema.statistics limit 0, 5;
-select * from information_schema.views limit 0, 5;
---replace_result $SERVER_NAME
-select * from information_schema.user_privileges limit 0, 5;
-select * from information_schema.schema_privileges limit 0, 5;
-select * from information_schema.table_privileges limit 0, 5;
-select * from information_schema.column_privileges limit 0, 5;
-select * from information_schema.table_constraints limit 0, 5;
-select * from information_schema.key_column_usage limit 0, 5;
-select count(*) as max_recs from information_schema.key_column_usage limit 0, 5;
-
-# Reference Manual 22.1.16 - we will add more ...:
-# select * from information_schema.parameters;
-# select * from information_schema.referential_constraints;
-# select * from information_schema.triggers;
-
-let $message= root: check with db name;
-let $dd_part1= SELECT COUNT(*) FROM information_schema.;
-let $dd_part2=;
---source suite/funcs_1/datadict/datadict_tables.inc
-
-# cleanup
-USE db_datadict;
-DROP VIEW v1, vu1, vu;
-DROP PROCEDURE db_datadict.sp_1;
-USE information_schema;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.2:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.2: Ensure that queries on an INFORMATION_SCHEMA table can
-# accept all SELECT statement options and are always
-# correctly evaluated.
-################################################################################
-
-# currently here only a subset of select statement options is checked, it's still
-# not possible to check here all possible options
-select catalog_name, schema_name, default_character_set_name
- from schemata where schema_name like '%s%';
-
-select count(*) as tot_tabs from tables;
-select count(*) as the_cols from columns;
-
-select max(maxlen) as the_max from character_sets;
-select * from collations order by id asc limit 0, 5;
-select * from collation_character_set_applicability
- order by character_set_name desc, collation_name limit 0, 5;
-
-select routine_definition from routines;
-select * from statistics where table_name not like 'help_%'
-group by index_name asc limit 0, 5;
-select concat(table_schema, ', ', table_name, ', ', view_definition) view_info
- from views;
-select concat(table_schema, ', ', table_name) "Table_info"
- from tables ORDER BY 1;
-
---replace_result $SERVER_NAME
---sorted_result
-select distinct grantee from user_privileges order by grantee, privilege_type;
-select * from schema_privileges where table_catalog is null limit 0, 5;
-select * from table_privileges where grantee like '%r%' limit 0, 5;
-
-select * from column_privileges where table_catalog is not null limit 0, 5;
-select HIGH_PRIORITY * from table_constraints
- group by constraint_name desc limit 0, 5;
-select sum(ordinal_position) from key_column_usage;
-
-select * from schemata limit 0,5;
-select * from schemata limit 0,5;
---replace_result $SERVER_NAME
---sorted_result
-select distinct grantee from user_privileges;
---replace_result $SERVER_NAME
---sorted_result
-select all grantee from user_privileges order by grantee, privilege_type;
-
-select id , character_set_name from collations order by id asc limit 10;
-
-select table_catalog from columns
- union all
-select table_catalog from tables limit 0,5;
-select table_catalog from columns
- union
-select table_catalog from tables limit 0,5;
-
-select all schema_name from information_schema.schemata;
-
-# the $ENGINE_TYPE variable is used here ONLY to have 3 different file names in
-# the three datadict testcases innodb_*, memory_* and myisam_*
-eval SELECT *
- INTO OUTFILE '../tmp/out.$ENGINE_TYPE.file'
- FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
- LINES TERMINATED BY '\n'
- FROM schemata LIMIT 0, 5;
-
-USE test;
-
-eval SELECT *
- INTO OUTFILE '../tmp/out.$ENGINE_TYPE.db.file'
- FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
- LINES TERMINATED BY '\n'
- FROM information_schema.schemata
- WHERE schema_name LIKE 'db_%';
-
-# check also with a 'simple' user
-CREATE USER user_3212@localhost;
-GRANT ALL ON db_datadict.* TO user_3212@localhost;
-# OBN: The following line was added following the fix to bug 28181
-# where queries to information_schema will fail if exporting to
-# a file without having the FILE attribute
-GRANT FILE ON *.* TO user_3212@localhost;
-
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u3212,localhost,user_3212,,db_datadict);
---source suite/funcs_1/include/show_connection.inc
-
-# no db given --> db_datadict.schema does not exist
---error ER_NO_SUCH_TABLE
-eval SELECT *
- INTO OUTFILE '../tmp/out.$ENGINE_TYPE.user.file'
- FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
- LINES TERMINATED BY '\n'
- FROM schemata LIMIT 0, 5;
---error ER_NO_SUCH_TABLE
-eval SELECT *
- FROM schemata LIMIT 0, 5;
-
-eval SELECT *
- INTO OUTFILE '../tmp/out.$ENGINE_TYPE.user.db.file'
- FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
- LINES TERMINATED BY '\n'
- FROM information_schema.schemata
- WHERE schema_name LIKE 'db_%';
-
-eval SELECT *
- FROM information_schema.schemata
- WHERE schema_name LIKE 'db_%';
-
-USE information_schema;
-
-eval SELECT *
- INTO OUTFILE '../tmp/out.$ENGINE_TYPE.user_2.file'
- FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
- LINES TERMINATED BY '\n'
- FROM schemata LIMIT 0, 5;
-
-eval SELECT *
- FROM schemata LIMIT 0, 5;
-
-eval SELECT *
- INTO OUTFILE '../tmp/out.$ENGINE_TYPE.user_2.db.file'
- FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
- LINES TERMINATED BY '\n'
- FROM information_schema.schemata
- WHERE schema_name LIKE 'db_%';
-
-eval SELECT *
- FROM information_schema.schemata
- WHERE schema_name LIKE 'db_%';
-
-disconnect u3212;
-connection default;
-USE information_schema;
---source suite/funcs_1/include/show_connection.inc
-
-use db_datadict;
-select table_catalog "1", table_schema "2", table_name "3", column_name "4"
- from information_schema.columns
-union
-select table_catalog, table_schema, table_name,
- concat( "*** type = ", table_type )
- from information_schema.tables
- order by 3, 4 desc, 1, 2 limit 30;
-
-use information_schema;
---source suite/funcs_1/datadict/datadict_bug_12777.inc
-select table_catalog "1", table_schema "2", table_name "3", column_name "4"
- from columns
-union
-select table_catalog, table_schema, table_name,
- concat( "*** type = ", table_type )
- from tables
- order by 3, 4 desc, 1, 2 limit 30;
-
-# cleanup
-DROP USER user_3212@localhost;
-
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.3: Ensure that no user may execute an INSERT statement on any
-# INFORMATION_SCHEMA table.
-################################################################################
-
-#FIXME: in this block we had --error 1288 until Mid Sep05, check the change!
---error ER_DBACCESS_DENIED_ERROR
-insert into schemata (catalog_name, schema_name, default_character_set_name, sql_path)
- values ('null', 'db1', 'latin1', 'null');
---error ER_DBACCESS_DENIED_ERROR
-insert into tables (table_schema, table_name)values('db_datadict', 't1');
---error ER_DBACCESS_DENIED_ERROR
-insert into columns (table_name, column_name)values('t3', 'f2');
---error ER_DBACCESS_DENIED_ERROR
-insert into character_sets (character_set_name, default_collate_name, description, maxlen)
- values('cp1251', 'cp1251_general_ci', 'windows cyrillic', 1);
---error ER_DBACCESS_DENIED_ERROR
-insert into collations ( collation_name, character_set_name, id, is_default, is_compiled, sortlen)
- values ('cp1251_bin', 'cp1251', 50, '', '', 0);
---error ER_DBACCESS_DENIED_ERROR
-insert into collation_character_set_applicability (collation_name, character_set_name)
- values (' big5_chinese_ci', 'big6');
---error ER_DBACCESS_DENIED_ERROR
-insert into routines(routine_name, routine_type ) values ('p2', 'procedure');
---error ER_DBACCESS_DENIED_ERROR
-insert into statistics(table_schema, table_name, index_name)
- values ('mysql', 'db', 'primary');
---error ER_DBACCESS_DENIED_ERROR
-insert into views(table_schema, table_name) values ('db2', 'v2');
---error ER_DBACCESS_DENIED_ERROR
-insert into user_privileges (privilege_type, is_grantable) values ('select', 'yes');
---error ER_DBACCESS_DENIED_ERROR
-insert into schema_privileges (table_schema, privilege_type) values('db2', 'insert');
---error ER_DBACCESS_DENIED_ERROR
-insert into table_privileges (able_schema, table_name, privilege_type)
- values('db2', 'v2', 'insert');
---error ER_DBACCESS_DENIED_ERROR
-insert into column_privileges (table_name, column_name, privilege_type)
- values ('t3', 'f3', 'insert');
---error ER_DBACCESS_DENIED_ERROR
-insert into table_constraints ( constraint_schema, constraint_name, table_schema)
- values ('primary', 'mysql', 'user');
---error ER_DBACCESS_DENIED_ERROR
-insert into key_column_usage (constraint_schema, constraint_name, table_name)
- values ('mysql', 'primary', 'db');
-
-# insert through a procedure
---disable_warnings
-drop procedure if exists db_datadict.sp_4_1_3;
---enable_warnings
-
-delimiter //;
-create procedure db_datadict.sp_4_1_3()
-begin
- insert into information_schema.schema_privileges (table_schema,privilege_type)
- values('db2','insert');
-end//
-delimiter ;//
-
-#FIXME: check for the diffs Win ./. Linux
-SELECT table_schema, privilege_type FROM information_schema.schema_privileges
- WHERE table_schema LIKE 'db%';
-
---error ER_DBACCESS_DENIED_ERROR
-call db_datadict.sp_4_1_3();
-
-#FIXME: check for the diffs Win ./. Linux
-SELECT table_schema, privilege_type FROM information_schema.schema_privileges
- WHERE table_schema LIKE 'db%';
-
-# cleanup
-drop procedure db_datadict.sp_4_1_3;
-
-# insert into information_schema as a limited user
-
-CREATE USER user_4_1_3@localhost;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u413,localhost,user_4_1_3,,test);
---source suite/funcs_1/include/show_connection.inc
-
-use information_schema;
-
-#FIXME: check later the change from 1288 to 1044 (since Mid Sep05)
---error ER_DBACCESS_DENIED_ERROR
-insert into table_constraints ( constraint_schema, constraint_name, table_schema)
- values ('primary', 'mysql', 'user');
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.4:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.4: Ensure that no user may execute an UPDATE statement on any
-# INFORMATION_SCHEMA table.
-################################################################################
-
-use information_schema;
---source suite/funcs_1/include/show_connection.inc
-
-#FIXME: check later the change from 1288 to 1044 (since Mid Sep05) in the whole next block
---error ER_DBACCESS_DENIED_ERROR
-update schemata set schema_name = 'db5' where default_character_set_name = 'latin1';
---error ER_DBACCESS_DENIED_ERROR
-update tables set table_schema = 'db_datadict1' where table_name = 't1';
---error ER_DBACCESS_DENIED_ERROR
-update columns set table_name = 't4' where column_name = 'f2';
---error ER_DBACCESS_DENIED_ERROR
-update character_sets set character_set_name = 'cp1252' where maxlen = 1;
---error ER_DBACCESS_DENIED_ERROR
-update collations set collation_name = 'cp1253_bin'
- where character_set_name = 'cp1251';
---error ER_DBACCESS_DENIED_ERROR
-update collation_character_set_applicability set collation_name = 'big6_chinese_ci'
- where character_set_name = 'big6';
---error ER_DBACCESS_DENIED_ERROR
-update routines set routine_name = p2 where routine_body = 'sql';
---error ER_DBACCESS_DENIED_ERROR
-update statistics set table_schema = 'mysql1' where table_name = 'db';
---error ER_DBACCESS_DENIED_ERROR
-update views set table_schema = 'db3' where table_name = 'v1';
---error ER_DBACCESS_DENIED_ERROR
-update user_privileges set privilege_type = 'insert' where is_grantable = 'yes';
---error ER_DBACCESS_DENIED_ERROR
-update schema_privileges set table_schema = 'db2' where privilege_type = 'select';
---error ER_DBACCESS_DENIED_ERROR
-update table_privileges set table_name = 'v3' where privilege_type = 'select';
---error ER_DBACCESS_DENIED_ERROR
-update column_privileges set table_name = 't4' where column_name = 'f3';
---error ER_DBACCESS_DENIED_ERROR
-update table_constraints set constraint_schema = 'primary'
- where table_schema = 'proc';
---error ER_DBACCESS_DENIED_ERROR
-update key_column_usage set table_name = 'db1' where constraint_name = 'primary';
-
-# update through a procedure
---disable_warnings
-drop procedure if exists db_datadict.sp_4_1_4;
---enable_warnings
-
-delimiter //;
-create procedure db_datadict.sp_4_1_4()
-begin
- update information_schema.routines set routine_name = 'p2'
- where routine_name = 'sp_4_1_4';
-end//
-delimiter ;//
-
-#FIXME: check for the diffs Win ./. Linux
---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-select * from information_schema.routines;
-
---error ER_DBACCESS_DENIED_ERROR
-call db_datadict.sp_4_1_4();
-
-#FIXME: check for the diffs Win ./. Linux
---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-select * from information_schema.routines;
-
-# cleanup
-drop procedure db_datadict.sp_4_1_4;
-
-# update information_schema as a limited user
-
-connection u413;
-
-use information_schema;
---source suite/funcs_1/include/show_connection.inc
-
-#FIXME: check later the change from 1288 to 1044 (since Mid Sep05)
---error ER_DBACCESS_DENIED_ERROR
-update user_privileges set privilege_type = 'insert' where is_grantable = 'yes';
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-#
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.5:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.5: Ensure that no user may execute a DELETE statement on any
-# INFORMATION_SCHEMA table.
-################################################################################
-
-use information_schema;
-
-let $message= root: DELETE FROM any table in IS;
-let $dd_part1= DELETE FROM;
-let $dd_part2=;
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-
-#FIXME: check later the change from 1288 to 1044 (since Mid Sep05) in the whole next block
---error ER_DBACCESS_DENIED_ERROR
-delete from schemata where schema_name = 'mysql';
---error ER_DBACCESS_DENIED_ERROR
-delete from tables where table_name = 'abc';
---error ER_DBACCESS_DENIED_ERROR
-delete from columns;
---error ER_DBACCESS_DENIED_ERROR
-delete from character_sets;
---error ER_DBACCESS_DENIED_ERROR
-delete from collations;
---error ER_DBACCESS_DENIED_ERROR
-delete from collation_character_set_applicability;
---error ER_DBACCESS_DENIED_ERROR
-delete from routines;
---error ER_DBACCESS_DENIED_ERROR
-delete from statistics;
---error ER_DBACCESS_DENIED_ERROR
-delete from views;
---error ER_DBACCESS_DENIED_ERROR
-delete from user_privileges;
---error ER_DBACCESS_DENIED_ERROR
-delete from schema_privileges;
---error ER_DBACCESS_DENIED_ERROR
-delete from table_privileges;
---error ER_DBACCESS_DENIED_ERROR
-delete from column_privileges;
---error ER_DBACCESS_DENIED_ERROR
-delete from table_constraints;
---error ER_DBACCESS_DENIED_ERROR
-delete from key_column_usage;
-
-# delete through a procedure
---disable_warnings
-drop procedure if exists db_datadict.sp_4_1_5;
---enable_warnings
-
-delimiter //;
-create procedure db_datadict.sp_4_1_5()
-begin
- delete from information_schema.column_privileges;
-end//
-delimiter ;//
-
---error ER_DBACCESS_DENIED_ERROR
-call db_datadict.sp_4_1_5();
-
-# cleanup
-drop procedure db_datadict.sp_4_1_5;
-
-# delete from information_schema as a limited user
-
-connection u413;
-
-use information_schema;
---source suite/funcs_1/include/show_connection.inc
-
-#FIXME: check later the change from 1288 to 1044 (since Mid Sep05)
---error ER_DBACCESS_DENIED_ERROR
-delete from tables where table_name = 'abc';
-
-disconnect u413;
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-
-# cleanup
-DROP USER user_4_1_3@localhost;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.6:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.6: Ensure that no user may create an INFORMATION_SCHEMA base
-# table.
-################################################################################
-
-use information_schema;
-
-let $message= root: create a table with a name of an IS table directly in IS;
-let $dd_part1= CREATE TABLE;
-let $dd_part2= ( c1 INT );
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-#FIXME solved - 3.2.1.6: check for better error message - 42S02: Unknown table '' in ?
---error ER_UNKNOWN_TABLE
-create table t1 (f1 int, f2 int, f3 int);
-
-use db_datadict;
-
-#FIXME: check correct error message - HY000 Can't create/write to file '.\information_schema\columns.frm' (Errcode: 2)
-let $message= root: create a table with a name of an IS table from other db;
-let $dd_part1= CREATE TABLE information_schema.;
-let $dd_part2= ( c1 INT );
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-#FIXME solved - 3.2.1.6: check for better error message - 42S02: Unknown table '' in ?
---error ER_UNKNOWN_TABLE
-create table information_schema.t1 (f1 int, f2 int, f3 int);
-
-# create a table in information_schema as a limited user with sufficient permissions
-CREATE USER user_4_1_6@localhost;
-
-grant all on *.* to user_4_1_6@localhost;
-
-FLUSH PRIVILEGES;
-
-SHOW GRANTS FOR user_4_1_6@localhost;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u2, localhost, user_4_1_6, , information_schema);
---source suite/funcs_1/include/show_connection.inc
-
-use information_schema;
-
-let $message= user: create a table with a name of an IS table directly in IS;
-let $dd_part1= CREATE TABLE;
-let $dd_part2= ( c1 INT );
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-#FIXME solved - 3.2.1.6: check for better error message - 42S02: Unknown table '' in ?
---error ER_UNKNOWN_TABLE
-create table t1 (f1 int, f2 int, f3 int);
-
-use test;
-
-#FIXME 3.2.1.6: check correct error message - HY000 Can't create/write to file '.\information_schema\columns.frm' (Errcode: 2)
-let $message= user: create a table with a name of an IS table from other db;
-let $dd_part1= CREATE TABLE information_schema.;
-let $dd_part2= ( c1 INT );
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-#FIXME solved - 3.2.1.6: check for better error message - 42S02: Unknown table '' in ?
---error ER_UNKNOWN_TABLE
-create table information_schema.t1 (f1 int, f2 int, f3 int);
-
-#cleanup
-connection default;
---source suite/funcs_1/include/show_connection.inc
-disconnect u2;
-DROP USER user_4_1_6@localhost;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.7:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.7: Ensure that no user may create an INFORMATION_SCHEMA view.
-################################################################################
-
-use information_schema;
-
-let $message= root: create a view with a name of an IS table directly in IS;
-let $dd_part1= CREATE VIEW ;
-let $dd_part2= AS SELECT * FROM mysql.time_zone;
-#FIXME: check change from error 1 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-
---error ER_UNKNOWN_TABLE
-CREATE VIEW v1 AS SELECT * FROM information_schema.schemata;
-
-USE db_datadict;
-
-let $message= root: create a view with a name of an IS table from other db;
-let $dd_part1= CREATE VIEW information_schema.;
-let $dd_part2= AS SELECT * FROM mysql.time_zone;
-#FIXME: check change from error 1 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-
-# ... but creating a view that 'uses' the information_schema is allowed:
-CREATE VIEW v1 AS SELECT * FROM information_schema.columns;
-
-SELECT * FROM v1 LIMIT 5;
-
-# create a view in information_schema as a limited user with sufficient permissions
-CREATE USER user_4_1_7@localhost;
-
-GRANT ALL ON db_datadict.* TO user_4_1_7@localhost;
-#FIXME: check that GRANT ON i_s is no longer allowed
---error ER_DBACCESS_DENIED_ERROR
-GRANT ALL ON information_schema.* TO user_4_1_7@localhost;
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u3, localhost, user_4_1_7, , db_datadict);
-use information_schema;
---source suite/funcs_1/include/show_connection.inc
-
-let $message= user: create a view with a name of an IS table directly in IS;
-let $dd_part1= CREATE VIEW ;
-let $dd_part2= AS SELECT * FROM db_datadict.v1;
-#FIXME: check change from error 1 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
---error ER_UNKNOWN_TABLE
-create view v1 as select * from table_privileges;
-
-use db_datadict;
-
-let $message= user: create a view with a name of an IS table from other db;
-let $dd_part1= CREATE VIEW information_schema.;
-let $dd_part2= AS SELECT * FROM db_datadict.v1;
-#FIXME: check change from error 1 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-disconnect u3;
-
-# cleanup
-connection default;
---source suite/funcs_1/include/show_connection.inc
-DROP USER user_4_1_7@localhost;
-DROP VIEW db_datadict.v1;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.8:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.8: Ensure that no user may create an index on an
-# INFORMATION_SCHEMA table.
-################################################################################
-
-use information_schema;
-
-#FIXME: check later the change from 1288 to 1044 (since Mid Sep05)
---error ER_DBACCESS_DENIED_ERROR
-create index i1 on schemata(schema_name);
---error ER_DBACCESS_DENIED_ERROR
-create index i2 on tables(table_schema);
---error ER_DBACCESS_DENIED_ERROR
-create index i3 on columns(table_name);
-
---error ER_DBACCESS_DENIED_ERROR
-create index i4 on character_sets(character_set_name);
---error ER_DBACCESS_DENIED_ERROR
-create index i5 on collations( collation_name);
---error ER_DBACCESS_DENIED_ERROR
-create index i6 on collation_character_set_applicability(collation_name);
-
---error ER_DBACCESS_DENIED_ERROR
-create index i7 on routines(routine_name);
---error ER_DBACCESS_DENIED_ERROR
-create index i8 on statistics(table_schema);
---error ER_DBACCESS_DENIED_ERROR
-create index i9 on views(table_schema);
-
---error ER_DBACCESS_DENIED_ERROR
-create index i10 on user_privileges(privilege_type);
---error ER_DBACCESS_DENIED_ERROR
-create index i11 on schema_privileges(table_schema);
---error ER_DBACCESS_DENIED_ERROR
-create index i12 on table_privileges(able_schema);
-
---error ER_DBACCESS_DENIED_ERROR
-create index i13 on column_privileges(table_name);
---error ER_DBACCESS_DENIED_ERROR
-create index i14 on table_constraints(constraint_schema);
---error ER_DBACCESS_DENIED_ERROR
-create index i15 on key_column_usage(constraint_schema);
---error ER_DBACCESS_DENIED_ERROR
-create index i16 on triggers(trigger_name);
-
-use db_datadict;
---error ER_DBACCESS_DENIED_ERROR
-create index i15 on information_schema.key_column_usage(constraint_schema);
-
-use information_schema;
-
-# create an index on an information_schema table as a limited user with sufficient permissions
-CREATE USER user_4_1_8@localhost;
-
-grant select, index on *.* to user_4_1_8@localhost;
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u4, localhost, user_4_1_8, , test);
---source suite/funcs_1/include/show_connection.inc
-
-use information_schema;
-
---error ER_DBACCESS_DENIED_ERROR
-create index i1 on schemata(schema_name);
---error ER_DBACCESS_DENIED_ERROR
-create index i2 on tables(table_schema);
---error ER_DBACCESS_DENIED_ERROR
-create index i3 on columns(table_name);
-
---error ER_DBACCESS_DENIED_ERROR
-create index i4 on character_sets(character_set_name);
---error ER_DBACCESS_DENIED_ERROR
-create index i5 on collations( collation_name);
---error ER_DBACCESS_DENIED_ERROR
-create index i6 on collation_character_set_applicability(collation_name);
-
---error ER_DBACCESS_DENIED_ERROR
-create index i7 on routines(routine_name);
---error ER_DBACCESS_DENIED_ERROR
-create index i8 on statistics(table_schema);
---error ER_DBACCESS_DENIED_ERROR
-create index i9 on views(table_schema);
-
---error ER_DBACCESS_DENIED_ERROR
-create index i10 on user_privileges(privilege_type);
---error ER_DBACCESS_DENIED_ERROR
-create index i11 on schema_privileges(table_schema);
---error ER_DBACCESS_DENIED_ERROR
-create index i12 on table_privileges(able_schema);
-
---error ER_DBACCESS_DENIED_ERROR
-create index i13 on column_privileges(table_name);
---error ER_DBACCESS_DENIED_ERROR
-create index i14 on table_constraints(constraint_schema);
---error ER_DBACCESS_DENIED_ERROR
-create index i15 on key_column_usage(constraint_schema);
---error ER_DBACCESS_DENIED_ERROR
-create index i16 on triggers(trigger_name);
-
-use db_datadict;
---error ER_DBACCESS_DENIED_ERROR
-create index i15 on information_schema.key_column_usage(constraint_schema);
-
-disconnect u4;
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-
-# cleanup
-DROP USER user_4_1_8@localhost;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.9:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.9: Ensure that no user may alter the definition of an
-# INFORMATION_SCHEMA table.
-################################################################################
-
-#FIXME: 3.2.1.9 check for better error message than ERROR 42S02: Table 'information_schema.schemata' doesn't exist
-
-# first simple check all known - so we never forget one ...
-let $message= root: alter a table from other db;
-let $dd_part1= ALTER TABLE information_schema.;
-let $dd_part2= ADD f1 INT;
-#FIXME: check change from error 1146 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-use information_schema;
-let $message= root: alter a table from directly;
-let $dd_part1= ALTER TABLE ;
-let $dd_part2= ADD f1 INT;
-#FIXME: check change from error 1146 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-# now more detailed checks
---error ER_DBACCESS_DENIED_ERROR
-alter table schemata add f1 int;
---error ER_DBACCESS_DENIED_ERROR
-alter table tables drop primary key;
---error ER_DBACCESS_DENIED_ERROR
-alter table columns add f1 int;
---error ER_DBACCESS_DENIED_ERROR
-alter table character_sets disable keys;
---error ER_DBACCESS_DENIED_ERROR
-alter table collations enable keys;
---error ER_DBACCESS_DENIED_ERROR
-alter table collation_character_set_applicability add f1 int;
---error ER_DBACCESS_DENIED_ERROR
-alter table routines discard tablespace;
---error ER_DBACCESS_DENIED_ERROR
-alter table statistics import tablespace;
---error ER_DBACCESS_DENIED_ERROR
-alter table views drop column table_name;
---error ER_DBACCESS_DENIED_ERROR
-alter table user_privileges drop index privilege_type;
---error ER_DBACCESS_DENIED_ERROR
-alter table schema_privileges drop column is_grantable;
---error ER_DBACCESS_DENIED_ERROR
-alter table table_privileges order by constraint_type;
---error ER_DBACCESS_DENIED_ERROR
-alter table column_privileges rename to aaxyz;
---error ER_DBACCESS_DENIED_ERROR
-alter table table_constraints order by schema_name;
---error ER_DBACCESS_DENIED_ERROR
-alter table key_column_usage rename to information_schema.aabxyz;
---error ER_DBACCESS_DENIED_ERROR
-alter table triggers rename to information_schema.sql_mode;
-# Alter an information_schema table as a limited user with sufficient permissions
-
-CREATE USER user_4_1_9@localhost;
-
-grant select, alter, create, insert on *.* to user_4_1_9@localhost;
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u5, localhost, user_4_1_9, , db_datadict);
---source suite/funcs_1/include/show_connection.inc
-
-use db_datadict;
-
-let $message= user: alter a table from other db;
-let $dd_part1= ALTER TABLE information_schema.;
-let $dd_part2= ADD f1 INT;
-#FIXME: check change from error 1146 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-use information_schema;
-let $message= user: alter a table from directly;
-let $dd_part1= ALTER TABLE ;
-let $dd_part2= ADD f1 INT;
-#FIXME: check change from error 1146 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-disconnect u5;
-
-# cleanup
-connection default;
---source suite/funcs_1/include/show_connection.inc
-DROP USER user_4_1_9@localhost;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.10:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table.
-################################################################################
-
-use information_schema;
-
-let $message= root: drop a table from IS;
-let $dd_part1= DROP TABLE ;
-let $dd_part2=;
-#FIXME: check change from error 1051 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-use db_datadict;
-
-let $message= root: drop a table from other db;
-let $dd_part1= DROP TABLE information_schema.;
-let $dd_part2=;
-#FIXME: check change from error 1051 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-use information_schema;
-
-# drop an information_schema table as a limited user with sufficient permissions
-
-CREATE USER user_4_1_10@localhost;
-
-GRANT SELECT, DROP ON *.* TO user_4_1_10@localhost;
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u6,localhost,user_4_1_10,,db_datadict);
-
-use information_schema;
---source suite/funcs_1/include/show_connection.inc
-
-let $message= user: drop a table from IS;
-let $dd_part1= DROP TABLE ;
-let $dd_part2=;
-#FIXME: check change from error 1051 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-use db_datadict;
-
-let $message= user: drop a table from other db;
-let $dd_part1= DROP TABLE information_schema.;
-let $dd_part2=;
-#FIXME: check change from error 1051 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-disconnect u6;
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-
-# cleanup
-DROP USER user_4_1_10@localhost;
-
-# Try to carry out information_schema modification operations with a user other than root having SUPER privileges
-CREATE USER user_4_1_11@localhost;
-
-GRANT SUPER ON *.* TO user_4_1_11@localhost;
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u7,localhost,user_4_1_11, ,test);
-
-use information_schema;
---source suite/funcs_1/include/show_connection.inc
-
---error ER_DBACCESS_DENIED_ERROR
-drop table routines;
-
---error ER_DBACCESS_DENIED_ERROR
-alter table collations enable keys;
-
---error ER_DBACCESS_DENIED_ERROR
-create index i5 on collations( collation_name );
-
---error ER_UNKNOWN_TABLE
-create view v1 as select * from schemata;
-
---error ER_DBACCESS_DENIED_ERROR
-delete from columns;
-
---error ER_DBACCESS_DENIED_ERROR
-update columns set table_name = 't4' where column_name = 'f2';
-
---error ER_DBACCESS_DENIED_ERROR
-insert into collations ( collation_name, character_set_name, id, is_default,
- is_compiled, sortlen)
- values ('cp1251_bin', 'cp1251', 50, '', '', 0);
-
-disconnect u7;
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-DROP USER user_4_1_11@localhost;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.11:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table
-# to any other database.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-
-CREATE DATABASE db_datadict;
-CREATE USER 'u_6_401011'@'localhost';
-
-#FIXME: check that GRANT ON i_s is no longer allowed
---error ER_DBACCESS_DENIED_ERROR
-GRANT ALL ON information_schema.* TO 'u_6_401011'@'localhost';
-GRANT ALL ON db_datadict.* TO 'u_6_401011'@'localhost';
-
-FLUSH PRIVILEGES;
-
---error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE information_schema.schemata RENAME db_datadict.schemata;
-
-let $message= root: move table to other DB;
-let $dd_part1= ALTER TABLE information_schema.;
-let $dd_part2= RENAME db_datadict.tb_01;
-#FIXME: check change from error 1146 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401011, localhost, u_6_401011, , db_datadict);
-
-USE information_schema;
---source suite/funcs_1/include/show_connection.inc
-
---error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE information_schema.schemata RENAME db_datadict.schemata;
-
-let $message= user: move table to other DB;
-let $dd_part1= ALTER TABLE information_schema.;
-let $dd_part2= RENAME db_datadict.tb_01;
-#FIXME: check change from error 1146 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-disconnect u_6_401011;
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-
-#cleanup
---disable_warnings
-#DROP DATABASE db_datadict;
-DROP TABLE IF EXISTS db_datadict.schemata;
-DROP USER 'u_6_401011'@'localhost';
---enable_warnings
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.12:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.12: Ensure that no user may directly add to, alter, or delete
-# any data in an INFORMATION_SCHEMA table.
-################################################################################
-
-# first as root a DELETE check on all tables
-let $message= root: delete from IS tables;
-let $dd_part1= DELETE FROM information_schema.;
-let $dd_part2=;
-#FIXME: check change from error 1288 to 1044
---source suite/funcs_1/datadict/datadict_tables_error_1044.inc
-# check UPDATE for all ...
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.tables SET table_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.columns SET table_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.statistics SET table_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.views SET table_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.table_privileges SET table_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.column_privileges SET table_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.table_constraints SET table_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.key_column_usage SET table_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.schemata SET catalog_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.character_sets SET description = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.collations SET character_set_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.collation_character_set_applicability
- SET character_set_name = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.routines SET routine_type = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.user_privileges SET grantee = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.schema_privileges SET grantee = 't_4711';
---error ER_DBACCESS_DENIED_ERROR
-UPDATE information_schema.triggers SET sql_mode = 't_4711';
-
-CREATE USER 'u_6_401012'@'localhost';
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401012, localhost, u_6_401012, , test);
-
-use information_schema;
-
---error ER_DBACCESS_DENIED_ERROR
-insert into information_schema.schemata (catalog_name, schema_name,
- default_character_set_name, sql_path)
- values (null, information_schema1, utf16, null);
-#FIXME: check later the change from 1142 to 1044 (since Mid Sep05)
---error ER_DBACCESS_DENIED_ERROR
-alter table information_schema.schemata rename db_datadict1.schemata;
-#FIXME: check later the change from 1146 to 1044 (since Mid Sep05)
---error ER_DBACCESS_DENIED_ERROR
-alter table information_schema.tables drop column checksum;
---error ER_DBACCESS_DENIED_ERROR
-alter table information_schema.statistics modify packed int;
---error ER_DBACCESS_DENIED_ERROR
-alter table information_schema.routines modify created int not null;
---error ER_DBACCESS_DENIED_ERROR
-alter table information_schema.key_column_usage drop column ordinal_position;
---error ER_DBACCESS_DENIED_ERROR
-alter table information_schema.table_privileges
- change privilege_type rights_approved varchar(32);
---error ER_DBACCESS_DENIED_ERROR
-update columns set table_name = 't4' where column_name = 'f2';
---error ER_DBACCESS_DENIED_ERROR
-delete from information_schema.collations;
-
-disconnect u_6_401012;
-
-# cleanup
-connection default;
---source suite/funcs_1/include/show_connection.inc
-
---disable_warnings
-drop table if exists db_datadict1.schemata;
-DROP USER 'u_6_401012'@'localhost';
---enable_warnings
-#-------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.13:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.13: Ensure that the creation of any new database object
-# (e.g. table or column) automatically inserts all relevant
-# information on that object into every appropriate
-# INFORMATION_SCHEMA table.
-################################################################################
-
-use information_schema;
-
-let $dbname=db_datadict;
-let $message= first check status >before< creating the objects ...;
---source suite/funcs_1/datadict/datadict_show_schema.inc
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-CREATE DATABASE db_datadict;
-USE db_datadict;
-
-eval create table res_t_401013(f1 char(10), f2 char(25), f3 int)
- engine = $ENGINE_TYPE;
-create view res_v_401013 as select * from res_t_401013;
-CREATE USER u_6_401013@localhost;
-create procedure sp_6_401013() select 'db_datadict';
-create function fn_6_401013() returns int return 0;
-create index i_6_401013 on res_t_401013(f3);
-
-use information_schema;
-
-let $message= now check whether all new objects exists in IS ...;
---source suite/funcs_1/datadict/datadict_show_schema.inc
-
-# cleanup objects
-use db_datadict;
-drop index i_6_401013 on res_t_401013;
-drop table db_datadict.res_t_401013;
-drop view db_datadict.res_v_401013;
-DROP USER u_6_401013@localhost;
-drop procedure sp_6_401013;
-drop function fn_6_401013;
-drop database db_datadict;
-
-use information_schema;
-
-let $message= and now check whether all objects are removed from IS ...;
---source suite/funcs_1/datadict/datadict_show_schema.inc
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.14:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.14: Ensure that the alteration of any existing database object
-# automatically updates all relevant information on that
-# object in every appropriate INFORMATION_SCHEMA table.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-CREATE DATABASE db_datadict;
-USE db_datadict;
-
-create table res_t_401014(f1 char(10), f2 varchar(25), f3 int);
-create view res_v_401014 as select * from res_t_401014;
-create procedure sp_6_401014() select 'db_datadict';
-create function fn_6_401014() returns int return 0;
-
-# check current information in information_schema
-
-let $dbname=db_datadict;
-let $message= show existing objects >before< changing them ...;
---source suite/funcs_1/datadict/datadict_show_schema.inc
-
-# alter objects
-
-use db_datadict;
-
-alter table res_t_401014 change f1 ff1 int;
-eval alter table res_t_401014 engine = $OTHER_ENGINE_TYPE;
-alter table res_t_401014 change f3 f3_new bigint;
-alter view res_v_401014 as select ff1 from res_t_401014;
-alter procedure sp_6_401014 sql security invoker;
-alter function fn_6_401014 comment 'updated comments';
-alter database db_datadict character set utf8;
-
-# check updated information in information_schema
-let $message= now check whether the changes are visible in IS ...;
---source suite/funcs_1/datadict/datadict_show_schema.inc
-
-
-# cleanup
-
-use db_datadict;
-drop table db_datadict.res_t_401014;
-drop view db_datadict.res_v_401014;
-drop procedure sp_6_401014;
-drop function fn_6_401014;
-drop database db_datadict;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.15:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.15: Ensure that the dropping of any existing database object
-# automatically deletes all relevant information on that
-# object from every appropriate INFORMATION_SCHEMA table.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-CREATE DATABASE db_datadict;
-USE db_datadict;
-
-create table res_t_401015(f1 char(10), f2 text(25), f3 int);
-create view res_v_401015 as select * from res_t_401015;
-CREATE USER u_6_401015@localhost;
-create procedure sp_6_401015() select 'test';
-create function fn_6_401015() returns int return 0;
-create index i_6_401015 on res_t_401015(f3);
-
-let $dbname=db_datadict;
-let $message= show existing objects >before< dropping them ...;
---source suite/funcs_1/datadict/datadict_show_schema.inc
-
-use db_datadict;
-drop index i_6_401015 on res_t_401015;
-drop table db_datadict.res_t_401015;
-drop view db_datadict.res_v_401015;
-DROP USER u_6_401015@localhost;
-drop procedure sp_6_401015;
-drop function fn_6_401015;
-#drop database db_datadict;
-
-let $message= now check they are really gone ...;
---source suite/funcs_1/datadict/datadict_show_schema.inc
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.16:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.16: Ensure that no user may use any INFORMATION_SCHEMA table to
-# determine any information on a database and/or its
-# structure unless authorized to get that information.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-CREATE DATABASE db_datadict;
-
-CREATE DATABASE db_hidden;
-USE db_hidden;
-CREATE TABLE tb_hidden ( c1 TEXT );
-
-USE db_datadict;
-
-CREATE TABLE res_t_401016(f1 char(10),f2 text(25),f3 int);
-CREATE TABLE res_t_401016_1(f1 char(10),f2 text(25),f3 int);
-
-CREATE USER 'u_6_401016'@'localhost';
-GRANT SELECT ON db_datadict.res_t_401016 TO 'u_6_401016'@'localhost';
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401016, localhost, u_6_401016, , test);
-
-USE information_schema;
-
-SELECT table_schema, table_name, engine
- FROM TABLES;
-# WHERE table_name LIKE 'res_t_401016%';
-
-SHOW TABLES;
-SELECT * FROM schemata;
-
-disconnect u_6_401016;
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-
-#FIXME: check that GRANT ON i_s is no longer allowed
---error ER_DBACCESS_DENIED_ERROR
-grant usage on information_schema.* to 'u_6_401016'@'localhost';
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401016_1, localhost, u_6_401016, , db_datadict);
-
-USE information_schema;
-SHOW TABLES;
-SELECT * FROM schemata;
-
-disconnect u_6_401016_1;
-
-# all tables are checked again later with permission tests
-
-# cleanup
-connection default;
-use db_datadict;
---source suite/funcs_1/include/show_connection.inc
-DROP USER 'u_6_401016'@'localhost';
-drop table res_t_401016;
-drop table res_t_401016_1;
-DROP DATABASE db_hidden;
-#drop database db_datadict;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.17:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.17: Ensure that the SELECT privilege is granted TO PUBLIC WITH
-# GRANT OPTION on every INFORMATION_SCHEMA table.
-################################################################################
-
-CREATE USER 'u_6_401017'@'localhost';
-
-#FIXME: check that GRANT ON i_s is no longer allowed
---error ER_DBACCESS_DENIED_ERROR
-grant select on information_schema.* to u_6_401017@localhost;
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401017, localhost, u_6_401017, , test);
-
-use information_schema;
-
-select * from collation_character_set_applicability
-where collation_name <> 'utf8_general_cs';
-select * from schemata;
-select table_name from tables;
---source suite/funcs_1/datadict/datadict_bug_12777.inc
-select table_name, column_name, column_type from columns;
-select character_set_name from character_sets;
-select collation_name from collations where collation_name <> 'utf8_general_cs';
-select routine_name, routine_type from routines;
-select table_name, index_name from statistics;
-select table_name from views;
-select privilege_type from user_privileges;
-select grantee, privilege_type from schema_privileges;
-select * from table_privileges;
-select column_name, privilege_type from column_privileges;
-select table_name,constraint_type from table_constraints;
-select table_schema, table_name, column_name from key_column_usage;
-
-disconnect u_6_401017;
-
-# cleanup
-connection default;
---source suite/funcs_1/include/show_connection.inc
-DROP USER 'u_6_401017'@'localhost';
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.18:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.18: Ensure that the CREATE VIEW privilege on an
-# INFORMATION_SCHEMA table may be granted to any user.
-################################################################################
-
-CREATE USER 'u_6_401018'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-GRANT CREATE VIEW ON information_schema.* TO 'u_6_401018'@'localhost';
-GRANT ALL ON db_datadict.* TO 'u_6_401018'@'localhost';
-
-SHOW GRANTS FOR 'u_6_401018'@'localhost';
-FLUSH PRIVILEGES;
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-CREATE DATABASE db_datadict;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401018, localhost, u_6_401018, , test);
-
-USE db_datadict;
-
-create view db_datadict.v_401018 as
- select * from information_schema.schemata;
-SELECT * FROM v_401018 ORDER BY 2 DESC;
-
-disconnect u_6_401018;
-
-#cleanup
-connection default;
---source suite/funcs_1/include/show_connection.inc
-DROP USER 'u_6_401018'@'localhost';
-DROP DATABASE db_datadict;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.19:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.19: Ensure that no other privilege on an INFORMATION_SCHEMA
-# table is granted, or may be granted, to any user.
-################################################################################
-
-CREATE USER 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant alter on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant alter routine on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant create on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant create routine on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant create temporary tables
- on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant delete on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant drop on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant execute on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant index on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant insert on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant lock tables on information_schema.* to 'u_6_401019'@'localhost';
-
-#FIXME: check GRANT on IS
---error ER_DBACCESS_DENIED_ERROR
-grant update on information_schema.* to 'u_6_401019'@'localhost';
-
-SELECT * FROM information_schema.table_privileges
- WHERE table_schema = "information_schema";
-SELECT * FROM information_schema.column_privileges
- WHERE table_schema = "information_schema";
-
-# cleanup
-DROP USER 'u_6_401019'@'localhost';
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.1.20:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.1.20: Ensure that USE INFORMATION_SCHEMA allows the user to
-# switch to the INFORMATION_SCHEMA database, for query
-# purposes only.
-################################################################################
-
-CREATE USER 'u_6_401020'@'localhost';
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401020, localhost, u_6_401020, , test);
-
-USE information_schema;
-SELECT * FROM schemata;
-
---error ER_UNKNOWN_TABLE
-CREATE TABLE tb_not_allowed ( col TEXT );
-#FIXME 3.2.1.20: bad message: ERROR 42S02: Unknown table 'tb_not_allowed' in information_schema
-#FIXME 3.2.1.20: better: ERROR 42000: Access denied for user 'u_6_401020'@'localhost' to database 'information_schema'
-
---error ER_UNKNOWN_TABLE
-create view res_v1 as select * from information_schema.schemata;
-
---error ER_DBACCESS_DENIED_ERROR
-alter table schemata modify catalog_name varchar(255);
-
---error ER_DBACCESS_DENIED_ERROR
-update schemata set catalog_name = 'abc'
- where schema_name = 'information_schema';
-
-delimiter //;
---error ER_BAD_DB_ERROR
-CREATE PROCEDURE sp_3_2_1_20()
- BEGIN
- INSERT INTO information_schema.schema_privileges (table_schema,privilege_type)
- VALUES('db2','insert');
- END//
-delimiter ;//
-
---error ER_DBACCESS_DENIED_ERROR
-DELETE FROM schemata WHERE schema_name = 'information_schema';
-
-disconnect u_6_401020;
-
-# cleanup
-connection default;
---source suite/funcs_1/include/show_connection.inc
-DROP USER 'u_6_401020'@'localhost';
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.2.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.2.1: Ensure that the INFORMATION_SCHEMA.CHARACTER_SETS
-# table has the following columns, in the following order:
-#
-# CHARACTER_SET_NAME (shows a character set name),
-# DEFAULT_COLLATE_NAME (shows the name of the default
-# collation for that character set),
-# DESCRIPTION (shows a descriptive name for that character
-# set),
-# MAXLEN (shows the number of bytes used to store each
-# character supported by that character set).
-################################################################################
-
-let $is_table= character_sets;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.2.2:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.2.2: Ensure that the table shows the relevant information on
-# every character set for which the current user or PUBLIC
-# have the USAGE privilege.
-################################################################################
-
---source suite/funcs_1/include/show_connection.inc
-SELECT * FROM information_schema.character_sets;
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.2.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.2.3: Ensure that the table shows the relevant information on
-# every character set for which the current user or PUBLIC
-# have the USAGE privilege.
-################################################################################
-
-# Test requirement is erroneous... we cannot grant / revoke privilege for using
-# a character set.
-# ------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.3.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.3.1: Ensure that the INFORMATION_SCHEMA.COLLATIONS
-# table has the following columns, in the following order:
-#
-# COLLATION_NAME (shows a collation name),
-# CHARACTER_SET_NAME (shows the name of the character set to
-# which the collation applies),
-# ID (shows a numeric identifier for that collation/character
-# set combination),
-# IS_DEFAULT (shows whether the collation is the default
-# collation for the character set shown),
-# IS_COMPILED (indicates whether the collation is compiled
-# into the MySQL server),
-# SORTLEN (shows a value related to the amount of memory
-# required to sort strings using this
-# collation/character set combination).
-################################################################################
-
-let $is_table= collations;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.3.2:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.3.2: Ensure that the table shows the relevant information on
-# every collation for which the current user or PUBLIC have
-# the USAGE privilege.
-################################################################################
-
-SELECT * FROM collations where collation_name <> 'utf8_general_cs';
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.3.3:;
---source include/show_msg80.inc
-
-###############################################################################
-# Testcase 3.2.3.3: Ensure that the table does not show any information on any
-# collations for which the current user and PUBLIC have no
-# USAGE privilege.
-################################################################################
-
-# Test requirement is erroneous... we cannot grant / revoke privilege for using
-# a collation.
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.4.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.4.1: Ensure that the
-# INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY
-# table has the following columns, in the following order:
-#
-# COLLATION_NAME (shows the name of a collation),
-# CHARACTER_SET_NAME (shows the name of a character set to
-# which that collation applies).
-################################################################################
-
-let $is_table= collation_character_set_applicability;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.4.2:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.4.2: Ensure that the table shows the relevant information on
-# every collation/character set combination for which the
-# current user or PUBLIC have the USAGE privilege.
-# Note(2007-08-24 mleich):
-# The amount of collations/character sets grows with new
-# MySQL releases and is a reason why this test might
-# fail with differences. Please check the new entries
-# and update with expected results afterwards.
-################################################################################
-
-SELECT * FROM collation_character_set_applicability
-where collation_name <> 'utf8_general_cs';
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.4.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.4.3: Ensure that the table does not show any information on any
-# collation/character set combinations for which the current
-# user and PUBLIC have no USAGE privilege.
-################################################################################
-
-# Test requirement is erroneous... we cannot grant / revoke privilege for using a collation.
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.5.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.5.1: Ensure that the INFORMATION_SCHEMA.COLUMN_PRIVILEGES
-# table has the following columns, in the following order:
-#
-# GRANTEE (shows the name of a user who has either granted,
-# or been granted a column privilege),
-# TABLE_CATALOG (always shows NULL),
-# TABLE_SCHEMA (shows the name of the schema, or database,
-# in which the table for which a column privilege has
-# been granted resides),
-# TABLE_NAME (shows the name of the table),
-# COLUMN_NAME (shows the name of the column on which a
-# column privilege has been granted),
-# PRIVILEGE_TYPE (shows the type of privilege that was
-# granted; must be either SELECT, INSERT, UPDATE, or
-# REFERENCES),
-# IS_GRANTABLE (shows whether that privilege was granted
-# WITH GRANT OPTION).
-################################################################################
-
-let $is_table= column_privileges;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.5.2 + 3.2.5.3 + 3.2.5.4:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.5.2: Ensure that the table shows the relevant information on
-# every column privilege which has been granted to the
-# current user or PUBLIC, or which was granted by the current
-# user.
-################################################################################
-# Testcase 3.2.5.3: Ensure that the table does not show any information on any
-# column privilege which was granted to any user other than
-# the current user or PUBLIC, or which was granted by any
-# user other than the current user.
-################################################################################
-# Testcase 3.2.5.4: Ensure that the table does not show any information on any
-# privileges that are not column privileges for the current
-# user.
-################################################################################
-
-CREATE USER 'user_1'@'localhost';
-CREATE USER 'user_2'@'localhost';
-CREATE USER 'user_3'@'localhost';
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-CREATE DATABASE db_datadict;
-USE db_datadict;
-
-CREATE TABLE db_datadict.res_t40502 (f1 INT, f2 DECIMAL, f3 TEXT);
-
-GRANT SELECT(f1, f3) ON db_datadict.res_t40502 TO 'user_1'@'localhost';
-GRANT INSERT(f1) ON db_datadict.res_t40502 TO 'user_1'@'localhost';
-GRANT UPDATE(f2) ON db_datadict.res_t40502 TO 'user_1'@'localhost';
-GRANT SELECT(f2) ON db_datadict.res_t40502 TO 'user_2'@'localhost';
-GRANT INSERT, SELECT ON db_datadict.res_t40502 TO 'user_3'@'localhost';
-GRANT SELECT(f3) ON db_datadict.res_t40502 TO 'user_3'@'localhost';
-
-GRANT INSERT, SELECT ON db_datadict.res_t40502 TO 'user_3'@'localhost' WITH GRANT OPTION;
-GRANT ALL ON db_datadict.* TO 'user_3'@'localhost';
-
-let $select= SELECT * FROM information_schema.column_privileges
- WHERE grantee LIKE "'user%"
- ORDER BY grantee, table_name, column_name, privilege_type;
-eval $select;
-
-let $message= FIXME: Check it is correct that the following GRANT changes ALL privs that user_1 has;
---source include/show_msg.inc
-
-GRANT UPDATE(f3) ON db_datadict.res_t40502 TO 'user_1'@'localhost' WITH GRANT OPTION;
-
-eval $select;
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_5_1, localhost, user_1, , db_datadict);
-eval $select;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_5_2, localhost, user_2, , db_datadict);
-eval $select;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_5_3, localhost, user_3, , db_datadict);
-
-let $message= FIXME: check it is correct that granted TABLES doesn_t occur in COLUMN_PRIVILEGES;
---source include/show_msg.inc
-SELECT * FROM information_schema.table_privileges WHERE grantee LIKE "'user%";
-SELECT * FROM information_schema.schema_privileges WHERE grantee LIKE "'user%";
-eval $select;
-GRANT SELECT(f1, f3) ON db_datadict.res_t40502 TO 'user_2'@'localhost';
-
-let $message= FIXME: check whether it is intended that *my* grants to others are *NOT* shown here;
---source include/show_msg.inc
-eval $select;
-
-connection user_5_2;
---source suite/funcs_1/include/show_connection.inc
-eval $select;
-
-disconnect user_5_1;
-disconnect user_5_2;
-disconnect user_5_3;
-
-#cleanup
-connection default;
---source suite/funcs_1/include/show_connection.inc
---disable_warnings
-DROP TABLE IF EXISTS db_datadict.res_t40502;
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-DROP USER 'user_3'@'localhost';
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.6.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.6.1: Ensure that the INFORMATION_SCHEMA.COLUMNS table has the
-# following columns, in the following order:
-#
-# TABLE_CATALOG (always shows NULL),
-# TABLE_SCHEMA (shows the name of the database, or schema,
-# in which an accessible table resides),
-# TABLE_NAME (shows the name of an accessible table),
-# COLUMN_NAME (shows the name of a column within that
-# table),
-# ORDINAL_POSITION (shows the ordinal position of that
-# column in that table),
-# COLUMN_DEFAULT (shows the column's default value),
-# IS_NULLABLE (shows whether the column may accept NULL
-# values),
-# DATA_TYPE (shows the column's defined data type; keyword
-# only),
-# CHARACTER_MAXIMUM_LENGTH (shows, for a string column, the
-# column's defined maximum length in characters;
-# otherwise NULL),
-# CHARACTER_OCTET_LENGTH (shows, for a string column, the
-# column's defined maximum length in octets;
-# otherwise NULL),
-# NUMERIC_PRECISION (shows, for a numeric column, the
-# column's or data type's defined precision;
-# otherwise NULL),
-# NUMERIC_SCALE (shows, for a numeric column, the column's
-# or data type's defined scale; otherwise NULL),
-# CHARACTER_SET_NAME (shows, for a character string column,
-# the column's default character set; otherwise NULL),
-# COLLATION_NAME (shows, for a character string column, the
-# column's default collation; otherwise NULL),
-# COLUMN_TYPE (shows the column's complete, defined data
-# type),
-# COLUMN_KEY (shows whether the column is indexed; possible
-# values are PRI if the column is part of a PRIMARY
-# KEY, UNI if the column is part of a UNIQUE key, MUL
-# if the column is part of an index key that allows
-# duplicates),
-# EXTRA (shows any additional column definition information,
-# e.g. whether the column was defined with the
-# AUTO_INCREMENT attribute),
-# PRIVILEGES (shows the privileges available to the user on
-# the column),
-# COLUMN_COMMENT (shows the comment, if any, defined for the
-# comment; otherwise NULL).
-################################################################################
-
-let $is_table= columns;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.6.2 + 3.2.6.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.6.2: Ensure that the table shows the relevant information on the
-# columns of every table that is accessible to the current
-# user or to PUBLIC.
-################################################################################
-# Testcase 3.2.6.3: Ensure that the table does not show any information on the
-# columns of any table which is not accessible to the current
-# user or PUBLIC.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-CREATE DATABASE db_datadict;
-
-CREATE USER 'user_1'@'localhost';
-CREATE USER 'user_2'@'localhost';
-
-USE db_datadict;
-
-create table t_6_406001(f1 char(10), f2 text, f3 date, f4 int);
-grant select(f1, f2) on db_datadict.t_6_406001 to 'user_1'@'localhost';
-
-create table t_6_406002(f1 char(10), f2 text, f3 date, f4 int);
-GRANT INSERT(f1, f2) ON db_datadict.t_6_406002 TO 'user_2'@'localhost';
-
-FLUSH PRIVILEGES;
-
-let $select= SELECT * FROM information_schema.columns
- ORDER BY table_schema, table_name, ordinal_position;
-
-# show view of user root
---source suite/funcs_1/datadict/datadict_bug_12777.inc
-eval $select;
-
-# reconnect to mysql with user credential of user u_6_406002_1.
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_6_1, localhost, user_1, , db_datadict);
---source suite/funcs_1/datadict/datadict_bug_12777.inc
-eval $select;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_6_2, localhost, user_2, , db_datadict);
---source suite/funcs_1/datadict/datadict_bug_12777.inc
-eval $select;
-
-disconnect user_6_1;
-disconnect user_6_2;
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-
-let $message= Show the quotient of COL and CML for all COLUMNS;
---source include/show_msg.inc
-SELECT DISTINCT
- CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
- DATA_TYPE,
- CHARACTER_SET_NAME,
- COLLATION_NAME
- FROM information_schema.columns
- WHERE CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
- ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
-
-#FIXME 3.2.6.2: check the value 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 CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
- ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
-
-SELECT DISTINCT
- CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
- DATA_TYPE,
- CHARACTER_SET_NAME,
- COLLATION_NAME
- FROM information_schema.columns
- WHERE CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
- ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
-
-echo --> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values;
-echo --> are 0, which is intended behavior, and the result of 0 / 0 IS NULL;
---source suite/funcs_1/datadict/datadict_bug_12777.inc
-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
- ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
-
-#cleanup
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-DROP TABLE IF EXISTS t_6_406001;
-DROP TABLE IF EXISTS t_6_406002;
-DROP DATABASE IF EXISTS db_datadict;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.7.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.7.1: Ensure that the INFORMATION_SCHEMA.KEY_COLUMN_USAGE
-# table has the following columns, in the following order:
-#
-# CONSTRAINT_CATALOG (always shows NULL),
-# CONSTRAINT_SCHEMA (shows the database, or schema, in which
-# an accessible constraint, or index, resides),
-# CONSTRAINT_NAME (shows the name of the accessible
-# constraint),
-# TABLE_CATALOG (always shows NULL),
-# TABLE_SCHEMA (shows the database, or schema, in which the
-# table constrained by that constraint resides),
-# TABLE_NAME (shows the name of the table constrained by the
-# constraint),
-# COLUMN_NAME (shows the name of a column that is the index
-# key, or part of the index key),
-# ORDINAL_POSITION (shows the ordinal position of the column
-# within the constraint index),
-# POSITION_IN_UNIQUE_CONSTRAINT (shows, for a foreign key
-# column, the ordinal position of the referenced
-# column within the referenced unique index;
-# otherwise NULL).
-# added with 5.0.6: REFERENCED_TABLE_SCHEMA,
-# REFERENCED_TABLE_NAME,
-# REFERENCED_COLUMN_NAME
-################################################################################
-
-let $is_table= key_column_usage;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.7.2 + 3.2.7.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.7.2: Ensure that the table shows the relevant information on
-# every column, defined to be part of an index key, which is
-# accessible to the current user or to PUBLIC.
-################################################################################
-# Testcase 3.2.7.3: Ensure that the table does not show any information on any
-# indexed column that is not accessible to the current user
-# or PUBLIC.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-CREATE DATABASE db_datadict;
-
-CREATE USER 'user_1'@'localhost';
-CREATE USER 'user_2'@'localhost';
-
-USE db_datadict;
-
-CREATE TABLE t_40701 (
- f1 INT NOT NULL, PRIMARY KEY(f1),
- f2 INT, INDEX f2_ind(f2)
- );
-GRANT SELECT ON t_40701 to 'user_1'@'localhost';
-
-CREATE TABLE t_40702 (
- f1 INT NOT NULL, PRIMARY KEY(f1),
- f2 INT, INDEX f2_ind(f2)
- );
-GRANT SELECT ON t_40702 to 'user_2'@'localhost';
-#FIXME: add foreign keys
-
-FLUSH PRIVILEGES;
-
-let $select= SELECT * FROM information_schema.key_column_usage
- ORDER BY constraint_catalog, constraint_schema, constraint_name,
- table_catalog, table_schema, table_name, ordinal_position;
-
-# show view of user root
-eval $select;
-
-# reconnect to mysql with user credential of user u_6_406002_1.
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_7_1, localhost, user_1, , db_datadict);
-eval $select;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_7_2, localhost, user_2, , db_datadict);
-eval $select;
-
-disconnect user_7_1;
-disconnect user_7_2;
-
-#cleanup
-connection default;
---source suite/funcs_1/include/show_connection.inc
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-DROP TABLE t_40701;
-DROP TABLE t_40702;
-DROP DATABASE IF EXISTS db_datadict;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.8.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.8.1: Ensure that the INFORMATION_SCHEMA.ROUTINES
-# table has the following columns, in the following order:
-#
-# SPECIFIC_NAME (shows the name of an accessible stored
-# procedure, or routine),
-# ROUTINE_CATALOG (always shows NULL),
-# ROUTINE_SCHEMA (shows the database, or schema, in which
-# the routine resides),
-# ROUTINE_NAME (shows the same stored procedure name),
-# ROUTINE_TYPE (shows whether the stored procedure is a
-# procedure or a function),
-# DTD_IDENTIFIER (shows, for a function, the complete
-# data type definition of the value the function will
-# return; otherwise NULL),
-# ROUTINE_BODY (shows the language in which the stored
-# procedure is written; currently always SQL),
-# ROUTINE_DEFINITION (shows as much of the routine body as
-# is possible in the allotted space),
-# EXTERNAL_NAME (always shows NULL),
-# EXTERNAL_LANGUAGE (always shows NULL),
-# PARAMETER_STYLE (shows the routine's parameter style;
-# always SQL),
-# IS_DETERMINISTIC (shows whether the routine is
-# deterministic),
-# SQL_DATA_ACCESS (shows the routine's defined
-# sql-data-access clause value),
-# SQL_PATH (always shows NULL),
-# SECURITY_TYPE (shows whether the routine's defined
-# security_type is 'definer' or 'invoker'),
-# CREATED (shows the timestamp of the time the routine was
-# created),
-# LAST_ALTERED (shows the timestamp of the time the routine
-# was last altered),
-# SQL_MODE (shows the sql_mode setting at the time the
-# routine was created),
-# ROUTINE_COMMENT (shows the comment, if any, defined for
-# the routine; otherwise NULL),
-# DEFINER (shows the user who created the routine).
-################################################################################
-
-let $is_table= routines;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.8.2 + 3.2.8.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.8.2: Ensure that the table shows the relevant information on
-# every SQL-invoked routine (i.e. stored procedure) which is
-# accessible to the current user or to PUBLIC.
-################################################################################
-# Testcase 3.2.8.3: Ensure that the table does not show any information on any
-# stored procedure that is not accessible to the current user
-# or PUBLIC.;
-##############################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
-DROP DATABASE IF EXISTS db_datadict_2;
---enable_warnings
-
-CREATE DATABASE db_datadict;
-USE db_datadict;
-
-CREATE USER 'user_1'@'localhost';
-CREATE USER 'user_2'@'localhost';
-CREATE USER 'user_3'@'localhost';
-
-CREATE TABLE res_6_408002_1(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT);
-
-INSERT INTO res_6_408002_1(f1, f2, f3, f4)
- VALUES('abc', 'xyz', '1989-11-09', 0815);
-
---disable_warnings
-DROP PROCEDURE IF EXISTS sp_6_408002_1;
---enable_warnings
-
-delimiter //;
-CREATE PROCEDURE sp_6_408002_1()
-BEGIN
- SELECT * FROM db_datadict.res_6_408002_1;
-END//
-delimiter ;//
-
-CREATE DATABASE db_datadict_2;
-USE db_datadict_2;
-
-CREATE TABLE res_6_408002_2(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT);
-
-INSERT INTO res_6_408002_2(f1, f2, f3, f4)
- VALUES('abc', 'xyz', '1990-10-03', 4711);
-
---disable_warnings
-DROP PROCEDURE IF EXISTS sp_6_408002_2;
---enable_warnings
-
-delimiter //;
-CREATE PROCEDURE sp_6_408002_2()
-BEGIN
- SELECT * FROM db_datadict_2.res_6_408002_2;
-END//
-delimiter ;//
-
-GRANT SELECT ON db_datadict_2.* TO 'user_1'@'localhost';
-GRANT EXECUTE ON db_datadict_2.* TO 'user_1'@'localhost';
-
-GRANT EXECUTE ON db_datadict.* TO 'user_1'@'localhost';
-GRANT SELECT ON db_datadict.* TO 'user_2'@'localhost';
-
-GRANT EXECUTE ON PROCEDURE db_datadict_2.sp_6_408002_2 TO 'user_2'@'localhost';
-GRANT EXECUTE ON db_datadict_2.* TO 'user_2'@'localhost';
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_8_1, localhost, user_1, , db_datadict);
-
---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-SELECT * FROM information_schema.routines;
-disconnect user_8_1;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_8_2, localhost, user_2, , db_datadict);
-
---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-SELECT * FROM information_schema.routines;
-disconnect user_8_2;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_8_3, localhost, user_3, , test);
-
---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-SELECT * FROM information_schema.routines;
-disconnect user_8_3;
-
-# clean-up
-connection default;
---source suite/funcs_1/include/show_connection.inc
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-DROP USER 'user_3'@'localhost';
-
-use db_datadict;
-DROP TABLE res_6_408002_1;
-DROP PROCEDURE sp_6_408002_1;
-
-USE db_datadict_2;
-DROP TABLE res_6_408002_2;
-DROP PROCEDURE sp_6_408002_2;
-
-USE test;
-DROP DATABASE db_datadict;
-DROP DATABASE db_datadict_2;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.8.4:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.8.4: Ensure that a stored procedure with a routine body that is
-# too large to fit into the
-# INFORMATION_SCHEMA.ROUTINES.ROUTINE_DEFINITION column
-# correctly shows as much of the information as is possible
-# within the allotted size.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-
-CREATE DATABASE db_datadict;
-USE db_datadict;
-
-create table res_6_408004_1(f1 longtext , f2 mediumint , f3 longblob , f4 real , f5 year);
-
-insert into res_6_408004_1 values ('abc', 98765 , 99999999 , 98765, 10);
-
---disable_warnings
-drop procedure if exists sp_6_408004;
---enable_warnings
-
-create table res_6_408004_2(f1 longtext , f2 mediumint , f3 longblob , f4 real , f5 year);
-
-insert into res_6_408004_2 values ('abc', 98765 , 99999999 , 98765, 10);
-
-let $message= Checking the max. possible length of (currently) 4 GByte is not possible in this environment here.;
---source include/show_msg.inc
-
-delimiter //;
-create procedure sp_6_408004 ()
-begin
- declare done integer default 0;
- declare variable_number_1 longtext;
- declare variable_number_2 mediumint;
- declare variable_number_3 longblob;
- declare variable_number_4 real;
- declare variable_number_5 year;
- declare cursor_number_1 cursor for select * from res_6_408004_1 limit 0, 10;
- declare cursor_number_2 cursor for select * from res_6_408004_1 limit 0, 10;
- declare cursor_number_3 cursor for select * from res_6_408004_1 limit 0, 10;
- declare cursor_number_4 cursor for select * from res_6_408004_1 limit 0, 10;
- declare cursor_number_5 cursor for select * from res_6_408004_1 limit 0, 10;
- declare continue handler for sqlstate '02000' set done = 1;
- begin
- open cursor_number_1;
- while done <> 1 do
- fetch cursor_number_1 into variable_number_1, variable_number_2, variable_number_3, variable_number_4, variable_number_5;
- if done <> 0 then
- insert into res_6_408004_2 values (variable_number_1, variable_number_2, variable_number_3,
- variable_number_4, variable_number_5);
- end if;
- end while;
- begin
- begin
- set done = 0;
- open cursor_number_2;
- while done <> 1 do
- fetch cursor_number_2 into variable_number_1, variable_number_2, variable_number_3, variable_number_4, variable_number_5;
- if done <> 0 then
- insert into res_6_408004_2 values(variable_number_1, variable_number_2, variable_number_3, variable_number_4, variable_number_5);
- end if;
- end while;
- end;
- set done = 0;
- open cursor_number_3;
- while done <> 1 do
- fetch cursor_number_3 into variable_number_1, variable_number_2, variable_number_3, variable_number_4, variable_number_5;
- if done <> 0 then
- insert into res_6_408004_2 values(variable_number_1, variable_number_2, variable_number_3, variable_number_4, variable_number_5);
- end if;
- end while;
- end;
- end;
- begin
- set done = 0;
- open cursor_number_4;
- while done <> 1 do
- fetch cursor_number_4 into variable_number_1, variable_number_2, variable_number_3, variable_number_4, variable_number_5;
- if done <> 0 then
- insert into res_6_408004_2 values (variable_number_1, variable_number_2, variable_number_3, variable_number_4, variable_number_5);
- end if;
- end while;
- end;
- begin
- set @a='test row';
- select @a;
- select @a;
- select @a;
- end;
- begin
- set done = 0;
- open cursor_number_5;
- while done <> 1 do
- fetch cursor_number_5 into variable_number_1, variable_number_2, variable_number_3, variable_number_4, variable_number_5;
- if done <> 0 then
- insert into res_6_408004_2 values (variable_number_1, variable_number_2, variable_number_3, variable_number_4, variable_number_5);
- end if;
- end while;
- end;
- begin
- set @a='test row';
- select @a;
- select @a;
- select @a;
- end;
-end//
-delimiter ;//
-
-call sp_6_408004 ();
-select * from res_6_408004_2;
-
---vertical_results
---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-SELECT *, LENGTH(routine_definition)
- FROM information_schema.routines
- WHERE routine_schema = 'db_datadict';
---horizontal_results
-
-# clean-up
-use db_datadict;
-drop procedure sp_6_408004;
-drop table res_6_408004_1;
-drop table res_6_408004_2;
-use test;
-drop database db_datadict;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.9.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.9.1: Ensure that the INFORMATION_SCHEMA.SCHEMATA
-# table has the following columns, in the following order:
-#
-# CATALOG_NAME (always shows NULL),
-# SCHEMA_NAME (shows the name of a database, or schema, on
-# which the current user or PUBLIC has privileges),
-# DEFAULT_CHARACTER_SET_NAME (shows the name of that
-# database's default character set),
-# DEFAULT_COLLATION_NAME (shows the database default
-# collation)
-# SQL_PATH (always shows NULL).
-################################################################################
-
-let $is_table= schemata;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.9.2 + 3.2.9.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.9.2: Ensure that the table shows the relevant information for
-# every database on which the current user or PUBLIC have
-# privileges.
-################################################################################
-# Testcase 3.2.9.3: Ensure that the table does not show any information on any
-# databases on which the current user and PUBLIC have no
-# privileges.
-################################################################################
-
-CREATE USER 'user_1'@'localhost';
-CREATE USER 'user_2'@'localhost';
-CREATE USER 'user_3'@'localhost';
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict_1;
-DROP DATABASE IF EXISTS db_datadict_2;
---enable_warnings
-
-CREATE DATABASE db_datadict_1;
-CREATE DATABASE db_datadict_2;
-
-GRANT SELECT ON db_datadict_1.* to 'user_1'@'localhost';
-GRANT SELECT ON db_datadict_2.* to 'user_2'@'localhost';
-
-FLUSH PRIVILEGES;
-
-# shows db_1
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_9_1, localhost, user_1, , db_datadict_1);
-
-SELECT COUNT(*) FROM information_schema.schemata;
-SELECT * FROM information_schema.schemata;
-disconnect user_9_1;
-
-
-# shows db_2
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_9_2, localhost, user_2, , db_datadict_2);
-
-SELECT COUNT(*) FROM information_schema.schemata;
-SELECT * FROM information_schema.schemata;
-disconnect user_9_2;
-
-
-# shows neither db_1 nor db_2
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_9_3, localhost, user_3, , test);
-
-SELECT COUNT(*) FROM information_schema.schemata;
-SELECT * FROM information_schema.schemata;
-disconnect user_9_3;
-
-
-# clean-up
-connection default;
---source suite/funcs_1/include/show_connection.inc
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-DROP USER 'user_3'@'localhost';
-DROP DATABASE db_datadict_1;
-DROP DATABASE db_datadict_2;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.10.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.10.1: Ensure that the INFORMATION_SCHEMA.TABLE_CONSTRAINTS
-# table has the following columns, in the following order:
-#
-# CONSTRAINT_CATALOG (always shows NULL),
-# CONSTRAINT_SCHEMA (shows the database, or schema, in which
-# a constraint an accessible table resides),
-# CONSTRAINT_NAME (shows the name of a constraint defined on
-# an accessible table),
-# TABLE_SCHEMA (shows the database, or schema, in which the
-# table resides),
-# TABLE_NAME (shows the name of the table),
-# CONSTRAINT_TYPE (shows the type of the constraint; either
-# 'primary key', 'foreign key', 'unique', 'check').
-################################################################################
-
-let $is_table= table_constraints;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.10.2 + 3.2.10.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.10.2: Ensure that the table shows the relevant information on all
-# constraints defined on every table for which the current
-# user or PUBLIC have privileges.
-################################################################################
-# Testcase 3.2.10.3: Ensure that the table does not show any information on
-# constraints defined on any table for which the current user
-# and PUBLIC have no privileges.
-################################################################################
-
-CREATE USER 'user_1'@'localhost';
-CREATE USER 'user_2'@'localhost';
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
-DROP DATABASE IF EXISTS db_datadict_2;
---enable_warnings
-
-CREATE DATABASE db_datadict;
-CREATE DATABASE db_datadict_2;
-
-USE db_datadict;
-
-CREATE TABLE res_6_401003_1(f1 INT NOT NULL, PRIMARY KEY(f1), f2 INT, INDEX f2_ind(f2));
-
-USE db_datadict_2;
-
-CREATE TABLE res_6_401003_2(f1 INT NOT NULL, PRIMARY KEY(f1), f2 INT, INDEX f2_ind(f2));
-
-GRANT SELECT ON db_datadict.res_6_401003_1 TO 'user_1'@'localhost';
-GRANT SELECT ON db_datadict_2.res_6_401003_2 TO 'user_2'@'localhost';
-
-FLUSH PRIVILEGES;
-
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_10_1, localhost, user_1, , db_datadict);
-
-SELECT * FROM information_schema.table_constraints;
-SELECT COUNT(*) FROM information_schema.table_constraints;
-disconnect user_10_1;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_10_2, localhost, user_2, , db_datadict_2);
-
-SELECT * FROM information_schema.table_constraints;
-SELECT COUNT(*) FROM information_schema.table_constraints;
-disconnect user_10_2;
-
-# clean-up
-connection default;
-use db_datadict;
---source suite/funcs_1/include/show_connection.inc
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-DROP TABLE res_6_401003_1;
-USE db_datadict_2;
-DROP TABLE res_6_401003_2;
-USE test;
-DROP DATABASE db_datadict;
-DROP DATABASE db_datadict_2;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.11.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.11.1: Ensure that the INFORMATION_SCHEMA.TABLE_PRIVILEGES
-# table has the following columns, in the following order:
-#
-# GRANTEE (shows the name of a user who has either granted,
-# or been granted a table privilege),
-# TABLE_CATALOG (always shows NULL),
-# TABLE_SCHEMA (shows the name of the schema, or database,
-# in which the table for which a privilege has been
-# granted resides),
-# TABLE_NAME (shows the name of the table),
-# PRIVILEGE_TYPE (shows the type of privilege that was
-# granted; must be either SELECT, INSERT, UPDATE,
-# DELETE, REFERENCES, ALTER, INDEX, DROP, or CREATE
-# VIEW),
-# IS_GRANTABLE (shows whether that privilege was granted
-# WITH GRANT OPTION).
-################################################################################
-
-let $is_table= table_privileges;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.11.2 + 3.2.11.3 + 3.2.11.4:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.11.2: Ensure that the table shows the relevant information on
-# every table privilege which has been granted to the current
-# user or PUBLIC, or which was granted by the current user.
-################################################################################
-# Testcase 3.2.11.3: Ensure that the table does not show any information on any
-# table privilege which was granted to any user other than
-# the current user or PUBLIC, or which was granted by any
-# user other than the current user.
-################################################################################
-# Testcase 3.2.11.4: Ensure that the table does not show any information on any
-# privileges that are not table privileges for the current
-# user.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-
-create database db_datadict;
-
-CREATE USER 'user_1'@'localhost';
-GRANT CREATE, SELECT ON db_datadict.* TO 'user_1'@'localhost' WITH GRANT OPTION;
-CREATE USER 'user_2'@'localhost';
-CREATE USER 'user_3'@'localhost';
-
-use db_datadict;
-
-create table tb1(f1 int, f2 int, f3 int);
-
-grant select on db_datadict.tb1 to 'user_1'@'localhost';
-GRANT ALL on db_datadict.tb1 to 'user_2'@'localhost' WITH GRANT OPTION;
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_11_1, localhost, user_1, , db_datadict);
-
-CREATE TABLE tb3 (f1 TEXT);
-GRANT SELECT ON db_datadict.tb3 to 'user_3'@'localhost';
-
-SELECT * FROM information_schema.table_privileges
- WHERE table_name LIKE 'tb%';
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_11_2, localhost, user_2, , db_datadict);
-
-# we see only table privileges for this user, and not any other privileges
-SELECT * FROM information_schema.table_privileges;
-
-SELECT USER(), COUNT(*)
- FROM information_schema.table_privileges
- WHERE grantee = USER();
-
-SELECT USER(), COUNT(*)
- FROM information_schema.table_privileges
- WHERE grantee = "'user_2'@'localhost'";
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_11_3, localhost, user_3, , db_datadict);
-
-# we see only table privileges for this user, and not any other privileges
-SELECT * FROM information_schema.table_privileges;
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-
-# we see only 'public' table privileges
-SELECT * FROM information_schema.table_privileges;
-
-# clean-up
-connection default;
---source suite/funcs_1/include/show_connection.inc
-disconnect user_11_1;
-disconnect user_11_2;
-disconnect user_11_3;
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-DROP USER 'user_3'@'localhost';
-drop table db_datadict.tb1;
-drop table db_datadict.tb3;
-use test;
-drop database db_datadict;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.12.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.12.1: Ensure that the INFORMATION_SCHEMA.TABLES
-# table has the following columns, in the following order:
-#
-# TABLE_CATALOG (always shows NULL),
-# TABLE_SCHEMA (shows the name of the database, or schema,
-# in which an accessible table resides),
-# TABLE_NAME (shows the name of a table which the current
-# user may access),
-# TABLE_TYPE (shows whether the table is a BASE TABLE, a
-# TEMPORARY table, or a VIEW),
-# ENGINE (shows the storage engine used for the table),
-# VERSION (shows the version number of the table's .frm
-# file),
-# ROW_FORMAT (shows the table's row storage format; either
-# FIXED, DYNAMIC or COMPRESSED),
-# TABLE_ROWS (shows the number of rows in the table),
-# AVG_ROW_LENGTH (shows the average length of the table's
-# rows),
-# DATA_LENGTH (shows the length of the table's data file),
-# MAX_DATA_LENGTH (shows the maximum length of the table's
-# data file),
-# INDEX_LENGTH (shows the length of the index file
-# associated with the table),
-# DATA_FREE (shows the number of allocated, unused bytes),
-# AUTO_INCREMENT (shows the next AUTO_INCREMENT value, where
-# applicable),
-# CREATE_TIME (shows the timestamp of the time the table was
-# created),
-# UPDATE_TIME (shows the timestamp of the time the table's
-# data file was last updated),
-# CHECK_TIME (shows the timestamp of the time the table was
-# last checked),
-# TABLE_COLLATION (shows the table's default collation),
-# CHECKSUM (shows the live checksum value for the table, if
-# any; otherwise NULL),
-# CREATE_OPTIONS (shows any additional options used in the
-# table's definition; otherwise NULL),
-# TABLE_COMMENT (shows the comment added to the table's
-# definition; otherwise NULL).
-################################################################################
-
-let $is_table= tables;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.12.2 + 3.2.12.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.12.2: Ensure that the table shows the relevant information on
-# every base table and view on which the current user or
-# PUBLIC has privileges.
-################################################################################
-# Testcase 3.2.12.3: Ensure that the table does not show any information on any
-# tables on which the current user and public have no
-# privileges.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-
-create database db_datadict;
-
-CREATE USER 'user_1'@'localhost';
-GRANT CREATE, CREATE VIEW, INSERT, SELECT ON db_datadict.*
- TO 'user_1'@'localhost' WITH GRANT OPTION;
-CREATE USER 'user_2'@'localhost';
-CREATE USER 'user_3'@'localhost';
-
-use db_datadict;
-
-create table tb1(f1 int, f2 int, f3 int);
-
-grant select on db_datadict.tb1 to 'user_1'@'localhost';
-GRANT ALL on db_datadict.tb1 to 'user_2'@'localhost' WITH GRANT OPTION;
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_12_1, localhost, user_1, , db_datadict);
-
-# tb2 is not granted to anyone
-CREATE TABLE tb2 (f1 DECIMAL);
-CREATE TABLE tb3 (f1 TEXT);
-GRANT SELECT ON db_datadict.tb3 to 'user_3'@'localhost';
-GRANT INSERT ON db_datadict.tb3 to 'user_2'@'localhost';
-
-CREATE VIEW v3 AS SELECT * FROM tb3;
-GRANT SELECT ON db_datadict.v3 to 'user_3'@'localhost';
-
-#FIXME 3.2.12: we split the "SELECT * FROM tables" in two parts until
-#FIXME 3.2.12: Bug #12397: wrong values shown in column CREATE_OPTIONS of
-#FIXME 3.2.12: INFORMATION_SCHEMA.TABLES is solved, one with 'more' and one
-#FIXME 3.2.12: with 'less' replace
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHECK_TIME
-# 20 CREATE_OPTIONS
-if ($have_bug_11589)
-{
---disable_ps_protocol
-}
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
-SELECT * FROM information_schema.tables
- WHERE table_schema = 'information_schema';
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHECK_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-SELECT * FROM information_schema.tables
- WHERE NOT( table_schema = 'information_schema');
---enable_ps_protocol
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_12_2, localhost, user_2, , db_datadict);
-
-# we see only tables for this user, and not any other
-#FIXME 3.2.12: we split the "SELECT * FROM tables" in two parts until
-#FIXME 3.2.12: Bug #12397: wrong values shown in column CREATE_OPTIONS of
-#FIXME 3.2.12: INFORMATION_SCHEMA.TABLES is solved, one with 'more' and one
-#FIXME 3.2.12: with 'less' replace
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHECK_TIME
-# 20 CREATE_OPTIONS
-if ($have_bug_11589)
-{
---disable_ps_protocol
-}
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
-SELECT * FROM information_schema.tables
- WHERE table_schema = 'information_schema';
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHECK_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-SELECT * FROM information_schema.tables
- WHERE NOT( table_schema = 'information_schema');
---enable_ps_protocol
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_12_3, localhost, user_3, , db_datadict);
-
-# we see only tables for this user, and not any other
-#
-#FIXME 3.2.12: we split the "SELECT * FROM tables" in two parts until
-#FIXME 3.2.12: Bug #12397: wrong values shown in column CREATE_OPTIONS of
-#FIXME 3.2.12: INFORMATION_SCHEMA.TABLES is solved, one with 'more' and one
-#FIXME 3.2.12: with 'less' replace
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHECK_TIME
-# 20 CREATE_OPTIONS
-if ($have_bug_11589)
-{
---disable_ps_protocol
-}
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
-SELECT * FROM information_schema.tables
- WHERE table_schema = 'information_schema';
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHECK_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-SELECT * FROM information_schema.tables
- WHERE NOT( table_schema = 'information_schema');
---enable_ps_protocol
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-
-# we see only 'public' tables
-#
-#FIXME 3.2.12: we split the "SELECT * FROM tables" in two parts until
-#FIXME 3.2.12: Bug #12397: wrong values shown in column CREATE_OPTIONS of
-#FIXME 3.2.12: INFORMATION_SCHEMA.TABLES is solved, one with 'more' and one
-#FIXME 3.2.12: with 'less' replace
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHECK_TIME
-# 20 CREATE_OPTIONS
-if ($have_bug_11589)
-{
---disable_ps_protocol
-}
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
-SELECT * FROM information_schema.tables
- WHERE table_schema = 'information_schema';
-# 9 AVG_ROW_LENGTH
-# 10 DATA_LENGTH
-# 11 MAX_DATA_LENGTH
-# 12 INDEX_LENGTH
-# 13 DATA_FREE
-# 15 CREATE_TIME
-# 16 UPDATE_TIME
-# 17 CHECK_TIME
---replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
-SELECT * FROM information_schema.tables
- WHERE NOT( table_schema = 'information_schema') AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%');
---enable_ps_protocol
-
-# clean-up
-disconnect user_12_1;
-disconnect user_12_2;
-disconnect user_12_3;
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-DROP USER 'user_3'@'localhost';
-DROP TABLE db_datadict.tb1;
-DROP TABLE db_datadict.tb3;
-DROP VIEW db_datadict.v3;
-USE test;
-DROP DATABASE db_datadict;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.13.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.13.1: Ensure that the INFORMATION_SCHEMA.VIEWS
-# table has the following columns, in the following order:
-#
-# TABLE_CATALOG (always shows NULL),
-# TABLE_SCHEMA (shows the database, or schema, in which an
-# accessible view resides),
-# TABLE_NAME (shows the name of a view accessible to the
-# current user),
-# VIEW_DEFINITION (shows the SELECT statement that makes
-# up the view's definition),
-# CHECK_OPTION (shows the value of the WITH CHECK OPTION
-# clause used to define the view, either NONE, LOCAL
-# or CASCADED),
-# IS_UPDATABLE (shows whether the view is an updatable
-# view),
-# DEFINER (added with 5.0.14),
-# SECURITY_TYPE (added with 5.0.14).
-################################################################################
-
-let $is_table= views;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.13.2 + 3.2.13.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.13.2: Ensure that the table shows the relevant information on
-# every view for which the current user or PUBLIC has the
-# SHOW CREATE VIEW privilege.
-################################################################################
-# Testcase 3.2.13.3: Ensure that the table does not show any information on any
-# views for which the current user and PUBLIC have no SHOW
-# CREATE VIEW privilege.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-
-CREATE DATABASE db_datadict;
-
-CREATE USER 'user_1'@'localhost';
-CREATE USER 'user_2'@'localhost';
-CREATE USER 'user_no_views'@'localhost';
-USE db_datadict;
-
-CREATE TABLE tb_401302(f1 INT, f2 INT, f3 INT);
-CREATE VIEW v_granted_to_1 AS SELECT * FROM tb_401302;
-CREATE VIEW v_granted_glob AS SELECT f2, f3 FROM tb_401302;
-
-GRANT SELECT ON db_datadict.tb_401302 TO 'user_1'@'localhost';
-GRANT SELECT ON db_datadict.v_granted_to_1 TO 'user_1'@'localhost';
-GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'user_2'@'localhost';
-
-FLUSH PRIVILEGES;
-
-SELECT * FROM information_schema.views;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_13_1, localhost, user_1, , test);
-
-SELECT * FROM information_schema.views;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_13_2, localhost, user_2, , test);
-
-SELECT * FROM information_schema.views;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_no_views, localhost, user_no_views, , test);
-
-SELECT * FROM information_schema.views;
-
-# clean-up
-connection default;
---source suite/funcs_1/include/show_connection.inc
-disconnect user_13_1;
-disconnect user_13_2;
-disconnect user_no_views;
-USE db_datadict;
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-DROP USER 'user_no_views'@'localhost';
-DROP VIEW v_granted_to_1;
-DROP TABLE tb_401302;
-DROP VIEW v_granted_glob;
-USE test;
-DROP DATABASE db_datadict;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.14.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.14.1: Ensure that the INFORMATION_SCHEMA.STATISTICS
-# table has the following columns, in the following order:
-#
-# TABLE_CATALOG (always shows NULL),
-# TABLE_SCHEMA (shows the database, or schema, in which a
-# table indexed by an accessible index resides),
-# TABLE_NAME (shows the name of the indexed table),
-# NON_UNIQUE (shows whether the index may contain duplicate
-# values; 0 if it cannot, 1 if it can),
-# INDEX_SCHEMA (shows the database, or schema, in which an
-# accessible index resides),
-# INDEX_NAME (shows the name of an index which the current
-# user may access),
-# SEQ_IN_INDEX (shows the ordinal position of an indexed
-# column within the index),
-# COLUMN_NAME (shows the name of a column that comprises
-# some, or all, of an index key),
-# COLLATION (shows how the column is sorted in the index;
-# either A for ascending or NULL for unsorted
-# columns),
-# CARDINALITY (shows the number of unique values in the
-# index),
-# SUB_PART (shows the number of indexed characters if the
-# index is a prefix index),
-# PACKED (shows how the index key is packed),
-# NULLABLE (shows whether the index column may contain NULL
-# values),
-# INDEX_TYPE (shows the index type; either BTREE, FULLTEXT,
-# HASH or RTREE),
-# COMMENT (shows a comment on the index, if any).
-################################################################################
-
-let $is_table= statistics;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.14.2 + 3.2.14.3:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.14.2: Ensure that the table shows the relevant information on
-# every index which the current user or PUBLIC may access
-# (usually because privileges on the indexed table have been
-# granted).
-################################################################################
-# Testcase 3.2.14.3: Ensure that the table does not show any information on any
-# indexes which the current user and PUBLIC may not access.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
-DROP DATABASE IF EXISTS db_datadict_2;
---enable_warnings
-
-CREATE DATABASE db_datadict;
-CREATE DATABASE db_datadict_2;
-
-CREATE USER 'user_1'@'localhost';
-CREATE USER 'user_2'@'localhost';
-USE db_datadict;
-
-create table tb_6_401402_1(f1 int not null, primary key(f1), f2 int, index f2_ind(f2));
-create table tb_6_401402_2(f1 int not null, primary key(f1), f2 int, index f2_ind(f2));
-grant select on db_datadict.tb_6_401402_1 to 'user_1'@'localhost' WITH GRANT OPTION;
-
-USE db_datadict_2;
-
-create table tb_2_1(f1 int not null, primary key(f1), f2 int, index f2_ind(f2));
-create table tb_2_2(f1 int not null, primary key(f1), f2 int, index f2_ind(f2));
-grant select on db_datadict_2.tb_2_1 to 'user_1'@'localhost';
-
-FLUSH PRIVILEGES;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_14_1, localhost, user_1, , test);
-SELECT * FROM information_schema.statistics;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_14_2, localhost, user_2, , test);
-SELECT * FROM information_schema.statistics;
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-REVOKE SELECT ON db_datadict.tb_6_401402_1 FROM 'user_1'@'localhost';
-SELECT * FROM information_schema.statistics
-WHERE NOT (table_schema = 'mysql' AND table_name LIKE 'help_%');
-
-# nothing visible for user_1
-connection user_14_1;
---source suite/funcs_1/include/show_connection.inc
-SELECT * FROM information_schema.statistics;
-
-# no changes visible for user_2
-connection user_14_2;
---source suite/funcs_1/include/show_connection.inc
-SELECT * FROM information_schema.statistics;
-
-# cleanup
-connection default;
---source suite/funcs_1/include/show_connection.inc
-disconnect user_14_1;
-disconnect user_14_2;
-USE db_datadict;
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-DROP TABLE tb_6_401402_1;
-DROP TABLE tb_6_401402_2;
-USE test;
-DROP DATABASE db_datadict;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.15.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.15.1: Ensure that the INFORMATION_SCHEMA.SCHEMA_PRIVILEGES
-# table has the following columns, in the following order:
-#
-# GRANTEE (shows a user to whom a schema privilege has been
-# granted),
-# TABLE_CATALOG (always shows NULL),
-# TABLE_SCHEMA (shows the name of the database, or schema,
-# on which the privilege has been granted),
-# PRIVILEGE_TYPE (shows the granted privilege),
-# IS_GRANTABLE (shows whether the privilege was granted WITH
-# GRANT OPTION).
-################################################################################
-
-let $is_table= schema_privileges;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.15.2:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.15.2: Ensure that the table shows the relevant information on
-# every schema-level privilege which has been granted to the
-# current user or to PUBLIC, or has been granted by the
-# current user.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
-DROP DATABASE IF EXISTS db_datadict_2;
---enable_warnings
-
-create database db_datadict;
-create database db_datadict_2;
-
-CREATE USER 'u_6_401502'@'localhost';
-
-use db_datadict;
-
-create table res_6_401502(f1 int, f2 int, f3 int);
-grant insert on db_datadict.* to 'u_6_401502'@'localhost';
-
-FLUSH PRIVILEGES;
-
-SELECT * FROM information_schema.schema_privileges;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401502, localhost, u_6_401502, , test);
-
-SELECT * FROM information_schema.schema_privileges;
-
-disconnect u_6_401502;
-
-# clean-up
-
-connection default;
-use db_datadict;
---source suite/funcs_1/include/show_connection.inc
-DROP USER 'u_6_401502'@'localhost';
-drop table res_6_401502;
-use test;
-drop database db_datadict;
-drop database db_datadict_2;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.15.3 + 3.2.15.4:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.15.3: Ensure that the table does not show any information on any
-# schema-level privileges which have been granted to users
-# other than the current user or to PUBLIC, or that have been
-# granted by any user other than the current user.
-################################################################################
-# Testcase 3.2.15.4: Ensure that the table does not show any information on any
-# privileges that are not schema-level privileges for the
-# current user.
-################################################################################
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
-DROP DATABASE IF EXISTS db_datadict_2;
---enable_warnings
-
-create database db_datadict;
-create database db_datadict_2;
-
-CREATE USER 'u_6_401503_1'@'localhost';
-CREATE USER 'u_6_401503_2'@'localhost';
-CREATE USER 'u_6_401503_3'@'localhost';
-
-use db_datadict;
-
-create table res_6_401503_1(f1 int, f2 int, f3 int);
-
-use db_datadict_2;
-
-create table res_6_401503_2(f1 int, f2 int, f3 int);
-
-grant update on db_datadict.* to 'u_6_401503_1'@'localhost';
-grant delete on db_datadict_2.* to 'u_6_401503_2'@'localhost';
-
-FLUSH PRIVILEGES;
-
-SELECT * FROM information_schema.schema_privileges;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401503_1, localhost, u_6_401503_1, , test);
-
-SELECT * FROM information_schema.schema_privileges;
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401503_2, localhost, u_6_401503_2, , test);
-
-SELECT * FROM information_schema.schema_privileges;
-
-# should not show anything
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (u_6_401503_3, localhost, u_6_401503_3, , test);
-
-SELECT * FROM information_schema.schema_privileges;
-
-# clean-up
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-disconnect u_6_401503_1;
-disconnect u_6_401503_2;
-disconnect u_6_401503_3;
-use db_datadict;
-DROP USER 'u_6_401503_1'@'localhost';
-DROP USER 'u_6_401503_2'@'localhost';
-DROP USER 'u_6_401503_3'@'localhost';
-drop table res_6_401503_1;
-use db_datadict_2;
-drop table res_6_401503_2;
-use test;
-drop database db_datadict;
-drop database db_datadict_2;
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.16.1:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.16.1: Ensure that the INFORMATION_SCHEMA.USER_PRIVILEGES
-# table has the following columns, in the following order:
-#
-# GRANTEE (shows a user to whom a user privilege has been
-# granted),
-# TABLE_CATALOG (always shows NULL),
-# PRIVILEGE_TYPE (shows the granted privilege),
-# IS_GRANTABLE (shows whether the privilege was granted WITH
-# GRANT OPTION).
-################################################################################
-
-#-----------
-# Bug #12063 column 'TABLE_SCHEMA' is missing in table
-# INFORMATION_SCHEMA.USER_PRIVILEGE
-# ... is not a bug, it has been added by mistake in the TP requirement document.
-#-----------
-
-let $is_table= user_privileges;
---source suite/funcs_1/datadict/datadict_show_table_design.inc
-# -------------------------------------------------------------------------------------------------------
-
-let $message= Testcase 3.2.16.2 + 3.2.16.3 + 3.2.16.4:;
---source include/show_msg80.inc
-
-################################################################################
-# Testcase 3.2.16.2: Ensure that the table shows the relevant information on
-# every user privilege which has been granted to the current
-# user or to PUBLIC, or has been granted by the current user.
-################################################################################
-# Testcase 3.2.16.3: Ensure that the table does not show any information on any
-# user privileges which have been granted to users other than
-# the current user or have been granted by any user other
-# than the current user.
-################################################################################
-# Testcase 3.2.16.4: Ensure that the table does not show any information on any
-# privileges that are not user privileges for the current
-# user.
-################################################################################
-
-#FIXME 3.2.16: - when Bug #12269 is fixed a some of the outputs here may be
-#FIXME 3.2.16: deleted as I added them for checking where / which information
-#FIXME 3.2.16: is shown.
-
---disable_warnings
-DROP DATABASE IF EXISTS db_datadict;
---enable_warnings
-
-let $cmd1= SELECT * FROM information_schema.user_privileges
- WHERE grantee LIKE "%user%"
- ORDER BY grantee, table_catalog, privilege_type;
-let $cmd2= SELECT * FROM mysql.user WHERE user LIKE "%user%" ORDER BY host, user;
-let $cmd3= SHOW GRANTS;
-
-CREATE DATABASE db_datadict;
-
-CREATE USER 'user_1'@'localhost';
-CREATE USER 'user_2'@'localhost';
-CREATE USER 'user_3'@'localhost';
-
-GRANT SELECT ON db_datadict.* TO 'user_1'@'localhost';
-GRANT SELECT ON mysql.user TO 'user_1'@'localhost';
-
-GRANT INSERT ON *.* TO 'user_2'@'localhost';
-GRANT UPDATE ON *.* TO 'user_2'@'localhost';
-
-FLUSH PRIVILEGES;
-
-let $message= FIXME (see Bug 12269) Here we expect more than only for user_1;
---source include/show_msg.inc
-eval $cmd1;
-eval $cmd2;
-eval $cmd3;
-
-let $message= add GRANT OPTION db_datadict.* to user_1;
---source include/show_msg.inc
-GRANT UPDATE ON db_datadict.* TO 'user_1'@'localhost' WITH GRANT OPTION;
-
-let $message= FIXME (see Bug 12269) Here the is missing for the GRANT OPTION for user_1;
---source include/show_msg.inc
-eval $cmd1;
-eval $cmd2;
-eval $cmd3;
-
-FLUSH PRIVILEGES;
-
-
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (user_16_1, localhost, user_1, , db_datadict);
-eval $cmd1;
-eval $cmd2;
-eval $cmd3;
-
-# add SELECT on *.* to user_1
-let $message= Now add SELECT on *.* to user_1;
---source include/show_msg.inc
-
-connection default;
---source suite/funcs_1/include/show_connection.inc
-GRANT SELECT ON *.* TO 'user_1'@'localhost';
-let $message= Here