Below is the list of changes that have just been committed into a local
5.2 repository of emurphy. When emurphy does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2175 06/06/01 22:24:05 elliot@stripped +16 -0
Merge mysql.com:/home/emurphy/src/bk-clean/mysql-5.1-new
into mysql.com:/home/emurphy/src/bk-clean/mysql-5.2
configure.in
1.346 06/06/01 22:24:01 elliot@stripped +0 -1
Manual merge
sql/sql_yacc.yy
1.466 06/06/01 22:17:34 elliot@stripped +0 -0
Auto merged
sql/sql_trigger.cc
1.54 06/06/01 22:17:34 elliot@stripped +0 -0
Auto merged
sql/share/errmsg.txt
1.90 06/06/01 22:17:34 elliot@stripped +0 -0
Auto merged
sql/item.h
1.198 06/06/01 22:17:34 elliot@stripped +0 -0
Auto merged
sql/item.cc
1.177 06/06/01 22:17:34 elliot@stripped +0 -0
Auto merged
sql/handler.cc
1.222 06/06/01 22:17:34 elliot@stripped +0 -0
Auto merged
mysql-test/r/trigger-grant.result
1.9 06/06/01 22:17:33 elliot@stripped +0 -0
Auto merged
sql/ha_innodb.cc
1.264 06/06/01 22:17:33 elliot@stripped +0 -0
Auto merged
scripts/make_binary_distribution.sh
1.115 06/06/01 22:17:33 elliot@stripped +0 -0
Auto merged
mysql-test/t/trigger-grant.test
1.11 06/06/01 22:17:33 elliot@stripped +0 -0
Auto merged
mysql-test/t/innodb.test
1.135 06/06/01 22:17:33 elliot@stripped +0 -0
Auto merged
mysql-test/r/trigger-grant.result
1.8 06/06/01 22:17:33 elliot@stripped +0 -0
Change mode to -rw-rw-r--
mysql-test/r/innodb.result
1.169 06/06/01 22:16:40 elliot@stripped +0 -0
Auto merged
mysql-test/mysql-test-run.sh
1.312 06/06/01 22:16:40 elliot@stripped +0 -0
Auto merged
mysql-test/mysql-test-run.pl
1.121 06/06/01 22:16:40 elliot@stripped +0 -0
Auto merged
mysql-test/lib/mtr_process.pl
1.34 06/06/01 22:16:40 elliot@stripped +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: elliot
# Host: scared.(none)
# Root: /home/emurphy/src/bk-clean/mysql-5.2/RESYNC
--- 1.345/configure.in 2006-05-02 15:58:56 -04:00
+++ 1.346/configure.in 2006-06-01 22:24:01 -04:00
@@ -31,15 +31,14 @@ sinclude(config/ac-macros/alloca.m4)
sinclude(config/ac-macros/check_cpu.m4)
sinclude(config/ac-macros/character_sets.m4)
sinclude(config/ac-macros/compiler_flag.m4)
-sinclude(config/ac-macros/storage.m4)
+sinclude(config/ac-macros/plugins.m4)
sinclude(config/ac-macros/ha_berkeley.m4)
sinclude(config/ac-macros/ha_ndbcluster.m4)
sinclude(config/ac-macros/large_file.m4)
sinclude(config/ac-macros/misc.m4)
-sinclude(config/ac-macros/openssl.m4)
sinclude(config/ac-macros/readline.m4)
sinclude(config/ac-macros/replication.m4)
-sinclude(config/ac-macros/yassl.m4)
+sinclude(config/ac-macros/ssl.m4)
sinclude(config/ac-macros/zlib.m4)
# Remember to add a directory sql/share/LANGUAGE
@@ -51,7 +50,6 @@ romanian russian serbian slovak spanish
#####
#####
-
AC_SUBST(MYSQL_NO_DASH_VERSION)
AC_SUBST(MYSQL_BASE_VERSION)
AC_SUBST(MYSQL_VERSION_ID)
@@ -780,48 +778,6 @@ struct request_info *req;
AC_SUBST(WRAPLIBS)
if test "$TARGET_LINUX" = "true"; then
- AC_MSG_CHECKING([for atomic operations])
-
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
-
- atom_ops=
- AC_TRY_RUN([
-#include <asm/atomic.h>
-int main()
-{
- atomic_t v;
-
- atomic_set(&v, 23);
- atomic_add(5, &v);
- return atomic_read(&v) == 28 ? 0 : -1;
-}
- ],
- [AC_DEFINE([HAVE_ATOMIC_ADD], [1],
- [atomic_add() from <asm/atomic.h> (Linux only)])
- atom_ops="${atom_ops}atomic_add "],
- )
- AC_TRY_RUN([
-#include <asm/atomic.h>
-int main()
-{
- atomic_t v;
-
- atomic_set(&v, 23);
- atomic_sub(5, &v);
- return atomic_read(&v) == 18 ? 0 : -1;
-}
- ],
- [AC_DEFINE([HAVE_ATOMIC_SUB], [1],
- [atomic_sub() from <asm/atomic.h> (Linux only)])
- atom_ops="${atom_ops}atomic_sub "],
- )
-
- if test -z "$atom_ops"; then atom_ops="no"; fi
- AC_MSG_RESULT($atom_ops)
-
- AC_LANG_RESTORE
-
AC_ARG_WITH(pstack,
[ --with-pstack Use the pstack backtrace library],
[ USE_PSTACK=$withval ],
@@ -873,38 +829,20 @@ fi
# Later in this script LIBS will be augmented with a threads library.
NON_THREADED_LIBS="$LIBS"
-AC_MSG_CHECKING([for int8])
-case $SYSTEM_TYPE in
- *netware)
- AC_MSG_RESULT([no])
- ;;
- *)
-AC_TRY_RUN([
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
+AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
+ uchar, uint, ulong],[],[], [
#include <sys/types.h>
-#endif
-
-int main()
-{
- int8 i;
- return 0;
-}
-],
-[AC_DEFINE([HAVE_INT_8_16_32], [1],
- [whether int8, int16 and int32 types exist])
-AC_MSG_RESULT([yes])],
-[AC_MSG_RESULT([no])]
-)
- ;;
-esac
+])
+AC_CHECK_TYPES([in_addr_t], [], [], [
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+])
+AC_CHECK_TYPES([fp_except], [], [], [
+#include <sys/types.h>
+#include <ieeefp.h>
+])
#
# Some system specific hacks
@@ -1089,7 +1027,7 @@ dnl Is this the right match for DEC OSF
# Edit Makefile.in files.
#
echo -n "configuring Makefile.in files for NetWare... "
- for file in sql/Makefile.in libmysql/Makefile.in libmysql_r/Makefile.in sql/share/Makefile.in strings/Makefile.in client/Makefile.in
+ for file in sql/Makefile.in extra/Makefile.in client/Makefile.in
do
# echo "#### $file ####"
filedir="`dirname $file`"
@@ -1110,32 +1048,13 @@ dnl Is this the right match for DEC OSF
# Add library dependencies to mysqld_DEPENDENCIES
lib_DEPENDENCIES="\$(pstack_libs) \$(openssl_libs) \$(yassl_libs)"
cat > $filesed << EOF
-s,\(^.*\$(MAKE) gen_lex_hash\)\$(EXEEXT),#\1,
s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux,
-s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES %
+s%\(mysqld_DEPENDENCIES = \)%\1$lib_DEPENDENCIES %
EOF
;;
- sql/share/Makefile.in)
+ extra/Makefile.in)
cat > $filesed << EOF
-s,\(extra/comp_err\),\1.linux,
-EOF
- ;;
- libmysql/Makefile.in)
- cat > $filesed << EOF
-s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
-s,\(: conf_to_src\),\1.linux,
-EOF
- ;;
- libmysql_r/Makefile.in)
- cat > $filesed << EOF
-s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
-s,\(: conf_to_src\),\1.linux,
-EOF
- ;;
- strings/Makefile.in)
- cat > $filesed << EOF
-s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
-s,\(: conf_to_src\),\1.linux,
+s,\(extra/comp_err\)\$(EXEEXT),\1.linux,
EOF
;;
client/Makefile.in)
@@ -1623,7 +1542,7 @@ fi
# If we should allow error injection tests
AC_ARG_WITH(error-inject,
- [ --with-error-inject Enable error injection in MySQL Server],
+ AC_HELP_STRING([--with-error-inject],[Enable error injection in MySQL Server]),
[ with_error_inject=$withval ],
[ with_error_inject=no ])
@@ -1652,6 +1571,20 @@ then
fi
fi
+AC_ARG_WITH([atomic-ops],
+ AC_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
+ [Implement atomic operations using pthread rwlocks or atomic CPU
+ instructions for multi-processor (default) or uniprocessor
+ configuration]), , [with_atomic_ops=smp])
+case "$with_atomic_ops" in
+ "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
+ [Assume single-CPU mode, no concurrency]) ;;
+ "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
+ [Use pthread rwlocks for atomic ops]) ;;
+ "smp") ;;
+ *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
+esac
+
# Force static compilation to avoid linking problems/get more speed
AC_ARG_WITH(mysqld-ldflags,
[ --with-mysqld-ldflags Extra linking arguments for mysqld],
@@ -1783,16 +1716,6 @@ MYSQL_FUNC_ALLOCA
MYSQL_TIMESPEC_TS
# Do we have the tzname variable
MYSQL_TZNAME
-# Do the system files define ulong
-MYSQL_CHECK_ULONG
-# Do the system files define uchar
-MYSQL_CHECK_UCHAR
-# Do the system files define uint
-MYSQL_CHECK_UINT
-# Check for fp_except in ieeefp.h
-MYSQL_CHECK_FP_EXCEPT
-# Check for IN_ADDR_T
-MYSQL_CHECK_IN_ADDR_T
# Do the c++ compiler have a bool type
MYSQL_CXX_BOOL
# Check some common bugs with gcc 2.8.# on sparc
@@ -2196,6 +2119,89 @@ then
fi
AC_MSG_RESULT("$netinet_inc")
+#--------------------------------------------------------------------
+# Check for requested features
+#--------------------------------------------------------------------
+
+MYSQL_CHECK_BIG_TABLES
+MYSQL_CHECK_MAX_INDEXES
+MYSQL_CHECK_REPLICATION
+MYSQL_CHECK_VIO
+MYSQL_CHECK_SSL
+
+#--------------------------------------------------------------------
+# Declare our plugin modules
+# Has to be done late, as the plugin may need to check for existence of
+# functions tested above
+#--------------------------------------------------------------------
+
+MYSQL_STORAGE_ENGINE(berkeley, berkeley-db, [BerkeleyDB Storage Engine],
+ [Transactional Tables using BerkeleyDB], [max,max-no-ndb])
+MYSQL_PLUGIN_DIRECTORY(berkeley,[storage/bdb])
+MYSQL_PLUGIN_STATIC(berkeley, [[\$(bdb_libs_with_path)]])
+MYSQL_PLUGIN_ACTIONS(berkeley, [MYSQL_SETUP_BERKELEY_DB])
+
+MYSQL_STORAGE_ENGINE(blackhole,,[Blackhole Storage Engine],
+ [Basic Write-only Read-never tables], [max,max-no-ndb])
+MYSQL_PLUGIN_DIRECTORY(blackhole, [storage/blackhole])
+MYSQL_PLUGIN_STATIC(blackhole, [libblackhole.a])
+MYSQL_PLUGIN_DYNAMIC(blackhole, [ha_blackhole.la])
+
+MYSQL_STORAGE_ENGINE(csv,, [CSV Storage Engine],
+ [Stores tables in text CSV format])
+MYSQL_PLUGIN_DIRECTORY(csv, [storage/csv])
+MYSQL_PLUGIN_STATIC(csv, [libcsv.a])
+MYSQL_PLUGIN_MANDATORY(csv) dnl Used for logging
+
+MYSQL_STORAGE_ENGINE(federated,,[Federated Storage Engine],
+ [Connects to tables on remote MySQL servers], [max,max-no-ndb])
+
+MYSQL_PLUGIN(ftexample, [Simple Parser],
+ [Simple full-text parser plugin])
+MYSQL_PLUGIN_DIRECTORY(ftexample, [plugin/fulltext])
+MYSQL_PLUGIN_DYNAMIC(ftexample, [mypluglib.la])
+
+MYSQL_STORAGE_ENGINE(heap,no, [Memory Storage Engine],
+ [Volatile memory based tables])
+MYSQL_PLUGIN_DIRECTORY(heap, [storage/heap])
+MYSQL_PLUGIN_STATIC(heap, [libheap.a])
+MYSQL_PLUGIN_MANDATORY(heap) dnl Memory tables
+
+MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
+ [Transactional Tables using InnoDB], [max,max-no-ndb])
+MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
+MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a])
+MYSQL_PLUGIN_ACTIONS(innobase, [
+ AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
+ AC_SUBST(innodb_system_libs)
+])
+
+MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
+ [Traditional non-transactional MySQL tables])
+MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam])
+MYSQL_PLUGIN_STATIC(myisam, [libmyisam.a])
+MYSQL_PLUGIN_MANDATORY(myisam) dnl Default
+
+MYSQL_STORAGE_ENGINE(myisammrg,no,[MyISAM MERGE Engine],
+ [Merge multiple MySQL tables into one])
+MYSQL_PLUGIN_DIRECTORY(myisammrg,[storage/myisammrg])
+MYSQL_PLUGIN_STATIC(myisammrg, [libmyisammrg.a])
+MYSQL_PLUGIN_MANDATORY(myisammrg)
+
+MYSQL_STORAGE_ENGINE(ndbcluster, ndbcluster, [Cluster Storage Engine],
+ [High Availability Clustered tables], [max])
+MYSQL_PLUGIN_DIRECTORY(ndbcluster,[storage/ndb])
+MYSQL_PLUGIN_STATIC(ndbcluster, [[\$(ndbcluster_libs) \$(ndbcluster_system_libs) \$(NDB_SCI_LIBS)]])
+MYSQL_PLUGIN_ACTIONS(ndbcluster,[MYSQL_SETUP_NDBCLUSTER])
+
+MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support],
+ [MySQL Partitioning Support], [max,max-no-ndb])
+
+dnl -- ndbcluster requires partition to be enabled
+MYSQL_PLUGIN_DEPENDS(ndbcluster, [partition])
+
+MYSQL_CONFIGURE_PLUGINS([none])
+
# Only build client code?
AC_ARG_WITH(server,
[ --without-server Only build the client.],
@@ -2249,21 +2255,18 @@ fi
tools_dirs=""
AC_ARG_WITH([mysqlmanager],
- AC_HELP_STRING([--with-mysqlmanager], [Build the mysqlmanager binary: yes/no (default: build if server is built.)]),
- [if test "x${withval}" != "xno"; then
- tools_dirs="$tools_dirs server-tools"
- fi],
- [if test "x${with_server}" = "xyes"; then
- tools_dirs="$tools_dirs server-tools"
- fi]
-)
+ AC_HELP_STRING([--with-mysqlmanager], [Build the mysqlmanager binary: yes/no (default: build if server is built.)]),,)
+
+if test "$with_mysqlmanager" = "yes" -o \
+ '(' "$with_mysqlmanager:$with_server" = ":yes" -a \
+ -d "$srcdir/server-tools" ')' ; then
+ tools_dirs="$tools_dirs server-tools"
+ AC_CONFIG_FILES(server-tools/Makefile server-tools/instance-manager/Makefile)
+fi
AC_SUBST(tools_dirs)
#MYSQL_CHECK_CPU
-MYSQL_CHECK_VIO
-MYSQL_CHECK_OPENSSL
-MYSQL_CHECK_YASSL
libmysqld_dirs=
linked_libmysqld_targets=
@@ -2428,73 +2431,6 @@ AC_SUBST(readline_basedir)
AC_SUBST(readline_link)
AC_SUBST(readline_h_ln_cmd)
-MYSQL_CHECK_BIG_TABLES
-MYSQL_CHECK_MAX_INDEXES
-MYSQL_CHECK_REPLICATION
-
-MYSQL_STORAGE_ENGINE(innobase,,innodb,,,,innobase,ha_innodb.o,[ dnl
- \$(top_builddir)/storage/innobase/usr/libusr.a dnl
- \$(top_builddir)/storage/innobase/srv/libsrv.a dnl
- \$(top_builddir)/storage/innobase/dict/libdict.a dnl
- \$(top_builddir)/storage/innobase/que/libque.a dnl
- \$(top_builddir)/storage/innobase/srv/libsrv.a dnl
- \$(top_builddir)/storage/innobase/ibuf/libibuf.a dnl
- \$(top_builddir)/storage/innobase/row/librow.a dnl
- \$(top_builddir)/storage/innobase/pars/libpars.a dnl
- \$(top_builddir)/storage/innobase/btr/libbtr.a dnl
- \$(top_builddir)/storage/innobase/trx/libtrx.a dnl
- \$(top_builddir)/storage/innobase/read/libread.a dnl
- \$(top_builddir)/storage/innobase/usr/libusr.a dnl
- \$(top_builddir)/storage/innobase/buf/libbuf.a dnl
- \$(top_builddir)/storage/innobase/ibuf/libibuf.a dnl
- \$(top_builddir)/storage/innobase/eval/libeval.a dnl
- \$(top_builddir)/storage/innobase/log/liblog.a dnl
- \$(top_builddir)/storage/innobase/fsp/libfsp.a dnl
- \$(top_builddir)/storage/innobase/fut/libfut.a dnl
- \$(top_builddir)/storage/innobase/fil/libfil.a dnl
- \$(top_builddir)/storage/innobase/lock/liblock.a dnl
- \$(top_builddir)/storage/innobase/mtr/libmtr.a dnl
- \$(top_builddir)/storage/innobase/page/libpage.a dnl
- \$(top_builddir)/storage/innobase/rem/librem.a dnl
- \$(top_builddir)/storage/innobase/thr/libthr.a dnl
- \$(top_builddir)/storage/innobase/sync/libsync.a dnl
- \$(top_builddir)/storage/innobase/data/libdata.a dnl
- \$(top_builddir)/storage/innobase/mach/libmach.a dnl
- \$(top_builddir)/storage/innobase/ha/libha.a dnl
- \$(top_builddir)/storage/innobase/dyn/libdyn.a dnl
- \$(top_builddir)/storage/innobase/mem/libmem.a dnl
- \$(top_builddir)/storage/innobase/sync/libsync.a dnl
- \$(top_builddir)/storage/innobase/ut/libut.a dnl
- \$(top_builddir)/storage/innobase/os/libos.a dnl
- \$(top_builddir)/storage/innobase/ut/libut.a],[
- AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
- AC_SUBST(innodb_includes)
- AC_SUBST(innodb_libs)
- AC_SUBST(innodb_system_libs)
- other_configures="$other_configures storage/innobase/configure"
-])
-
-MYSQL_STORAGE_ENGINE(berkeley,,berkeley-db,,,,bdb,,,[
- MYSQL_SETUP_BERKELEY_DB
-])
-MYSQL_STORAGE_ENGINE(example,,,,,,example,no,
- \$(top_builddir)/storage/example/libexample.a,[
- AC_CONFIG_FILES(storage/example/Makefile)
-])
-MYSQL_STORAGE_ENGINE(archive,,,,,,archive,,
- \$(top_builddir)/storage/archive/libarchive.a, [
- AC_CONFIG_FILES(storage/archive/Makefile)
-])
-MYSQL_STORAGE_ENGINE(csv,,,"yes",,tina_hton,csv,no,
- \$(top_builddir)/storage/csv/libcsv.a,[
- AC_CONFIG_FILES(storage/csv/Makefile)
-])
-MYSQL_STORAGE_ENGINE(blackhole)
-MYSQL_STORAGE_ENGINE(federated)
-MYSQL_STORAGE_ENGINE(ndbcluster,,ndbcluster,,,,ndb,,,[
- MYSQL_SETUP_NDBCLUSTER
-])
-MYSQL_STORAGE_ENGINE(partition,,partition)
# If we have threads generate some library functions and test programs
sql_server_dirs=
@@ -2551,7 +2487,7 @@ then
AC_SUBST(THREAD_LOBJECTS)
server_scripts="mysqld_safe mysql_install_db"
sql_server_dirs="strings mysys dbug extra regex"
- mysql_se_dirs="myisam myisammrg heap $mysql_se_dirs"
+
sql_server="$sql_server vio sql"
fi
@@ -2567,12 +2503,9 @@ AC_SUBST(sql_server)
AC_SUBST(thread_dirs)
AC_SUBST(server_scripts)
-AC_SUBST(mysql_se_dirs)
-AC_SUBST(mysql_se_libs)
-AC_SUBST(mysql_se_objs)
-AC_SUBST(mysql_se_htons)
-AC_SUBST(mysql_se_decls)
-AC_SUBST(mysql_se_plugins)
+AC_SUBST(mysql_plugin_dirs)
+AC_SUBST(mysql_plugin_libs)
+AC_SUBST(mysql_plugin_defs)
# Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
@@ -2614,25 +2547,18 @@ AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTION
# Output results
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
- unittest/Makefile dnl
- unittest/mytap/Makefile unittest/mytap/t/Makefile dnl
+ unittest/Makefile unittest/mytap/Makefile unittest/mytap/t/Makefile dnl
unittest/mysys/Makefile unittest/examples/Makefile dnl
- strings/Makefile regex/Makefile storage/Makefile storage/heap/Makefile dnl
- storage/myisam/Makefile storage/myisammrg/Makefile dnl
+ strings/Makefile regex/Makefile storage/Makefile dnl
man/Makefile BUILD/Makefile vio/Makefile dnl
libmysql/Makefile client/Makefile dnl
pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile dnl
- sql/handlerton.cc sql-common/Makefile dnl
- dbug/Makefile scripts/Makefile dnl
- include/Makefile dnl
- server-tools/Makefile server-tools/instance-manager/Makefile dnl
+ sql/sql_builtin.cc sql-common/Makefile dnl
+ dbug/Makefile scripts/Makefile include/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl
support-files/MacOSX/Makefile mysql-test/Makefile dnl
mysql-test/ndb/Makefile netware/Makefile dnl
- include/mysql_version.h dnl
- plugin/Makefile dnl
- plugin/fulltext/Makefile dnl
- win/Makefile)
+ include/mysql_version.h plugin/Makefile win/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
AC_OUTPUT
--- 1.311/mysql-test/mysql-test-run.sh 2006-04-27 01:51:39 -04:00
+++ 1.312/mysql-test/mysql-test-run.sh 2006-06-01 22:16:40 -04:00
@@ -205,6 +205,7 @@ TOT_SKIP=0
TOT_PASS=0
TOT_FAIL=0
TOT_TEST=0
+GOT_WARNINGS=0
USERT=0
SYST=0
REALT=0
@@ -1072,22 +1073,21 @@ report_stats () {
#
$RM -f $MY_LOG_DIR/warnings $MY_LOG_DIR/warnings.tmp
# Remove some non fatal warnings from the log files
- $SED -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' \
+ $SED -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' -e 's|InnoDB: Warning: we did not need to do crash recovery||g' \
$MY_LOG_DIR/*.err \
| $SED -e 's!Warning: Table:.* on rename!!g' \
> $MY_LOG_DIR/warnings.tmp
- found_error=0
# Find errors
- for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN"
+ for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN" "mysqld: Warning" "Attempting backtrace" "Assertion .* failed"
do
if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
then
- found_error=1
+ GOT_WARNINGS=1
fi
done
$RM -f $MY_LOG_DIR/warnings.tmp
- if [ $found_error = "1" ]
+ if [ $GOT_WARNINGS = "1" ]
then
echo "WARNING: Got errors/warnings while running tests. Please examine"
echo "$MY_LOG_DIR/warnings for details."
@@ -1345,7 +1345,6 @@ start_master()
--innodb_data_file_path=ibdata1:128M:autoextend \
--open-files-limit=1024 \
--log-bin-trust-function-creators \
- --loose-binlog-show-xid=0 \
$MASTER_40_ARGS \
$SMALL_SERVER \
$MASTER_MYSQLD_BINLOG_OPT \
@@ -1369,7 +1368,6 @@ start_master()
--language=$LANGUAGE \
--innodb_data_file_path=ibdata1:128M:autoextend \
--log-bin-trust-function-creators \
- --loose-binlog-show-xid=0 \
$MASTER_40_ARGS \
$SMALL_SERVER \
$MASTER_MYSQLD_BINLOG_OPT \
@@ -1542,7 +1540,6 @@ start_slave()
--master-retry-count=10 \
-O slave_net_timeout=10 \
--log-bin-trust-function-creators \
- --loose-binlog-show-xid=0 \
$SMALL_SERVER \
$SLAVE_MYSQLD_BINLOG_OPT \
$EXTRA_SLAVE_MYSQLD_OPT $EXTRA_SLAVE_OPT \
@@ -2300,6 +2297,8 @@ if [ $TOT_FAIL -ne 0 ]; then
$ECHO "mysql-test-run in $TEST_MODE mode: *** Failing the test(s):$FAILED_CASES"
$ECHO
exit 1
-else
- exit 0
fi
+if [ $GOT_WARNINGS -ne 0 ]; then
+ exit 1
+fi
+exit 0
--- 1.114/scripts/make_binary_distribution.sh 2006-04-27 01:51:39 -04:00
+++ 1.115/scripts/make_binary_distribution.sh 2006-06-01 22:17:33 -04:00
@@ -148,7 +148,7 @@ BIN_FILES="extra/comp_err$BS extra/repla
if [ $BASE_SYSTEM = "netware" ] ; then
BIN_FILES="$BIN_FILES \
netware/mysqld_safe$BS netware/mysql_install_db$BS \
- netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \
+ netware/init_db.sql netware/test_db.sql$BS \
netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \
";
# For all other platforms:
--- 1.221/sql/handler.cc 2006-04-27 01:51:40 -04:00
+++ 1.222/sql/handler.cc 2006-06-01 22:17:34 -04:00
@@ -35,6 +35,7 @@
#define NDB_MAX_ATTRIBUTES_IN_TABLE 128
#include "ha_ndbcluster.h"
#endif
+
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
#endif
@@ -43,43 +44,28 @@
#include "ha_innodb.h"
#endif
-extern handlerton *sys_table_types[];
+/* While we have legacy_db_type, we have this array to
+ check for dups and to find handlerton from legacy_db_type.
+ Remove when legacy_db_type is finally gone */
+static handlerton *installed_htons[128];
+st_plugin_int *hton2plugin[MAX_HA];
#define BITMAP_STACKBUF_SIZE (128/8)
+KEY_CREATE_INFO default_key_create_info= { HA_KEY_ALG_UNDEF, 0, {NullS,0} };
+
/* static functions defined in this file */
static handler *create_default(TABLE_SHARE *table);
-const handlerton default_hton =
-{
- MYSQL_HANDLERTON_INTERFACE_VERSION,
- "DEFAULT",
- SHOW_OPTION_YES,
- NULL,
- DB_TYPE_DEFAULT,
- NULL,
- 0, 0,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL,
- create_default,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, /* alter_tablespace */
- NULL, /* fill_files_table */
- HTON_NO_FLAGS, /* flags */
- NULL, /* binlog_func */
- NULL, /* binlog_log_query */
- NULL /* release_temporary_latches */
-};
-
static SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES;
/* number of entries in handlertons[] */
-ulong total_ha;
+ulong total_ha= 0;
/* number of storage engines (from handlertons[]) that support 2pc */
-ulong total_ha_2pc;
+ulong total_ha_2pc= 0;
/* size of savepoint storage area (see ha_init) */
-ulong savepoint_alloc_size;
+ulong savepoint_alloc_size= 0;
struct show_table_alias_st sys_table_aliases[]=
{
@@ -116,7 +102,7 @@ handlerton *ha_resolve_by_name(THD *thd,
if ((plugin= plugin_lock(name, MYSQL_STORAGE_ENGINE_PLUGIN)))
{
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
if (!(hton->flags & HTON_NOT_USER_SELECTABLE))
return hton;
plugin_unlock(plugin);
@@ -138,30 +124,8 @@ handlerton *ha_resolve_by_name(THD *thd,
}
-struct plugin_find_dbtype_st
-{
- enum legacy_db_type db_type;
- handlerton *hton;
-};
-
-
-static my_bool plugin_find_dbtype(THD *unused, st_plugin_int *plugin,
- void *arg)
-{
- handlerton *types= (handlerton *) plugin->plugin->info;
- if (types->db_type == ((struct plugin_find_dbtype_st *)arg)->db_type)
- {
- ((struct plugin_find_dbtype_st *)arg)->hton= types;
- return TRUE;
- }
- return FALSE;
-}
-
-
const char *ha_get_storage_engine(enum legacy_db_type db_type)
{
- struct plugin_find_dbtype_st info;
-
switch (db_type)
{
case DB_TYPE_DEFAULT:
@@ -169,13 +133,10 @@ const char *ha_get_storage_engine(enum l
case DB_TYPE_UNKNOWN:
return "UNKNOWN";
default:
- info.db_type= db_type;
-
- if (!plugin_foreach(NULL, plugin_find_dbtype,
- MYSQL_STORAGE_ENGINE_PLUGIN, &info))
+ if (db_type > DB_TYPE_UNKNOWN && db_type < DB_TYPE_DEFAULT &&
+ installed_htons[db_type])
+ return hton2plugin[installed_htons[db_type]->slot]->name.str;
return "*NONE*";
-
- return info.hton->name;
}
}
@@ -183,15 +144,12 @@ const char *ha_get_storage_engine(enum l
static handler *create_default(TABLE_SHARE *table)
{
handlerton *hton=ha_resolve_by_legacy_type(current_thd, DB_TYPE_DEFAULT);
- return (hton && hton != &default_hton && hton->create) ?
- hton->create(table) : NULL;
+ return (hton && hton->create) ? hton->create(table) : NULL;
}
handlerton *ha_resolve_by_legacy_type(THD *thd, enum legacy_db_type db_type)
{
- struct plugin_find_dbtype_st info;
-
switch (db_type)
{
case DB_TYPE_DEFAULT:
@@ -202,12 +160,9 @@ handlerton *ha_resolve_by_legacy_type(TH
case DB_TYPE_UNKNOWN:
return NULL;
default:
- info.db_type= db_type;
- if (!plugin_foreach(NULL, plugin_find_dbtype,
- MYSQL_STORAGE_ENGINE_PLUGIN, &info))
- return NULL;
-
- return info.hton;
+ if (db_type > DB_TYPE_UNKNOWN && db_type < DB_TYPE_DEFAULT)
+ return installed_htons[db_type];
+ return NULL;
}
}
@@ -394,32 +349,72 @@ static int ha_finish_errors(void)
}
-static void ha_was_inited_ok(handlerton *ht)
+int ha_finalize_handlerton(st_plugin_int *plugin)
{
- uint tmp= ht->savepoint_offset;
- ht->savepoint_offset= savepoint_alloc_size;
- savepoint_alloc_size+= tmp;
- ht->slot= total_ha++;
- if (ht->prepare)
- total_ha_2pc++;
+ handlerton *hton= (handlerton *)plugin->data;
+ DBUG_ENTER("ha_finalize_handlerton");
+
+ switch (hton->state)
+ {
+ case SHOW_OPTION_NO:
+ case SHOW_OPTION_DISABLED:
+ break;
+ case SHOW_OPTION_YES:
+ if (installed_htons[hton->db_type] == hton)
+ installed_htons[hton->db_type]= NULL;
+ if (hton->panic && hton->panic(HA_PANIC_CLOSE))
+ DBUG_RETURN(1);
+ break;
+ };
+ DBUG_RETURN(0);
}
-int ha_initialize_handlerton(handlerton *hton)
+int ha_initialize_handlerton(st_plugin_int *plugin)
{
+ handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
DBUG_ENTER("ha_initialize_handlerton");
- if (hton == NULL)
- DBUG_RETURN(1);
+ plugin->data= hton; // shortcut for the future
- switch (hton->state)
- {
+ /*
+ the switch below and hton->state should be removed when
+ command-line options for plugins will be implemented
+ */
+ switch (hton->state) {
case SHOW_OPTION_NO:
break;
case SHOW_OPTION_YES:
- if (!hton->init || !hton->init())
{
- ha_was_inited_ok(hton);
+ uint tmp;
+ /* now check the db_type for conflict */
+ if (hton->db_type <= DB_TYPE_UNKNOWN ||
+ hton->db_type >= DB_TYPE_DEFAULT ||
+ installed_htons[hton->db_type])
+ {
+ int idx= (int) DB_TYPE_FIRST_DYNAMIC;
+
+ while (idx < (int) DB_TYPE_DEFAULT && installed_htons[idx])
+ idx++;
+
+ if (idx == (int) DB_TYPE_DEFAULT)
+ {
+ sql_print_warning("Too many storage engines!");
+ DBUG_RETURN(1);
+ }
+ if (hton->db_type != DB_TYPE_UNKNOWN)
+ sql_print_warning("Storage engine '%s' has conflicting typecode. "
+ "Assigning value %d.", plugin->plugin->name, idx);
+ hton->db_type= (enum legacy_db_type) idx;
+ }
+ installed_htons[hton->db_type]= hton;
+ tmp= hton->savepoint_offset;
+ hton->savepoint_offset= savepoint_alloc_size;
+ savepoint_alloc_size+= tmp;
+ hton->slot= total_ha++;
+ hton2plugin[hton->slot]=plugin;
+ if (hton->prepare)
+ total_ha_2pc++;
break;
}
/* fall through */
@@ -430,29 +425,13 @@ int ha_initialize_handlerton(handlerton
DBUG_RETURN(0);
}
-
-static my_bool init_handlerton(THD *unused1, st_plugin_int *plugin,
- void *unused2)
-{
- if (plugin->state == PLUGIN_IS_UNINITIALIZED)
- {
- ha_initialize_handlerton((handlerton *) plugin->plugin->info);
- plugin->state= PLUGIN_IS_READY;
- }
- return FALSE;
-}
-
-
int ha_init()
{
int error= 0;
- total_ha= savepoint_alloc_size= 0;
+ DBUG_ENTER("ha_init");
if (ha_init_errors())
- return 1;
-
- if (plugin_foreach(NULL, init_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, 0))
- return 1;
+ DBUG_RETURN(1);
DBUG_ASSERT(total_ha < MAX_HA);
/*
@@ -462,49 +441,17 @@ int ha_init()
*/
opt_using_transactions= total_ha>(ulong)opt_bin_log;
savepoint_alloc_size+= sizeof(SAVEPOINT);
- return error;
-}
-
-
-int ha_register_builtin_plugins()
-{
- handlerton **hton;
- uint size= 0;
- struct st_mysql_plugin *plugin;
- DBUG_ENTER("ha_register_builtin_plugins");
-
- for (hton= sys_table_types; *hton; hton++)
- size+= sizeof(struct st_mysql_plugin);
-
- if (!(plugin= (struct st_mysql_plugin *)
- my_once_alloc(size, MYF(MY_WME | MY_ZEROFILL))))
- DBUG_RETURN(1);
-
- for (hton= sys_table_types; *hton; hton++, plugin++)
- {
- plugin->type= MYSQL_STORAGE_ENGINE_PLUGIN;
- plugin->info= *hton;
- plugin->version= 0;
- plugin->name= (*hton)->name;
- plugin->author= NULL;
- plugin->descr= (*hton)->comment;
-
- if (plugin_register_builtin(plugin))
- DBUG_RETURN(1);
- }
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
}
+/*
+ close, flush or restart databases
+ Ignore this for other databases than ours
+*/
-
-
- /* close, flush or restart databases */
- /* Ignore this for other databases than ours */
-
-static my_bool panic_handlerton(THD *unused1, st_plugin_int *plugin,
- void *arg)
+static my_bool panic_handlerton(THD *unused1, st_plugin_int *plugin, void *arg)
{
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES && hton->panic)
((int*)arg)[0]|= hton->panic((enum ha_panic_function)((int*)arg)[1]);
return FALSE;
@@ -514,10 +461,10 @@ static my_bool panic_handlerton(THD *unu
int ha_panic(enum ha_panic_function flag)
{
int error[2];
-
+
error[0]= 0; error[1]= (int)flag;
plugin_foreach(NULL, panic_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, error);
-
+
if (flag == HA_PANIC_CLOSE && ha_finish_errors())
error[0]= 1;
return error[0];
@@ -526,7 +473,7 @@ int ha_panic(enum ha_panic_function flag
static my_bool dropdb_handlerton(THD *unused1, st_plugin_int *plugin,
void *path)
{
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES && hton->drop_database)
hton->drop_database((char *)path);
return FALSE;
@@ -542,9 +489,11 @@ void ha_drop_database(char* path)
static my_bool closecon_handlerton(THD *thd, st_plugin_int *plugin,
void *unused)
{
- handlerton *hton= (handlerton *) plugin->plugin->info;
- /* there's no need to rollback here as all transactions must
- be rolled back already */
+ handlerton *hton= (handlerton *)plugin->data;
+ /*
+ there's no need to rollback here as all transactions must
+ be rolled back already
+ */
if (hton->state == SHOW_OPTION_YES && hton->close_connection &&
thd->ha_data[hton->slot])
hton->close_connection(thd);
@@ -634,7 +583,8 @@ int ha_prepare(THD *thd)
else
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA), (*ht)->name);
+ ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
+ hton2plugin[(*ht)->slot]->name.str);
}
}
}
@@ -873,7 +823,7 @@ struct xahton_st {
static my_bool xacommit_handlerton(THD *unused1, st_plugin_int *plugin,
void *arg)
{
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES && hton->recover)
{
hton->commit_by_xid(((struct xahton_st *)arg)->xid);
@@ -885,7 +835,7 @@ static my_bool xacommit_handlerton(THD *
static my_bool xarollback_handlerton(THD *unused1, st_plugin_int *plugin,
void *arg)
{
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES && hton->recover)
{
hton->rollback_by_xid(((struct xahton_st *)arg)->xid);
@@ -900,7 +850,7 @@ int ha_commit_or_rollback_by_xid(XID *xi
struct xahton_st xaop;
xaop.xid= xid;
xaop.result= 1;
-
+
plugin_foreach(NULL, commit ? xacommit_handlerton : xarollback_handlerton,
MYSQL_STORAGE_ENGINE_PLUGIN, &xaop);
@@ -992,16 +942,16 @@ struct xarecover_st
static my_bool xarecover_handlerton(THD *unused, st_plugin_int *plugin,
void *arg)
{
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
struct xarecover_st *info= (struct xarecover_st *) arg;
int got;
-
+
if (hton->state == SHOW_OPTION_YES && hton->recover)
{
while ((got= hton->recover(info->list, info->len)) > 0 )
{
sql_print_information("Found %d prepared transaction(s) in %s",
- got, hton->name);
+ got, hton2plugin[hton->slot]->name.str);
for (int i=0; i < got; i ++)
{
my_xid x=info->list[i].get_my_xid();
@@ -1181,7 +1131,7 @@ bool mysql_xa_recover(THD *thd)
static my_bool release_temporary_latches(THD *thd, st_plugin_int *plugin,
void *unused)
{
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES && hton->release_temporary_latches)
hton->release_temporary_latches(thd);
@@ -1306,7 +1256,7 @@ int ha_release_savepoint(THD *thd, SAVEP
static my_bool snapshot_handlerton(THD *thd, st_plugin_int *plugin,
void *arg)
{
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES &&
hton->start_consistent_snapshot)
{
@@ -1337,7 +1287,7 @@ int ha_start_consistent_snapshot(THD *th
static my_bool flush_handlerton(THD *thd, st_plugin_int *plugin,
void *arg)
{
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES && hton->flush_logs && hton->flush_logs())
return TRUE;
return FALSE;
@@ -1824,6 +1774,24 @@ ulonglong handler::get_auto_increment()
}
+void handler::print_keydupp_error(uint key_nr, const char *msg)
+{
+ /* Write the duplicated key in the error message */
+ char key[MAX_KEY_LENGTH];
+ String str(key,sizeof(key),system_charset_info);
+ /* Table is opened and defined at this point */
+ key_unpack(&str,table,(uint) key_nr);
+ uint max_length=MYSQL_ERRMSG_SIZE-(uint) strlen(msg);
+ if (str.length() >= max_length)
+ {
+ str.length(max_length-4);
+ str.append(STRING_WITH_LEN("..."));
+ }
+ my_printf_error(ER_DUP_ENTRY, msg,
+ MYF(0), str.c_ptr(), table->key_info[key_nr].name);
+}
+
+
/*
Print error that we got from handler function
@@ -1863,18 +1831,7 @@ void handler::print_error(int error, myf
uint key_nr=get_dup_key(error);
if ((int) key_nr >= 0)
{
- /* Write the duplicated key in the error message */
- char key[MAX_KEY_LENGTH];
- String str(key,sizeof(key),system_charset_info);
- /* Table is opened and defined at this point */
- key_unpack(&str,table,(uint) key_nr);
- uint max_length=MYSQL_ERRMSG_SIZE-(uint) strlen(ER(ER_DUP_ENTRY));
- if (str.length() >= max_length)
- {
- str.length(max_length-4);
- str.append(STRING_WITH_LEN("..."));
- }
- my_error(ER_DUP_ENTRY, MYF(0), str.c_ptr(), table->key_info[key_nr].name);
+ print_keydupp_error(key_nr, ER(ER_DUP_ENTRY));
DBUG_VOID_RETURN;
}
textno=ER_DUP_KEY;
@@ -2641,7 +2598,7 @@ struct binlog_func_st
static my_bool binlog_func_list(THD *thd, st_plugin_int *plugin, void *arg)
{
hton_list_st *hton_list= (hton_list_st *)arg;
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES && hton->binlog_func)
{
uint sz= hton_list->sz;
@@ -2731,7 +2688,7 @@ static my_bool binlog_log_query_handlert
st_plugin_int *plugin,
void *args)
{
- return binlog_log_query_handlerton2(thd, (const handlerton *) plugin->plugin->info, args);
+ return binlog_log_query_handlerton2(thd, (const handlerton *)plugin->data, args);
}
void ha_binlog_log_query(THD *thd, const handlerton *hton,
@@ -3012,7 +2969,7 @@ int handler::index_read_idx(byte * buf,
SYNOPSIS
ha_known_exts()
-
+
NOTES
No mutexes, worst case race is a minor surplus memory allocation
We have to recreate the extension map if mysqld is restarted (for example
@@ -3026,14 +2983,14 @@ static my_bool exts_handlerton(THD *unus
void *arg)
{
List<char> *found_exts= (List<char> *) arg;
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
handler *file;
if (hton->state == SHOW_OPTION_YES && hton->create &&
(file= hton->create((TABLE_SHARE*) 0)))
{
List_iterator_fast<char> it(*found_exts);
const char **ext, *old_ext;
-
+
for (ext= file->bas_ext(); *ext; ext++)
{
while ((old_ext= it++))
@@ -3062,14 +3019,14 @@ TYPELIB *ha_known_exts(void)
known_extensions_id= mysys_usage_id;
found_exts.push_back((char*) triggers_file_ext);
found_exts.push_back((char*) trigname_file_ext);
-
- plugin_foreach(NULL, exts_handlerton,
+
+ plugin_foreach(NULL, exts_handlerton,
MYSQL_STORAGE_ENGINE_PLUGIN, &found_exts);
ext= (const char **) my_once_alloc(sizeof(char *)*
(found_exts.elements+1),
MYF(MY_WME | MY_FAE));
-
+
DBUG_ASSERT(ext != 0);
known_extensions.count= found_exts.elements;
known_extensions.type_names= ext;
@@ -3102,7 +3059,7 @@ static my_bool showstat_handlerton(THD *
void *arg)
{
enum ha_stat_type stat= *(enum ha_stat_type *) arg;
- handlerton *hton= (handlerton *) plugin->plugin->info;
+ handlerton *hton= (handlerton *)plugin->data;
if (hton->state == SHOW_OPTION_YES && hton->show_status &&
hton->show_status(thd, stat_print, stat))
return TRUE;
@@ -3125,16 +3082,19 @@ bool ha_show_status(THD *thd, handlerton
if (db_type == NULL)
{
- result= plugin_foreach(thd, showstat_handlerton,
+ result= plugin_foreach(thd, showstat_handlerton,
MYSQL_STORAGE_ENGINE_PLUGIN, &stat);
}
else
{
if (db_type->state != SHOW_OPTION_YES)
- result= stat_print(thd, db_type->name, strlen(db_type->name),
+ {
+ const LEX_STRING *name=&hton2plugin[db_type->slot]->name;
+ result= stat_print(thd, name->str, name->length,
"", 0, "DISABLED", 8) ? 1 : 0;
+ }
else
- result= db_type->show_status &&
+ result= db_type->show_status &&
db_type->show_status(thd, stat_print, stat) ? 1 : 0;
}
@@ -3270,10 +3230,11 @@ int handler::ha_external_lock(THD *thd,
locking combined with row-based replication needs to be looked
over. Ideally, no such special handling should be needed.
*/
- switch (thd->lex->sql_command)
- {
+ switch (thd->lex->sql_command) {
case SQLCOM_TRUNCATE:
case SQLCOM_ALTER_TABLE:
+ case SQLCOM_OPTIMIZE:
+ case SQLCOM_REPAIR:
DBUG_RETURN(0);
default:
break;
--- 1.176/sql/item.cc 2006-05-02 15:58:57 -04:00
+++ 1.177/sql/item.cc 2006-06-01 22:17:34 -04:00
@@ -304,6 +304,7 @@ Item::Item():
marker= 0;
maybe_null=null_value=with_sum_func=unsigned_flag=0;
decimals= 0; max_length= 0;
+ with_subselect= 0;
/* Put item in free list so that we can free all items at end */
THD *thd= current_thd;
@@ -961,6 +962,12 @@ void Item_splocal::print(String *str)
}
+bool Item_splocal::set_value(THD *thd, sp_rcontext *ctx, Item **it)
+{
+ return ctx->set_variable(thd, get_var_idx(), it);
+}
+
+
/*****************************************************************************
Item_case_expr methods
*****************************************************************************/
@@ -1890,7 +1897,6 @@ Item_decimal::Item_decimal(const char *s
name= (char*) str_arg;
decimals= (uint8) decimal_value.frac;
fixed= 1;
- unsigned_flag= !decimal_value.sign();
max_length= my_decimal_precision_to_length(decimal_value.intg + decimals,
decimals, unsigned_flag);
}
@@ -1900,7 +1906,6 @@ Item_decimal::Item_decimal(longlong val,
int2my_decimal(E_DEC_FATAL_ERROR, val, unsig, &decimal_value);
decimals= (uint8) decimal_value.frac;
fixed= 1;
- unsigned_flag= !decimal_value.sign();
max_length= my_decimal_precision_to_length(decimal_value.intg + decimals,
decimals, unsigned_flag);
}
@@ -1911,7 +1916,6 @@ Item_decimal::Item_decimal(double val, i
double2my_decimal(E_DEC_FATAL_ERROR, val, &decimal_value);
decimals= (uint8) decimal_value.frac;
fixed= 1;
- unsigned_flag= !decimal_value.sign();
max_length= my_decimal_precision_to_length(decimal_value.intg + decimals,
decimals, unsigned_flag);
}
@@ -1924,7 +1928,6 @@ Item_decimal::Item_decimal(const char *s
name= (char*) str;
decimals= (uint8) decimal_par;
max_length= length;
- unsigned_flag= !decimal_value.sign();
fixed= 1;
}
@@ -1934,7 +1937,6 @@ Item_decimal::Item_decimal(my_decimal *v
my_decimal2decimal(value_par, &decimal_value);
decimals= (uint8) decimal_value.frac;
fixed= 1;
- unsigned_flag= !decimal_value.sign();
max_length= my_decimal_precision_to_length(decimal_value.intg + decimals,
decimals, unsigned_flag);
}
@@ -1946,7 +1948,6 @@ Item_decimal::Item_decimal(const char *b
&decimal_value, precision, scale);
decimals= (uint8) decimal_value.frac;
fixed= 1;
- unsigned_flag= !decimal_value.sign();
max_length= my_decimal_precision_to_length(precision, decimals,
unsigned_flag);
}
@@ -4881,7 +4882,16 @@ void Item_ref::cleanup()
void Item_ref::print(String *str)
{
if (ref)
- (*ref)->print(str);
+ {
+ if ((*ref)->type() != Item::CACHE_ITEM && ref_type() != VIEW_REF &&
+ name && alias_name_used)
+ {
+ THD *thd= current_thd;
+ append_identifier(thd, str, name, (uint) strlen(name));
+ }
+ else
+ (*ref)->print(str);
+ }
else
Item_ident::print(str);
}
@@ -5413,6 +5423,25 @@ bool Item_trigger_field::eq(const Item *
}
+void Item_trigger_field::set_required_privilege(bool rw)
+{
+ /*
+ Require SELECT and UPDATE privilege if this field will be read and
+ set, and only UPDATE privilege for setting the field.
+ */
+ want_privilege= (rw ? SELECT_ACL | UPDATE_ACL : UPDATE_ACL);
+}
+
+
+bool Item_trigger_field::set_value(THD *thd, sp_rcontext */*ctx*/, Item **it)
+{
+ Item *item= sp_prepare_func_item(thd, it);
+
+ return (!item || (!fixed && fix_fields(thd, 0)) ||
+ (item->save_in_field(field, 0) < 0));
+}
+
+
bool Item_trigger_field::fix_fields(THD *thd, Item **items)
{
/*
@@ -5435,8 +5464,7 @@ bool Item_trigger_field::fix_fields(THD
if (table_grants)
{
- table_grants->want_privilege=
- access_type == AT_READ ? SELECT_ACL : UPDATE_ACL;
+ table_grants->want_privilege= want_privilege;
if (check_grant_column(thd, table_grants, triggers->table->s->db.str,
triggers->table->s->table_name.str, field_name,
@@ -5468,6 +5496,7 @@ void Item_trigger_field::print(String *s
void Item_trigger_field::cleanup()
{
+ want_privilege= original_privilege;
/*
Since special nature of Item_trigger_field we should not do most of
things from Item_field::cleanup() or Item_ident::cleanup() here.
--- 1.197/sql/item.h 2006-05-02 15:58:57 -04:00
+++ 1.198/sql/item.h 2006-06-01 22:17:34 -04:00
@@ -401,6 +401,44 @@ typedef enum monotonicity_info
/*************************************************************************/
+class sp_rcontext;
+
+
+class Settable_routine_parameter
+{
+public:
+ /*
+ Set required privileges for accessing the parameter.
+
+ SYNOPSIS
+ set_required_privilege()
+ rw if 'rw' is true then we are going to read and set the
+ parameter, so SELECT and UPDATE privileges might be
+ required, otherwise we only reading it and SELECT
+ privilege might be required.
+ */
+ Settable_routine_parameter() {}
+ virtual ~Settable_routine_parameter() {}
+ virtual void set_required_privilege(bool rw) {};
+
+ /*
+ Set parameter value.
+
+ SYNOPSIS
+ set_value()
+ thd thread handle
+ ctx context to which parameter belongs (if it is local
+ variable).
+ it item which represents new value
+
+ RETURN
+ FALSE if parameter value has been set,
+ TRUE if error has occured.
+ */
+ virtual bool set_value(THD *thd, sp_rcontext *ctx, Item **it)= 0;
+};
+
+
typedef bool (Item::*Item_processor)(byte *arg);
typedef Item* (Item::*Item_transformer) (byte *arg);
typedef void (*Cond_traverser) (const Item *item, void *arg);
@@ -454,6 +492,9 @@ public:
my_bool is_autogenerated_name; /* indicate was name of this Item
autogenerated or set by user */
DTCollation collation;
+ my_bool with_subselect; /* If this item is a subselect or some
+ of its arguments is or contains a
+ subselect */
// alloc & destruct is done as start of select using sql_alloc
Item();
@@ -744,6 +785,29 @@ public:
virtual bool find_item_in_field_list_processor(byte *arg) { return 0; }
virtual bool change_context_processor(byte *context) { return 0; }
virtual bool reset_query_id_processor(byte *query_id) { return 0; }
+ /*
+ Check if a partition function is allowed
+ SYNOPSIS
+ check_partition_func_processor()
+ bool_arg Return argument
+ RETURN VALUE
+ 0
+ DESCRIPTION
+ check_partition_func_processor is used to check if a partition function
+ uses an allowed function. The default is that an item is not allowed
+ in a partition function. However all mathematical functions, string
+ manipulation functions, date functions are allowed. Allowed functions
+ can never depend on server version, they cannot depend on anything
+ related to the environment. They can also only depend on a set of
+ fields in the table itself. They cannot depend on other tables and
+ cannot contain any queries and cannot contain udf's or similar.
+ If a new Item class is defined and it inherits from a class that is
+ allowed in a partition function then it is very important to consider
+ whether this should be inherited to the new class. If not the function
+ below should be defined in the new Item class.
+ */
+ virtual bool check_partition_func_processor(byte *bool_arg)
+ { *(bool *)bool_arg= FALSE; return 0; }
virtual Item *equal_fields_propagator(byte * arg) { return this; }
virtual Item *set_no_const_sub(byte *arg) { return this; }
@@ -784,6 +848,15 @@ public:
}
virtual bool is_splocal() { return 0; } /* Needed for error checking */
+
+ /*
+ Return Settable_routine_parameter interface of the Item. Return 0
+ if this Item is not Settable_routine_parameter.
+ */
+ virtual Settable_routine_parameter *get_settable_routine_parameter()
+ {
+ return 0;
+ }
};
@@ -882,7 +955,8 @@ inline bool Item_sp_variable::send(Proto
runtime.
*****************************************************************************/
-class Item_splocal :public Item_sp_variable
+class Item_splocal :public Item_sp_variable,
+ private Settable_routine_parameter
{
uint m_var_idx;
@@ -920,6 +994,15 @@ public:
inline enum Type type() const;
inline Item_result result_type() const;
+
+private:
+ bool set_value(THD *thd, sp_rcontext *ctx, Item **it);
+
+public:
+ Settable_routine_parameter *get_settable_routine_parameter()
+ {
+ return this;
+ }
};
/*****************************************************************************
@@ -1015,6 +1098,7 @@ public:
Item::maybe_null= TRUE;
}
+ bool check_partition_func_processor(byte *bool_arg) { return 0; }
bool fix_fields(THD *, Item **);
enum Type type() const;
@@ -1061,6 +1145,7 @@ public:
Item_num() {} /* Remove gcc warning */
virtual Item_num *neg()= 0;
Item *safe_charset_converter(CHARSET_INFO *tocs);
+ bool check_partition_func_processor(byte *bool_arg) { return 0;}
};
#define NO_CACHED_FIELD_INDEX ((uint)(-1))
@@ -1202,6 +1287,7 @@ public:
result_field->query_id= field->query_id;
return 0;
}
+ bool check_partition_func_processor(byte *bool_arg) { return 0; }
void cleanup();
Item_equal *find_item_equal(COND_EQUAL *cond_equal);
Item *equal_fields_propagator(byte *arg);
@@ -1245,6 +1331,7 @@ public:
bool is_null() { return 1; }
void print(String *str) { str->append(STRING_WITH_LEN("NULL")); }
Item *safe_charset_converter(CHARSET_INFO *tocs);
+ bool check_partition_func_processor(byte *bool_arg) { return 0;}
};
class Item_null_result :public Item_null
@@ -1257,6 +1344,8 @@ public:
{
save_in_field(result_field, no_conversions);
}
+ bool check_partition_func_processor(byte *bool_arg)
+ { *(bool *)bool_arg= FALSE; return 0; }
};
/* Item represents one placeholder ('?') of prepared statement */
@@ -1547,6 +1636,8 @@ public:
{}
void print(String *str) { str->append(func_name); }
Item *safe_charset_converter(CHARSET_INFO *tocs);
+ bool check_partition_func_processor(byte *bool_arg)
+ { *(bool *)bool_arg= FALSE; return 0; }
};
@@ -1624,6 +1715,7 @@ public:
void print(String *str);
// to prevent drop fixed flag (no need parent cleanup call)
void cleanup() {}
+ bool check_partition_func_processor(byte *bool_arg) { return 0;}
};
@@ -1638,6 +1730,8 @@ public:
{}
Item *safe_charset_converter(CHARSET_INFO *tocs);
void print(String *str) { str->append(func_name); }
+ bool check_partition_func_processor(byte *bool_arg)
+ { *(bool *)bool_arg= FALSE; return 0; }
};
@@ -1650,6 +1744,8 @@ public:
&my_charset_bin)
{ max_length=19;}
enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; }
+ bool check_partition_func_processor(byte *bool_arg)
+ { *(bool *)bool_arg= FALSE; return 0; }
};
class Item_empty_string :public Item_string
@@ -1672,6 +1768,8 @@ public:
unsigned_flag=1;
}
enum_field_types field_type() const { return int_field_type; }
+ bool check_partition_func_processor(byte *bool_arg)
+ { *(bool *)bool_arg= FALSE; return 0; }
};
@@ -1695,6 +1793,7 @@ public:
void cleanup() {}
bool eq(const Item *item, bool binary_cmp) const;
virtual Item *safe_charset_converter(CHARSET_INFO *tocs);
+ bool check_partition_func_processor(byte *bool_arg) { return 0;}
};
@@ -1917,6 +2016,8 @@ public:
}
Item *new_item();
virtual Item *real_item() { return ref; }
+ bool check_partition_func_processor(byte *bool_arg)
+ { *(bool *)bool_arg= FALSE; return 0; }
};
#ifdef MYSQL_SERVER
@@ -2146,14 +2247,13 @@ class Table_triggers_list;
two Field instances representing either OLD or NEW version of this
field.
*/
-class Item_trigger_field : public Item_field
+class Item_trigger_field : public Item_field,
+ private Settable_routine_parameter
{
public:
/* Is this item represents row from NEW or OLD row ? */
enum row_version_type {OLD_ROW, NEW_ROW};
row_version_type row_version;
- /* Is this item used for reading or updating the value? */
- enum access_types { AT_READ = 0x1, AT_UPDATE = 0x2 };
/* Next in list of all Item_trigger_field's in trigger */
Item_trigger_field *next_trg_field;
/* Index of the field in the TABLE::field array */
@@ -2164,11 +2264,11 @@ public:
Item_trigger_field(Name_resolution_context *context_arg,
row_version_type row_ver_arg,
const char *field_name_arg,
- access_types access_type_arg)
+ ulong priv, const bool ro)
:Item_field(context_arg,
(const char *)NULL, (const char *)NULL, field_name_arg),
- row_version(row_ver_arg), field_idx((uint)-1),
- access_type(access_type_arg), table_grants(NULL)
+ row_version(row_ver_arg), field_idx((uint)-1), original_privilege(priv),
+ want_privilege(priv), table_grants(NULL), read_only (ro)
{}
void setup_field(THD *thd, TABLE *table, GRANT_INFO *table_grant_info);
enum Type type() const { return TRIGGER_FIELD_ITEM; }
@@ -2179,8 +2279,39 @@ public:
void cleanup();
private:
- access_types access_type;
+ void set_required_privilege(bool rw);
+ bool set_value(THD *thd, sp_rcontext *ctx, Item **it);
+
+public:
+ Settable_routine_parameter *get_settable_routine_parameter()
+ {
+ return (read_only ? 0 : this);
+ }
+
+ bool set_value(THD *thd, Item **it)
+ {
+ return set_value(thd, NULL, it);
+ }
+
+private:
+ /*
+ 'want_privilege' holds privileges required to perform operation on
+ this trigger field (SELECT_ACL if we are going to read it and
+ UPDATE_ACL if we are going to update it). It is initialized at
+ parse time but can be updated later if this trigger field is used
+ as OUT or INOUT parameter of stored routine (in this case
+ set_required_privilege() is called to appropriately update
+ want_privilege and cleanup() is responsible for restoring of
+ original want_privilege once parameter's value is updated).
+ */
+ ulong original_privilege;
+ ulong want_privilege;
GRANT_INFO *table_grants;
+ /*
+ Trigger field is read-only unless it belongs to the NEW row in a
+ BEFORE INSERT of BEFORE UPDATE trigger.
+ */
+ bool read_only;
};
@@ -2201,6 +2332,7 @@ public:
max_length= item->max_length;
decimals= item->decimals;
collation.set(item->collation);
+ unsigned_flag= item->unsigned_flag;
return 0;
};
virtual void store(Item *)= 0;
--- 1.465/sql/sql_yacc.yy 2006-04-27 01:51:40 -04:00
+++ 1.466/sql/sql_yacc.yy 2006-06-01 22:17:34 -04:00
@@ -204,6 +204,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
%token CONSTRAINT
%token CONTAINS_SYM
%token CONTINUE_SYM
+%token CONTRIBUTORS_SYM
%token CONVERT_SYM
%token CONVERT_TZ_SYM
%token COUNT_SYM
@@ -364,6 +365,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
%token JOIN_SYM
%token KEYS
%token KEY_SYM
+%token KEY_BLOCK_SIZE
%token KILL_SYM
%token LANGUAGE_SYM
%token LAST_INSERT_ID
@@ -474,6 +476,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
%token NUMERIC_SYM
%token NVARCHAR_SYM
%token OFFSET_SYM
+%token OJ_SYM
%token OLD_PASSWORD
%token ON
%token ONE_SHOT_SYM
@@ -566,6 +569,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
%token RTREE_SYM
%token SAVEPOINT_SYM
%token SCHEDULE_SYM
+%token SCHEDULER_SYM
%token SECOND_MICROSECOND_SYM
%token SECOND_SYM
%token SECURITY_SYM
@@ -730,7 +734,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
sp_opt_label BIN_NUM label_ident TEXT_STRING_filesystem
%type <lex_str_ptr>
- opt_table_alias opt_fulltext_parser
+ opt_table_alias
%type <table>
table_ident table_ident_nodb references xid
@@ -795,7 +799,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
key_type opt_unique_or_fulltext constraint_key_type
%type <key_alg>
- key_alg opt_btree_or_rtree
+ btree_or_rtree
%type <string_list>
key_usage_list using_list
@@ -886,6 +890,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
view_suid view_tail view_list_opt view_list view_select
view_check_option trigger_tail sp_tail
install uninstall partition_entry binlog_base64_event
+ init_key_options key_options key_opts key_opt key_using_alg
END_OF_INPUT
%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
@@ -1220,11 +1225,13 @@ create:
}
create2
{ Lex->current_select= &Lex->select_lex; }
- | CREATE opt_unique_or_fulltext INDEX_SYM ident key_alg ON table_ident
+ | CREATE opt_unique_or_fulltext INDEX_SYM ident key_alg ON
+ table_ident
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_CREATE_INDEX;
- if (!lex->current_select->add_table_to_list(lex->thd, $7, NULL,
+ if (!lex->current_select->add_table_to_list(lex->thd, $7,
+ NULL,
TL_OPTION_UPDATING))
YYABORT;
lex->create_list.empty();
@@ -1232,15 +1239,16 @@ create:
lex->col_list.empty();
lex->change=NullS;
}
- '(' key_list ')' opt_fulltext_parser
+ '(' key_list ')' key_options
{
LEX *lex=Lex;
- if ($2 != Key::FULLTEXT && $12)
+ if ($2 != Key::FULLTEXT && lex->key_create_info.parser_name.str)
{
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
- lex->key_list.push_back(new Key($2,$4.str,$5,0,lex->col_list,$12));
+ lex->key_list.push_back(new Key($2, $4.str, &lex->key_create_info, 0,
+ lex->col_list));
lex->col_list.empty();
}
| CREATE DATABASE opt_if_not_exists ident
@@ -1395,7 +1403,7 @@ opt_ev_status: /* empty */ { $$= 0; }
{
LEX *lex=Lex;
if (!lex->et_compile_phase)
- lex->et->status= MYSQL_EVENT_ENABLED;
+ lex->et->status= Event_timed::ENABLED;
$$= 1;
}
| DISABLE_SYM
@@ -1403,7 +1411,7 @@ opt_ev_status: /* empty */ { $$= 0; }
LEX *lex=Lex;
if (!lex->et_compile_phase)
- lex->et->status= MYSQL_EVENT_DISABLED;
+ lex->et->status= Event_timed::DISABLED;
$$= 1;
}
;
@@ -1467,14 +1475,14 @@ ev_on_completion:
{
LEX *lex=Lex;
if (!lex->et_compile_phase)
- lex->et->on_completion= MYSQL_EVENT_ON_COMPLETION_PRESERVE;
+ lex->et->on_completion= Event_timed::ON_COMPLETION_PRESERVE;
$$= 1;
}
| ON COMPLETION_SYM NOT_SYM PRESERVE_SYM
{
LEX *lex=Lex;
if (!lex->et_compile_phase)
- lex->et->on_completion= MYSQL_EVENT_ON_COMPLETION_DROP;
+ lex->et->on_completion= Event_timed::ON_COMPLETION_DROP;
$$= 1;
}
;
@@ -3094,11 +3102,11 @@ opt_ts_engine:
"STORAGE ENGINE");
YYABORT;
}
- lex->alter_tablespace_info->storage_engine= $4 ? $4 : &default_hton;
+ lex->alter_tablespace_info->storage_engine= $4;
};
opt_ts_wait:
- /* empty */
+ /* empty */
| ts_wait
;
@@ -3890,6 +3898,11 @@ create_table_option:
| STORAGE_SYM DISK_SYM {Lex->create_info.store_on_disk= TRUE;}
| STORAGE_SYM MEMORY_SYM {Lex->create_info.store_on_disk= FALSE;}
| CONNECTION_SYM opt_equal TEXT_STRING_sys { Lex->create_info.connect_string.str= $3.str; Lex->create_info.connect_string.length= $3.length; Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION; }
+ | KEY_BLOCK_SIZE opt_equal ulong_num
+ {
+ Lex->create_info.used_fields|= HA_CREATE_USED_KEY_BLOCK_SIZE;
+ Lex->create_info.key_block_size= $3;
+ }
;
default_charset:
@@ -3929,12 +3942,18 @@ storage_engines:
ident_or_text
{
$$ = ha_resolve_by_name(YYTHD, &$1);
- if ($$ == NULL &&
- test(YYTHD->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION))
+ if ($$ == NULL)
+ if (YYTHD->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
{
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
YYABORT;
}
+ else
+ {
+ push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ER_UNKNOWN_STORAGE_ENGINE,
+ ER(ER_UNKNOWN_STORAGE_ENGINE), $1.str);
+ }
};
row_types:
@@ -3983,23 +4002,25 @@ column_def:
;
key_def:
- key_type opt_ident key_alg '(' key_list ')' opt_fulltext_parser
+ key_type opt_ident key_alg '(' key_list ')' key_options
{
LEX *lex=Lex;
- if ($1 != Key::FULLTEXT && $7)
+ if ($1 != Key::FULLTEXT && lex->key_create_info.parser_name.str)
{
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
- lex->key_list.push_back(new Key($1,$2, $3, 0, lex->col_list, $7));
+ lex->key_list.push_back(new Key($1,$2, &lex->key_create_info, 0,
+ lex->col_list));
lex->col_list.empty(); /* Alloced by sql_alloc */
}
- | opt_constraint constraint_key_type opt_ident key_alg '(' key_list ')'
+ | opt_constraint constraint_key_type opt_ident key_alg
+ '(' key_list ')' key_options
{
LEX *lex=Lex;
- const char *key_name= $3 ? $3:$1;
- lex->key_list.push_back(new Key($2, key_name, $4, 0,
- lex->col_list));
+ const char *key_name= $3 ? $3 : $1;
+ lex->key_list.push_back(new Key($2, key_name, &lex->key_create_info, 0,
+ lex->col_list));
lex->col_list.empty(); /* Alloced by sql_alloc */
}
| opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references
@@ -4012,7 +4033,7 @@ key_def:
lex->fk_update_opt,
lex->fk_match_option));
lex->key_list.push_back(new Key(Key::MULTIPLE, $4 ? $4 : $1,
- HA_KEY_ALG_UNDEF, 1,
+ &default_key_create_info, 1,
lex->col_list));
lex->col_list.empty(); /* Alloced by sql_alloc */
@@ -4029,20 +4050,6 @@ key_def:
}
;
-opt_fulltext_parser:
- /* empty */ { $$= (LEX_STRING *)0; }
- | WITH PARSER_SYM IDENT_sys
- {
- if (plugin_is_ready(&$3, MYSQL_FTPARSER_PLUGIN))
- $$= (LEX_STRING *)sql_memdup(&$3, sizeof(LEX_STRING));
- else
- {
- my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), $3.str);
- YYABORT;
- }
- }
- ;
-
opt_check_constraint:
/* empty */
| check_constraint
@@ -4516,12 +4523,56 @@ opt_unique_or_fulltext:
}
;
+init_key_options:
+ {
+ Lex->key_create_info= default_key_create_info;
+ }
+ ;
+
+/*
+ For now, key_alg initializies lex->key_create_info.
+ In the future, when all key options are after key definition,
+ we can remove key_alg and move init_key_options to key_options
+*/
+
key_alg:
- /* empty */ { $$= HA_KEY_ALG_UNDEF; }
- | USING opt_btree_or_rtree { $$= $2; }
- | TYPE_SYM opt_btree_or_rtree { $$= $2; };
+ /* empty */ init_key_options
+ | init_key_options key_using_alg
+ ;
+
+key_options:
+ /* empty */ {}
+ | key_opts
+ ;
+
+key_opts:
+ key_opt
+ | key_opts key_opt
+ ;
+
+key_using_alg:
+ USING btree_or_rtree { Lex->key_create_info.algorithm= $2; }
+ | TYPE_SYM btree_or_rtree { Lex->key_create_info.algorithm= $2; }
+ ;
-opt_btree_or_rtree:
+key_opt:
+ key_using_alg
+ | KEY_BLOCK_SIZE opt_equal ulong_num
+ { Lex->key_create_info.block_size= $3; }
+ | WITH PARSER_SYM IDENT_sys
+ {
+ if (plugin_is_ready(&$3, MYSQL_FTPARSER_PLUGIN))
+ Lex->key_create_info.parser_name= $3;
+ else
+ {
+ my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), $3.str);
+ YYABORT;
+ }
+ }
+ ;
+
+
+btree_or_rtree:
BTREE_SYM { $$= HA_KEY_ALG_BTREE; }
| RTREE_SYM
{
@@ -4535,7 +4586,7 @@ key_list:
key_part:
ident { $$=new key_part_spec($1.str); }
- | ident '(' NUM ')'
+ | ident '(' NUM ')'
{
int key_part_len= atoi($3.str);
if (!key_part_len)
@@ -4579,7 +4630,7 @@ alter:
lex->select_lex.db=lex->name= 0;
lex->like_name= 0;
bzero((char*) &lex->create_info,sizeof(lex->create_info));
- lex->create_info.db_type= (handlerton*) &default_hton;
+ lex->create_info.db_type= 0;
lex->create_info.default_table_charset= NULL;
lex->create_info.row_type= ROW_TYPE_NOT_USED;
lex->alter_info.reset();
@@ -6901,11 +6952,14 @@ table_factor:
}
expr '}'
{
+ LEX *lex= Lex;
YYERROR_UNLESS($3 && $7);
add_join_on($7,$10);
Lex->pop_context();
$7->outer_join|=JOIN_TYPE_LEFT;
$$=$7;
+ if (!($$= lex->current_select->nest_last_join(lex->thd)))
+ YYABORT;
}
| select_derived_init get_select_lex select_derived2
{
@@ -7450,7 +7504,11 @@ select_var_ident:
if (lex->result)
((select_dumpvar *)lex->result)->var_list.push_back( new my_var($2,0,0,(enum_field_types)0));
else
- YYABORT;
+ /*
+ The parser won't create select_result instance only
+ if it's an EXPLAIN.
+ */
+ DBUG_ASSERT(lex->describe);
}
| ident_or_text
{
@@ -7462,10 +7520,8 @@ select_var_ident:
my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
YYABORT;
}
- if (! lex->result)
- YYABORT;
- else
- {
+ if (lex->result)
+ {
my_var *var;
((select_dumpvar *)lex->result)->
var_list.push_back(var= new my_var($1,1,t->offset,t->type));
@@ -7473,6 +7529,14 @@ select_var_ident:
if (var)
var->sp= lex->sphead;
#endif
+ }
+ else
+ {
+ /*
+ The parser won't create select_result instance only
+ if it's an EXPLAIN.
+ */
+ DBUG_ASSERT(lex->describe);
}
}
;
@@ -8011,15 +8075,24 @@ show_param:
if (prepare_schema_table(YYTHD, lex, 0, SCH_TRIGGERS))
YYABORT;
}
- | opt_full EVENTS_SYM opt_db wild_and_where
+ | EVENTS_SYM opt_db wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_EVENTS;
- lex->select_lex.db= $3;
+ lex->select_lex.db= $2;
if (prepare_schema_table(YYTHD, lex, 0, SCH_EVENTS))
YYABORT;
}
+ | SCHEDULER_SYM STATUS_SYM
+ {
+#ifndef DBUG_OFF
+ Lex->sql_command= SQLCOM_SHOW_SCHEDULER_STATUS;
+#else
+ yyerror(ER(ER_SYNTAX_ERROR));
+ YYABORT;
+#endif
+ }
| TABLE_SYM STATUS_SYM opt_db wild_and_where
{
LEX *lex= Lex;
@@ -8038,7 +8111,7 @@ show_param:
if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES))
YYABORT;
}
- | PLUGIN_SYM
+ | opt_full PLUGIN_SYM
{
LEX *lex= Lex;
WARN_DEPRECATED(yythd, "5.2", "SHOW PLUGIN", "'SHOW PLUGINS'");
@@ -8128,6 +8201,11 @@ show_param:
LEX *lex=Lex;
lex->sql_command= SQLCOM_SHOW_AUTHORS;
}
+ | CONTRIBUTORS_SYM
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SHOW_CONTRIBUTORS;
+ }
| PRIVILEGES
{
LEX *lex=Lex;
@@ -8968,12 +9046,18 @@ simple_ident_q:
YYABORT;
}
+ DBUG_ASSERT(!new_row ||
+ (lex->trg_chistics.event == TRG_EVENT_INSERT ||
+ lex->trg_chistics.event == TRG_EVENT_UPDATE));
+ const bool read_only=
+ !(new_row && lex->trg_chistics.action_time == TRG_ACTION_BEFORE);
if (!(trg_fld= new Item_trigger_field(Lex->current_context(),
new_row ?
Item_trigger_field::NEW_ROW:
Item_trigger_field::OLD_ROW,
$3.str,
- Item_trigger_field::AT_READ)))
+ SELECT_ACL,
+ read_only)))
YYABORT;
/*
@@ -9348,7 +9432,7 @@ keyword_sp:
| ISSUER_SYM {}
| INNOBASE_SYM {}
| INSERT_METHOD {}
- | RELAY_THREAD {}
+ | KEY_BLOCK_SIZE {}
| LAST_SYM {}
| LEAVES {}
| LESS_SYM {}
@@ -9435,6 +9519,7 @@ keyword_sp:
| REDUNDANT_SYM {}
| RELAY_LOG_FILE_SYM {}
| RELAY_LOG_POS_SYM {}
+ | RELAY_THREAD {}
| RELOAD {}
| REORGANIZE_SYM {}
| REPEATABLE_SYM {}
@@ -9449,6 +9534,7 @@ keyword_sp:
| ROW_SYM {}
| RTREE_SYM {}
| SCHEDULE_SYM {}
+ | SCHEDULER_SYM {}
| SECOND_SYM {}
| SERIAL_SYM {}
| SERIALIZABLE_SYM {}
@@ -9653,11 +9739,13 @@ sys_option_value:
it= new Item_null();
}
+ DBUG_ASSERT(lex->trg_chistics.action_time == TRG_ACTION_BEFORE &&
+ (lex->trg_chistics.event == TRG_EVENT_INSERT ||
+ lex->trg_chistics.event == TRG_EVENT_UPDATE));
if (!(trg_fld= new Item_trigger_field(Lex->current_context(),
Item_trigger_field::NEW_ROW,
$2.base_name.str,
- Item_trigger_field::AT_UPDATE)
- ) ||
+ UPDATE_ACL, FALSE)) ||
!(sp_fld= new sp_instr_set_trigger_field(lex->sphead->
instructions(),
lex->spcont,
--- 1.89/sql/share/errmsg.txt 2006-05-02 15:58:58 -04:00
+++ 1.90/sql/share/errmsg.txt 2006-06-01 22:17:34 -04:00
@@ -2978,52 +2978,52 @@ ER_UDF_EXISTS
swe "Funktionen '%-.64s' finns redan"
ER_CANT_OPEN_LIBRARY
- nla "Kan shared library '%-.64s' niet openen (Errcode: %d %s)"
- eng "Can't open shared library '%-.64s' (errno: %d %s)"
- est "Ei suuda avada jagatud teeki '%-.64s' (veakood: %d %s)"
- hun "A(z) '%-.64s' megosztott konyvtar nem hasznalhato (hibakod: %d %s)"
- ita "Impossibile aprire la libreria condivisa '%-.64s' (errno: %d %s)"
- nor "Can't open shared library '%-.64s' (errno: %d %s)"
- norwegian-ny "Can't open shared library '%-.64s' (errno: %d %s)"
- pol "Can't open shared library '%-.64s' (errno: %d %s)"
- rum "Nu pot deschide libraria shared '%-.64s' (Eroare: %d %s)"
- serbian "Ne mogu da otvorim share-ovanu biblioteku '%-.64s' (errno: %d %s)"
- spa "No puedo abrir libraria conjugada '%-.64s' (errno: %d %s)"
-ER_CANT_FIND_DL_ENTRY
- dan "Kan ikke finde funktionen '%-.64s' i bibliotek"
- nla "Kan functie '%-.64s' niet in library vinden"
- eng "Can't find symbol '%-.64s' in library"
- est "Ei leia funktsiooni '%-.64s' antud teegis"
- ger "Kann Funktion '%-.64s' in der Library nicht finden"
- hun "A(z) '%-.64s' fuggveny nem talalhato a konyvtarban"
- ita "Impossibile trovare la funzione '%-.64s' nella libreria"
- rum "Nu pot gasi functia '%-.64s' in libraria"
- serbian "Ne mogu da pronadjem funkciju '%-.64s' u biblioteci"
- swe "Hittar inte funktionen '%-.64s' in det dynamiska biblioteket"
+ nla "Kan shared library '%-.64s' niet openen (Errcode: %d %-.128s)"
+ eng "Can't open shared library '%-.64s' (errno: %d %-.128s)"
+ est "Ei suuda avada jagatud teeki '%-.64s' (veakood: %d %-.128s)"
+ hun "A(z) '%-.64s' megosztott konyvtar nem hasznalhato (hibakod: %d %-.128s)"
+ ita "Impossibile aprire la libreria condivisa '%-.64s' (errno: %d %-.128s)"
+ nor "Can't open shared library '%-.64s' (errno: %d %-.128s)"
+ norwegian-ny "Can't open shared library '%-.64s' (errno: %d %-.128s)"
+ pol "Can't open shared library '%-.64s' (errno: %d %-.128s)"
+ rum "Nu pot deschide libraria shared '%-.64s' (Eroare: %d %-.128s)"
+ serbian "Ne mogu da otvorim share-ovanu biblioteku '%-.64s' (errno: %d %-.128s)"
+ spa "No puedo abrir libraria conjugada '%-.64s' (errno: %d %-.128s)"
+ER_CANT_FIND_DL_ENTRY
+ dan "Kan ikke finde funktionen '%-.128s' i bibliotek"
+ nla "Kan functie '%-.128s' niet in library vinden"
+ eng "Can't find symbol '%-.128s' in library"
+ est "Ei leia funktsiooni '%-.128s' antud teegis"
+ ger "Kann Funktion '%-.128s' in der Library nicht finden"
+ hun "A(z) '%-.128s' fuggveny nem talalhato a konyvtarban"
+ ita "Impossibile trovare la funzione '%-.128s' nella libreria"
+ rum "Nu pot gasi functia '%-.128s' in libraria"
+ serbian "Ne mogu da pronadjem funkciju '%-.128s' u biblioteci"
+ swe "Hittar inte funktionen '%-.128s' in det dynamiska biblioteket"
ER_FUNCTION_NOT_DEFINED
dan "Funktionen '%-.64s' er ikke defineret"
@@ -5042,7 +5042,7 @@ ER_OPTION_PREVENTS_STATEMENT
ER_DUPLICATED_VALUE_IN_TYPE
eng "Column '%-.100s' has duplicated value '%-.64s' in %s"
ger "Feld '%-.100s' hat doppelten Wert '%-.64s' in %s"
@@ -5472,7 +5472,7 @@ ER_SP_DUP_HANDLER 42000
eng "Duplicate handler declared in the same block"
ger "Doppelter Handler im selben Block deklariert"
ER_SP_NOT_VAR_ARG 42000
- eng "OUT or INOUT argument %d for routine %s is not a variable"
+ eng "OUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE trigger"
ER_SP_NO_RETSET 0A000
eng "Not allowed to return a result set from a %s"
@@ -5602,6 +5602,22 @@ ER_SP_RECURSION_LIMIT
ER_SP_PROC_TABLE_CORRUPT
eng "Failed to load routine %-.64s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)"
+ER_SP_WRONG_NAME 42000
+ eng "Incorrect routine name '%-.64s'"
+ER_TABLE_NEEDS_UPGRADE
+ eng "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" to fix it!"
+ER_SP_NO_AGGREGATE 42000
+ eng "AGGREGATE is not supported for stored functions"
+ER_MAX_PREPARED_STMT_COUNT_REACHED 42000
+ eng "Can't create more than max_prepared_stmt_count statements (current value: %lu)"
+ER_VIEW_RECURSIVE
+ eng "`%-.64s`.`%-.64s` contains view recursion"
+ER_NON_GROUPING_FIELD_USED 42000
+ eng "non-grouping field '%-.64s' is used in %-.64s clause"
+ER_TABLE_CANT_HANDLE_SPKEYS
+ eng "The used table type doesn't support SPATIAL indexes"
+ER_ILLEGAL_HA_CREATE_OPTION
+ eng "Table storage engine '%-.64s' does not support the create option '%.64s'"
ER_PARTITION_REQUIRES_VALUES_ERROR
eng "%-.64s PARTITIONING requires definition of VALUES %-.64s for each partition"
@@ -5798,32 +5814,16 @@ ER_EVENT_DATA_TOO_LONG
ER_DROP_INDEX_FK
eng "Cannot drop index '%-.64s': needed in a foreign key constraint"
+ER_WARN_DEPRECATED_SYNTAX
+ eng "The syntax '%s' is deprecated and will be removed in MySQL %s. Please use %s instead."
ER_CANT_WRITE_LOCK_LOG_TABLE
eng "You can't write-lock a log table. Only read access is possible."
ER_CANT_READ_LOCK_LOG_TABLE
eng "You can't use usual read lock with log tables. Try READ LOCAL instead."
-ER_SP_WRONG_NAME 42000
- eng "Incorrect routine name '%-.64s'"
ER_FOREIGN_DUPLICATE_KEY 23000 S1009
eng "Upholding foreign key constraints for table '%.64s', entry '%-.64s', key %d would lead to a duplicate entry"
ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use scripts/mysql_fix_privilege_tables"
-ER_TABLE_NEEDS_UPGRADE
- eng "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" to fix it!"
-ER_ILLEGAL_HA_CREATE_OPTION
- eng "Table storage engine '%-.64s' does not support the create option '%.64s'"
-ER_CANT_CHANGE_TX_ISOLATION 25001
- eng "Transaction isolation level can't be changed while a transaction is in progress"
-ER_WARN_DEPRECATED
- eng "The syntax '%s' is deprecated and will be removed in MySQL %s. Please use %s instead."
-ER_SP_NO_AGGREGATE 42000
- eng "AGGREGATE is not supported for stored functions"
-ER_MAX_PREPARED_STMT_COUNT_REACHED 42000
- eng "Can't create more than max_prepared_stmt_count statements (current value: %lu)"
-ER_VIEW_RECURSIVE
- eng "`%-.64s`.`%-.64s` contains view recursion"
-ER_NON_GROUPING_FIELD_USED 42000
- eng "non-grouping field '%-.64s' is used in %-.64s clause"
ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
eng "Cannot switch out of the row-based binary log format when the session has open temporary tables"
ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT
@@ -5832,6 +5832,9 @@ ER_NDB_CANT_SWITCH_BINLOG_FORMAT
eng "The NDB cluster engine does not support changing the binlog format on the fly yet"
ER_PARTITION_NO_TEMPORARY
eng "Cannot create temporary table with partitions"
+ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+ eng "This partition function is not allowed"
ER_DDL_LOG_ERROR
eng "Error in DDL log"
ER_NULL_IN_VALUES_LESS_THAN
@@ -5840,3 +5843,14 @@ ER_NULL_IN_VALUES_LESS_THAN
ER_WRONG_PARTITION_NAME
eng "Incorrect partition name"
swe "Felaktigt partitionsnamn"
+ER_CANT_CHANGE_TX_ISOLATION 25001
+ eng "Transaction isolation level can't be changed while a transaction is in progress"
+ER_DUP_ENTRY_AUTOINCREMENT_CASE
+ eng "ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.64s' for key '%-.64s'"
+ER_EVENT_MODIFY_QUEUE_ERROR
+ eng "Internal scheduler error %d"
+ER_EVENT_SET_VAR_ERROR
+ eng "Error during starting/stopping of the scheduler. Error code %u"
+ER_PARTITION_MERGE_ERROR
+ eng "MyISAM Merge handler cannot be used in partitioned tables"
--- 1.7/mysql-test/r/trigger-grant.result 2006-04-26 22:41:21 -04:00
+++ 1.9/mysql-test/r/trigger-grant.result 2006-06-01 22:17:33 -04:00
@@ -364,3 +364,87 @@ SELECT @mysqltest_var;
Hello, world!
DROP USER mysqltest_u1@localhost;
DROP DATABASE mysqltest_db1;
+DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%';
+DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%';
+DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%';
+DELETE FROM mysql.columns_priv WHERE User LIKE 'mysqltest_%';
+FLUSH PRIVILEGES;
+DROP DATABASE IF EXISTS mysqltest_db1;
+CREATE DATABASE mysqltest_db1;
+USE mysqltest_db1;
+CREATE TABLE t1 (i1 INT);
+CREATE TABLE t2 (i1 INT);
+CREATE USER mysqltest_dfn@localhost;
+CREATE USER mysqltest_inv@localhost;
+GRANT EXECUTE, CREATE ROUTINE, TRIGGER ON *.* TO mysqltest_dfn@localhost;
+GRANT INSERT ON mysqltest_db1.* TO mysqltest_inv@localhost;
+CREATE PROCEDURE p1(OUT i INT) DETERMINISTIC NO SQL SET i = 3;
+CREATE PROCEDURE p2(INOUT i INT) DETERMINISTIC NO SQL SET i = i * 5;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+CALL p1(NEW.i1);
+CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
+CALL p2(NEW.i1);
+INSERT INTO t1 VALUES (7);
+ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't1'
+INSERT INTO t2 VALUES (11);
+ERROR 42000: SELECT,UPDATE command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't2'
+DROP TRIGGER t2_bi;
+DROP TRIGGER t1_bi;
+GRANT SELECT ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+CALL p1(NEW.i1);
+CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
+CALL p2(NEW.i1);
+INSERT INTO t1 VALUES (13);
+ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't1'
+INSERT INTO t2 VALUES (17);
+ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't2'
+REVOKE SELECT ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+DROP TRIGGER t2_bi;
+DROP TRIGGER t1_bi;
+GRANT UPDATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+CALL p1(NEW.i1);
+CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
+CALL p2(NEW.i1);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t2 VALUES (23);
+ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't2'
+REVOKE UPDATE ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+DROP TRIGGER t2_bi;
+DROP TRIGGER t1_bi;
+GRANT SELECT, UPDATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+CALL p1(NEW.i1);
+CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
+CALL p2(NEW.i1);
+INSERT INTO t1 VALUES (29);
+INSERT INTO t2 VALUES (31);
+REVOKE SELECT, UPDATE ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+DROP TRIGGER t2_bi;
+DROP TRIGGER t1_bi;
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+GRANT UPDATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+CREATE PROCEDURE p1(OUT i INT) DETERMINISTIC NO SQL SET i = 37;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+CALL p1(NEW.i1);
+INSERT INTO t1 VALUES (41);
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(IN i INT) DETERMINISTIC NO SQL SET @v1 = i + 43;
+INSERT INTO t1 VALUES (47);
+ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't1'
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(INOUT i INT) DETERMINISTIC NO SQL SET i = i + 51;
+INSERT INTO t1 VALUES (53);
+ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't1'
+DROP PROCEDURE p1;
+REVOKE UPDATE ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+DROP TRIGGER t1_bi;
+DROP USER mysqltest_inv@localhost;
+DROP USER mysqltest_dfn@localhost;
+DROP TABLE t2;
+DROP TABLE t1;
+DROP DATABASE mysqltest_db1;
+USE test;
+End of 5.0 tests.
--- 1.10/mysql-test/t/trigger-grant.test 2006-04-27 01:51:39 -04:00
+++ 1.11/mysql-test/t/trigger-grant.test 2006-06-01 22:17:33 -04:00
@@ -690,3 +690,176 @@ SELECT @mysqltest_var;
DROP USER mysqltest_u1@localhost;
DROP DATABASE mysqltest_db1;
+
+
+#
+# Test for bug #14635 Accept NEW.x as INOUT parameters to stored
+# procedures from within triggers
+#
+# We require UPDATE privilege when NEW.x passed as OUT parameter, and
+# SELECT and UPDATE when NEW.x passed as INOUT parameter.
+#
+DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%';
+DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%';
+DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%';
+DELETE FROM mysql.columns_priv WHERE User LIKE 'mysqltest_%';
+FLUSH PRIVILEGES;
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest_db1;
+--enable_warnings
+
+CREATE DATABASE mysqltest_db1;
+USE mysqltest_db1;
+
+CREATE TABLE t1 (i1 INT);
+CREATE TABLE t2 (i1 INT);
+
+CREATE USER mysqltest_dfn@localhost;
+CREATE USER mysqltest_inv@localhost;
+
+GRANT EXECUTE, CREATE ROUTINE, TRIGGER ON *.* TO mysqltest_dfn@localhost;
+GRANT INSERT ON mysqltest_db1.* TO mysqltest_inv@localhost;
+
+connect (definer,localhost,mysqltest_dfn,,mysqltest_db1);
+connect (invoker,localhost,mysqltest_inv,,mysqltest_db1);
+
+connection definer;
+CREATE PROCEDURE p1(OUT i INT) DETERMINISTIC NO SQL SET i = 3;
+CREATE PROCEDURE p2(INOUT i INT) DETERMINISTIC NO SQL SET i = i * 5;
+
+# Check that having no privilege won't work.
+connection definer;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ CALL p1(NEW.i1);
+CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
+ CALL p2(NEW.i1);
+
+connection invoker;
+--error ER_COLUMNACCESS_DENIED_ERROR
+INSERT INTO t1 VALUES (7);
+--error ER_COLUMNACCESS_DENIED_ERROR
+INSERT INTO t2 VALUES (11);
+
+connection definer;
+DROP TRIGGER t2_bi;
+DROP TRIGGER t1_bi;
+
+# Check that having only SELECT privilege is not enough.
+connection default;
+GRANT SELECT ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+
+connection definer;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ CALL p1(NEW.i1);
+CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
+ CALL p2(NEW.i1);
+
+connection invoker;
+--error ER_COLUMNACCESS_DENIED_ERROR
+INSERT INTO t1 VALUES (13);
+--error ER_COLUMNACCESS_DENIED_ERROR
+INSERT INTO t2 VALUES (17);
+
+connection default;
+REVOKE SELECT ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+
+connection definer;
+DROP TRIGGER t2_bi;
+DROP TRIGGER t1_bi;
+
+# Check that having only UPDATE privilege is enough for OUT parameter,
+# but not for INOUT parameter.
+connection default;
+GRANT UPDATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+
+connection definer;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ CALL p1(NEW.i1);
+CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
+ CALL p2(NEW.i1);
+
+connection invoker;
+INSERT INTO t1 VALUES (19);
+--error ER_COLUMNACCESS_DENIED_ERROR
+INSERT INTO t2 VALUES (23);
+
+connection default;
+REVOKE UPDATE ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+
+connection definer;
+DROP TRIGGER t2_bi;
+DROP TRIGGER t1_bi;
+
+# Check that having SELECT and UPDATE privileges is enough.
+connection default;
+GRANT SELECT, UPDATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+
+connection definer;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ CALL p1(NEW.i1);
+CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
+ CALL p2(NEW.i1);
+
+connection invoker;
+INSERT INTO t1 VALUES (29);
+INSERT INTO t2 VALUES (31);
+
+connection default;
+REVOKE SELECT, UPDATE ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+
+connection definer;
+DROP TRIGGER t2_bi;
+DROP TRIGGER t1_bi;
+
+connection default;
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+
+# Check that late procedure redefining won't open a security hole.
+connection default;
+GRANT UPDATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+
+connection definer;
+CREATE PROCEDURE p1(OUT i INT) DETERMINISTIC NO SQL SET i = 37;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ CALL p1(NEW.i1);
+
+connection invoker;
+INSERT INTO t1 VALUES (41);
+
+connection definer;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(IN i INT) DETERMINISTIC NO SQL SET @v1 = i + 43;
+
+connection invoker;
+--error ER_COLUMNACCESS_DENIED_ERROR
+INSERT INTO t1 VALUES (47);
+
+connection definer;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(INOUT i INT) DETERMINISTIC NO SQL SET i = i + 51;
+
+connection invoker;
+--error ER_COLUMNACCESS_DENIED_ERROR
+INSERT INTO t1 VALUES (53);
+
+connection default;
+DROP PROCEDURE p1;
+REVOKE UPDATE ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+
+connection definer;
+DROP TRIGGER t1_bi;
+
+# Cleanup.
+disconnect definer;
+disconnect invoker;
+connection default;
+DROP USER mysqltest_inv@localhost;
+DROP USER mysqltest_dfn@localhost;
+DROP TABLE t2;
+DROP TABLE t1;
+DROP DATABASE mysqltest_db1;
+USE test;
+
+--echo End of 5.0 tests.
--- 1.53/sql/sql_trigger.cc 2006-04-27 01:51:40 -04:00
+++ 1.54/sql/sql_trigger.cc 2006-06-01 22:17:34 -04:00
@@ -1412,8 +1412,8 @@ bool Table_triggers_list::change_table_n
}
if (table.triggers)
{
- LEX_STRING_WITH_INIT old_table_name(old_table, strlen(old_table));
- LEX_STRING_WITH_INIT new_table_name(new_table, strlen(new_table));
+ LEX_STRING old_table_name= { (char *) old_table, strlen(old_table) };
+ LEX_STRING new_table_name= { (char *) new_table, strlen(new_table) };
/*
Since triggers should be in the same schema as their subject tables
moving table with them between two schemas raises too many questions.
--- 1.33/mysql-test/lib/mtr_process.pl 2006-05-02 15:58:56 -04:00
+++ 1.34/mysql-test/lib/mtr_process.pl 2006-06-01 22:16:40 -04:00
@@ -20,6 +20,7 @@ sub mtr_record_dead_children ();
sub mtr_exit ($);
sub sleep_until_file_created ($$$);
sub mtr_kill_processes ($);
+sub mtr_kill_process ($$$$);
# static in C
sub spawn_impl ($$$$$$$$);
@@ -872,6 +873,25 @@ sub mtr_kill_processes ($) {
mtr_debug("Sleep 2 second waiting for processes to die");
sleep(2);
}
+ }
+}
+
+
+sub mtr_kill_process ($$$$) {
+ my $pid= shift;
+ my $signal= shift;
+ my $retries= shift;
+ my $timeout= shift;
+
+ while (1)
+ {
+ kill($signal, $pid);
+
+ last unless kill (0, $pid) and $retries--;
+
+ mtr_debug("Sleep $timeout second waiting for processes to die");
+
+ sleep($timeout);
}
}
--- 1.168/mysql-test/r/innodb.result 2006-04-27 01:51:39 -04:00
+++ 1.169/mysql-test/r/innodb.result 2006-06-01 22:16:40 -04:00
@@ -1822,7 +1822,7 @@ Variable_name Value
innodb_sync_spin_loops 20
show variables like "innodb_thread_concurrency";
Variable_name Value
-innodb_thread_concurrency 20
+innodb_thread_concurrency 8
set global innodb_thread_concurrency=1001;
show variables like "innodb_thread_concurrency";
Variable_name Value
@@ -3455,3 +3455,12 @@ SELECT p0.a FROM t2 p0 WHERE BINARY p0.b
a
1
drop table t2, t1;
+create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
+ERROR HY000: The used table type doesn't support SPATIAL indexes
+CREATE TABLE t1 ( a int ) ENGINE=innodb;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+DROP TABLE t1;
--- 1.134/mysql-test/t/innodb.test 2006-04-27 01:51:39 -04:00
+++ 1.135/mysql-test/t/innodb.test 2006-06-01 22:17:33 -04:00
@@ -2494,3 +2494,19 @@ SELECT DISTINCT p0.a FROM t2 p0 WHERE BI
SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
drop table t2, t1;
+
+#
+# Bug #15680 (SPATIAL key in innodb)
+#
+--error ER_TABLE_CANT_HANDLE_SPKEYS
+create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
+
+#
+# Test optimize on table with open transaction
+#
+
+CREATE TABLE t1 ( a int ) ENGINE=innodb;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
--- 1.263/sql/ha_innodb.cc 2006-05-02 15:58:57 -04:00
+++ 1.264/sql/ha_innodb.cc 2006-06-01 22:17:33 -04:00
@@ -204,44 +204,9 @@ static int innobase_savepoint(THD* thd,
static int innobase_release_savepoint(THD* thd, void *savepoint);
static handler *innobase_create_handler(TABLE_SHARE *table);
-handlerton innobase_hton = {
- MYSQL_HANDLERTON_INTERFACE_VERSION,
- "InnoDB",
- SHOW_OPTION_YES,
- "Supports transactions, row-level locking, and foreign keys",
- DB_TYPE_INNODB,
- innobase_init,
- 0, /* slot */
- sizeof(trx_named_savept_t), /* savepoint size. TODO: use it */
- innobase_close_connection,
- innobase_savepoint,
- innobase_rollback_to_savepoint,
- innobase_release_savepoint,
- innobase_commit, /* commit */
- innobase_rollback, /* rollback */
- innobase_xa_prepare, /* prepare */
- innobase_xa_recover, /* recover */
- innobase_commit_by_xid, /* commit_by_xid */
- innobase_rollback_by_xid, /* rollback_by_xid */
- innobase_create_cursor_view,
- innobase_set_cursor_view,
- innobase_close_cursor_view,
- innobase_create_handler, /* Create a new handler */
- innobase_drop_database, /* Drop a database */
- innobase_end, /* Panic call */
- innobase_start_trx_and_assign_read_view, /* Start Consistent Snapshot */
- innobase_flush_logs, /* Flush logs */
- innobase_show_status, /* Show status */
- NULL, /* Partition flags */
- NULL, /* Alter table flags */
- NULL, /* alter_tablespace */
- NULL, /* Fill FILES table */
- HTON_NO_FLAGS,
- NULL, /* binlog_func */
- NULL, /* binlog_log_query */
- innobase_release_temporary_latches
-};
+static const char innobase_hton_name[]= "InnoDB";
+handlerton innobase_hton;
static handler *innobase_create_handler(TABLE_SHARE *table)
{
@@ -1225,10 +1190,9 @@ ha_innobase::init_table_handle_for_HANDL
/*************************************************************************
Opens an InnoDB database. */
-bool
+int
innobase_init(void)
/*===============*/
- /* out: &innobase_hton, or NULL on error */
{
static char current_dir[3]; /* Set if using current lib */
int err;
@@ -1237,8 +1201,33 @@ innobase_init(void)
DBUG_ENTER("innobase_init");
+ innobase_hton.state=have_innodb;
+ innobase_hton.db_type= DB_TYPE_INNODB;
+ innobase_hton.savepoint_offset=sizeof(trx_named_savept_t);
+ innobase_hton.close_connection=innobase_close_connection;
+ innobase_hton.savepoint_set=innobase_savepoint;
+ innobase_hton.savepoint_rollback=innobase_rollback_to_savepoint;
+ innobase_hton.savepoint_release=innobase_release_savepoint;
+ innobase_hton.commit=innobase_commit;
+ innobase_hton.rollback=innobase_rollback;
+ innobase_hton.prepare=innobase_xa_prepare;
+ innobase_hton.recover=innobase_xa_recover;
+ innobase_hton.commit_by_xid=innobase_commit_by_xid;
+ innobase_hton.rollback_by_xid=innobase_rollback_by_xid;
+ innobase_hton.create_cursor_read_view=innobase_create_cursor_view;
+ innobase_hton.set_cursor_read_view=innobase_set_cursor_view;
+ innobase_hton.close_cursor_read_view=innobase_close_cursor_view;
+ innobase_hton.create=innobase_create_handler;
+ innobase_hton.drop_database=innobase_drop_database;
+ innobase_hton.panic=innobase_end;
+ innobase_hton.start_consistent_snapshot=innobase_start_trx_and_assign_read_view;
+ innobase_hton.flush_logs=innobase_flush_logs;
+ innobase_hton.show_status=innobase_show_status;
+ innobase_hton.flags=HTON_NO_FLAGS;
+ innobase_hton.release_temporary_latches=innobase_release_temporary_latches;
+
if (have_innodb != SHOW_OPTION_YES)
- goto error;
+ DBUG_RETURN(0); // nothing else to do
ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
@@ -6468,7 +6457,7 @@ innodb_show_status(
bool result = FALSE;
- if (stat_print(thd, innobase_hton.name, strlen(innobase_hton.name),
+ if (stat_print(thd, innobase_hton_name, strlen(innobase_hton_name),
STRING_WITH_LEN(""), str, flen)) {
result= TRUE;
}
@@ -6495,7 +6484,7 @@ innodb_mutex_show_status(
ulint rw_lock_count_os_wait= 0;
ulint rw_lock_count_os_yield= 0;
ulonglong rw_lock_wait_time= 0;
- uint hton_name_len= strlen(innobase_hton.name), buf1len, buf2len;
+ uint hton_name_len= strlen(innobase_hton_name), buf1len, buf2len;
DBUG_ENTER("innodb_mutex_show_status");
#ifdef MUTEX_PROTECT_TO_BE_ADDED_LATER
@@ -6522,7 +6511,7 @@ innodb_mutex_show_status(
mutex->count_os_yield,
mutex->lspent_time/1000);
- if (stat_print(thd, innobase_hton.name,
+ if (stat_print(thd, innobase_hton_name,
hton_name_len, buf1, buf1len,
buf2, buf2len)) {
#ifdef MUTEX_PROTECT_TO_BE_ADDED_LATER
@@ -6552,7 +6541,7 @@ innodb_mutex_show_status(
rw_lock_count_os_wait, rw_lock_count_os_yield,
rw_lock_wait_time/1000);
- if (stat_print(thd, innobase_hton.name, hton_name_len,
+ if (stat_print(thd, innobase_hton_name, hton_name_len,
STRING_WITH_LEN("rw_lock_mutexes"), buf2, buf2len)) {
DBUG_RETURN(1);
}
@@ -7453,3 +7442,21 @@ bool ha_innobase::check_if_incompatible_
return COMPATIBLE_DATA_YES;
}
+
+struct st_mysql_storage_engine innobase_storage_engine=
+{ MYSQL_HANDLERTON_INTERFACE_VERSION, &innobase_hton};
+
+mysql_declare_plugin(innobase)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &innobase_storage_engine,
+ innobase_hton_name,
+ "Innobase OY",
+ "Supports transactions, row-level locking, and foreign keys",
+ innobase_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ 0
+}
+mysql_declare_plugin_end;
+
| Thread |
|---|
| • bk commit into 5.2 tree (elliot:1.2175) | Elliot Murphy | 2 Jun |