Merge mysql.com:/M51/mysql-5.1 into mysql.com:/M51/clone-5.1
This commit is contained in:
commit
3a7d81258c
145
.bzrignore
145
.bzrignore
@ -1,21 +1,39 @@
|
|||||||
*.a
|
*.a
|
||||||
*.bb
|
*.bb
|
||||||
*.bbg
|
*.bbg
|
||||||
|
*.bin
|
||||||
*.core
|
*.core
|
||||||
*.d
|
*.d
|
||||||
*.da
|
*.da
|
||||||
|
*.exe
|
||||||
*.gcov
|
*.gcov
|
||||||
|
*.idb
|
||||||
*.la
|
*.la
|
||||||
|
*.lib
|
||||||
*.lo
|
*.lo
|
||||||
|
*.map
|
||||||
*.o
|
*.o
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
*.reject
|
*.reject
|
||||||
|
*.res
|
||||||
|
*.sbr
|
||||||
*.so
|
*.so
|
||||||
*.spec
|
*.spec
|
||||||
*/*_pure_*warnings
|
*/*_pure_*warnings
|
||||||
*/.pure
|
*/.pure
|
||||||
*~
|
*~
|
||||||
.*.swp
|
.*.swp
|
||||||
|
./README.build-files
|
||||||
./config.h
|
./config.h
|
||||||
|
./copy_mysql_files.bat
|
||||||
|
./fix-project-files
|
||||||
|
./mysql*.ds?
|
||||||
|
./mysql.ncb
|
||||||
|
./mysql.sln
|
||||||
|
./mysql.suo
|
||||||
|
./prepare
|
||||||
.defs.mk
|
.defs.mk
|
||||||
.depend
|
.depend
|
||||||
.depend.mk
|
.depend.mk
|
||||||
@ -115,6 +133,8 @@ autom4te.cache/*
|
|||||||
autom4te.cache/output.0
|
autom4te.cache/output.0
|
||||||
autom4te.cache/requests
|
autom4te.cache/requests
|
||||||
autom4te.cache/traces.0
|
autom4te.cache/traces.0
|
||||||
|
bdb/*.ds?
|
||||||
|
bdb/*.vcproj
|
||||||
bdb/README
|
bdb/README
|
||||||
bdb/btree/btree_auto.c
|
bdb/btree/btree_auto.c
|
||||||
bdb/build_unix/*
|
bdb/build_unix/*
|
||||||
@ -256,6 +276,9 @@ bkpush.log
|
|||||||
bkpush.log*
|
bkpush.log*
|
||||||
build.log
|
build.log
|
||||||
build_tags.sh
|
build_tags.sh
|
||||||
|
client/*.ds?
|
||||||
|
client/*.vcproj
|
||||||
|
client/completion_hash.cpp
|
||||||
client/decimal.c
|
client/decimal.c
|
||||||
client/insert_test
|
client/insert_test
|
||||||
client/log_event.cc
|
client/log_event.cc
|
||||||
@ -265,9 +288,12 @@ client/mf_iocache.cc
|
|||||||
client/my_decimal.cc
|
client/my_decimal.cc
|
||||||
client/my_decimal.h
|
client/my_decimal.h
|
||||||
client/mysql
|
client/mysql
|
||||||
|
client/mysql.cpp
|
||||||
client/mysqladmin
|
client/mysqladmin
|
||||||
client/mysqladmin.c
|
client/mysqladmin.c
|
||||||
|
client/mysqladmin.cpp
|
||||||
client/mysqlbinlog
|
client/mysqlbinlog
|
||||||
|
client/mysqlbinlog.cpp
|
||||||
client/mysqlcheck
|
client/mysqlcheck
|
||||||
client/mysqldump
|
client/mysqldump
|
||||||
client/mysqlimport
|
client/mysqlimport
|
||||||
@ -278,14 +304,20 @@ client/mysqltest
|
|||||||
client/mysqltestmanager-pwgen
|
client/mysqltestmanager-pwgen
|
||||||
client/mysqltestmanagerc
|
client/mysqltestmanagerc
|
||||||
client/mysys_priv.h
|
client/mysys_priv.h
|
||||||
|
client/readline.cpp
|
||||||
client/select_test
|
client/select_test
|
||||||
|
client/sql_string.cpp
|
||||||
client/ssl_test
|
client/ssl_test
|
||||||
client/thimble
|
client/thimble
|
||||||
client/thread_test
|
client/thread_test
|
||||||
|
client_debug/*
|
||||||
|
client_release/*
|
||||||
client_test
|
client_test
|
||||||
cmd-line-utils/libedit/common.h
|
cmd-line-utils/libedit/common.h
|
||||||
cmd-line-utils/libedit/makelist
|
cmd-line-utils/libedit/makelist
|
||||||
comon.h
|
comon.h
|
||||||
|
comp_err/*.ds?
|
||||||
|
comp_err/*.vcproj
|
||||||
config.cache
|
config.cache
|
||||||
config.guess
|
config.guess
|
||||||
config.h
|
config.h
|
||||||
@ -295,10 +327,14 @@ config.status
|
|||||||
config.sub
|
config.sub
|
||||||
configure
|
configure
|
||||||
configure.lineno
|
configure.lineno
|
||||||
|
contrib/*.ds?
|
||||||
|
contrib/*.vcproj
|
||||||
core
|
core
|
||||||
core.*
|
core.*
|
||||||
core.2430
|
core.2430
|
||||||
db-*.*.*
|
db-*.*.*
|
||||||
|
dbug/*.ds?
|
||||||
|
dbug/*.vcproj
|
||||||
dbug/dbug_analyze
|
dbug/dbug_analyze
|
||||||
dbug/example*.r
|
dbug/example*.r
|
||||||
dbug/factorial
|
dbug/factorial
|
||||||
@ -309,6 +345,9 @@ dbug/user.ps
|
|||||||
dbug/user.t
|
dbug/user.t
|
||||||
depcomp
|
depcomp
|
||||||
emacs.h
|
emacs.h
|
||||||
|
examples/*.ds?
|
||||||
|
examples/*.vcproj
|
||||||
|
examples/udf_example/udf_example.def
|
||||||
extra/charset2html
|
extra/charset2html
|
||||||
extra/comp_err
|
extra/comp_err
|
||||||
extra/created_include_files
|
extra/created_include_files
|
||||||
@ -330,6 +369,8 @@ fcns.h
|
|||||||
gdbinit
|
gdbinit
|
||||||
gmon.out
|
gmon.out
|
||||||
hardcopy.0
|
hardcopy.0
|
||||||
|
heap/*.ds?
|
||||||
|
heap/*.vcproj
|
||||||
heap/hp_test1
|
heap/hp_test1
|
||||||
heap/hp_test2
|
heap/hp_test2
|
||||||
help
|
help
|
||||||
@ -345,6 +386,8 @@ include/readline/*.h
|
|||||||
include/readline/readline.h
|
include/readline/readline.h
|
||||||
include/sql_state.h
|
include/sql_state.h
|
||||||
include/widec.h
|
include/widec.h
|
||||||
|
innobase/*.ds?
|
||||||
|
innobase/*.vcproj
|
||||||
innobase/autom4te-2.53.cache/*
|
innobase/autom4te-2.53.cache/*
|
||||||
innobase/autom4te-2.53.cache/output.0
|
innobase/autom4te-2.53.cache/output.0
|
||||||
innobase/autom4te-2.53.cache/requests
|
innobase/autom4te-2.53.cache/requests
|
||||||
@ -363,18 +406,28 @@ innobase/stamp-h1
|
|||||||
insert_test
|
insert_test
|
||||||
install
|
install
|
||||||
install-sh
|
install-sh
|
||||||
|
isam/*.ds?
|
||||||
|
isam/*.vcproj
|
||||||
isam/isamchk
|
isam/isamchk
|
||||||
isam/isamlog
|
isam/isamlog
|
||||||
isam/pack_isam
|
isam/pack_isam
|
||||||
isam/test1
|
isam/test1
|
||||||
isam/test2
|
isam/test2
|
||||||
isam/test3
|
isam/test3
|
||||||
|
isamchk/*.ds?
|
||||||
|
isamchk/*.vcproj
|
||||||
|
lib_debug/*
|
||||||
|
lib_release/*
|
||||||
libmysql/*.c
|
libmysql/*.c
|
||||||
|
libmysql/*.ds?
|
||||||
|
libmysql/*.vcproj
|
||||||
libmysql/conf_to_src
|
libmysql/conf_to_src
|
||||||
|
libmysql/debug/libmysql.exp
|
||||||
libmysql/my_static.h
|
libmysql/my_static.h
|
||||||
libmysql/my_time.c
|
libmysql/my_time.c
|
||||||
libmysql/mysys_priv.h
|
libmysql/mysys_priv.h
|
||||||
libmysql/net.c
|
libmysql/net.c
|
||||||
|
libmysql/release/libmysql.exp
|
||||||
libmysql/vio_priv.h
|
libmysql/vio_priv.h
|
||||||
libmysql_r/*.c
|
libmysql_r/*.c
|
||||||
libmysql_r/acconfig.h
|
libmysql_r/acconfig.h
|
||||||
@ -382,12 +435,15 @@ libmysql_r/conf_to_src
|
|||||||
libmysql_r/my_static.h
|
libmysql_r/my_static.h
|
||||||
libmysql_r/mysys_priv.h
|
libmysql_r/mysys_priv.h
|
||||||
libmysql_r/vio_priv.h
|
libmysql_r/vio_priv.h
|
||||||
|
libmysqld/*.ds?
|
||||||
|
libmysqld/*.vcproj
|
||||||
libmysqld/backup_dir
|
libmysqld/backup_dir
|
||||||
libmysqld/client.c
|
libmysqld/client.c
|
||||||
libmysqld/client_settings.h
|
libmysqld/client_settings.h
|
||||||
libmysqld/convert.cc
|
libmysqld/convert.cc
|
||||||
libmysqld/derror.cc
|
libmysqld/derror.cc
|
||||||
libmysqld/discover.cc
|
libmysqld/discover.cc
|
||||||
|
libmysqld/emb_qcache.cpp
|
||||||
libmysqld/errmsg.c
|
libmysqld/errmsg.c
|
||||||
libmysqld/examples/client_test.c
|
libmysqld/examples/client_test.c
|
||||||
libmysqld/examples/client_test.cc
|
libmysqld/examples/client_test.cc
|
||||||
@ -443,6 +499,7 @@ libmysqld/item_sum.cc
|
|||||||
libmysqld/item_timefunc.cc
|
libmysqld/item_timefunc.cc
|
||||||
libmysqld/item_uniq.cc
|
libmysqld/item_uniq.cc
|
||||||
libmysqld/key.cc
|
libmysqld/key.cc
|
||||||
|
libmysqld/lib_sql.cpp
|
||||||
libmysqld/libmysql.c
|
libmysqld/libmysql.c
|
||||||
libmysqld/lock.cc
|
libmysqld/lock.cc
|
||||||
libmysqld/log.cc
|
libmysqld/log.cc
|
||||||
@ -500,6 +557,7 @@ libmysqld/sql_map.cc
|
|||||||
libmysqld/sql_olap.cc
|
libmysqld/sql_olap.cc
|
||||||
libmysqld/sql_parse.cc
|
libmysqld/sql_parse.cc
|
||||||
libmysqld/sql_partition.cc
|
libmysqld/sql_partition.cc
|
||||||
|
libmysqld/sql_plugin.cc
|
||||||
libmysqld/sql_prepare.cc
|
libmysqld/sql_prepare.cc
|
||||||
libmysqld/sql_rename.cc
|
libmysqld/sql_rename.cc
|
||||||
libmysqld/sql_repl.cc
|
libmysqld/sql_repl.cc
|
||||||
@ -516,6 +574,8 @@ libmysqld/sql_unions.cc
|
|||||||
libmysqld/sql_update.cc
|
libmysqld/sql_update.cc
|
||||||
libmysqld/sql_view.cc
|
libmysqld/sql_view.cc
|
||||||
libmysqld/sql_yacc.cc
|
libmysqld/sql_yacc.cc
|
||||||
|
libmysqld/sql_yacc.cpp
|
||||||
|
libmysqld/sql_yacc.h
|
||||||
libmysqld/stacktrace.c
|
libmysqld/stacktrace.c
|
||||||
libmysqld/strfunc.cc
|
libmysqld/strfunc.cc
|
||||||
libmysqld/table.cc
|
libmysqld/table.cc
|
||||||
@ -524,6 +584,9 @@ libmysqld/time.cc
|
|||||||
libmysqld/tztime.cc
|
libmysqld/tztime.cc
|
||||||
libmysqld/uniques.cc
|
libmysqld/uniques.cc
|
||||||
libmysqld/unireg.cc
|
libmysqld/unireg.cc
|
||||||
|
libmysqltest/*.ds?
|
||||||
|
libmysqltest/*.vcproj
|
||||||
|
libmysqltest/mytest.c
|
||||||
libtool
|
libtool
|
||||||
linked_client_sources
|
linked_client_sources
|
||||||
linked_include_sources
|
linked_include_sources
|
||||||
@ -536,6 +599,8 @@ linked_tools_sources
|
|||||||
locked
|
locked
|
||||||
ltmain.sh
|
ltmain.sh
|
||||||
man/*.1
|
man/*.1
|
||||||
|
merge/*.ds?
|
||||||
|
merge/*.vcproj
|
||||||
missing
|
missing
|
||||||
mit-pthreads/config.flags
|
mit-pthreads/config.flags
|
||||||
mit-pthreads/include/bits
|
mit-pthreads/include/bits
|
||||||
@ -547,6 +612,10 @@ mit-pthreads/pg++
|
|||||||
mit-pthreads/pgcc
|
mit-pthreads/pgcc
|
||||||
mit-pthreads/syscall.S
|
mit-pthreads/syscall.S
|
||||||
mkinstalldirs
|
mkinstalldirs
|
||||||
|
my_print_defaults/*.ds?
|
||||||
|
my_print_defaults/*.vcproj
|
||||||
|
myisam/*.ds?
|
||||||
|
myisam/*.vcproj
|
||||||
myisam/FT1.MYD
|
myisam/FT1.MYD
|
||||||
myisam/FT1.MYI
|
myisam/FT1.MYI
|
||||||
myisam/ft_dump
|
myisam/ft_dump
|
||||||
@ -572,17 +641,31 @@ myisam/test1.MYD
|
|||||||
myisam/test1.MYI
|
myisam/test1.MYI
|
||||||
myisam/test2.MYD
|
myisam/test2.MYD
|
||||||
myisam/test2.MYI
|
myisam/test2.MYI
|
||||||
|
myisam_ftdump/*.ds?
|
||||||
|
myisam_ftdump/*.vcproj
|
||||||
|
myisamchk/*.ds?
|
||||||
|
myisamchk/*.vcproj
|
||||||
|
myisamlog/*.ds?
|
||||||
|
myisamlog/*.vcproj
|
||||||
|
myisammrg/*.ds?
|
||||||
|
myisammrg/*.vcproj
|
||||||
|
myisampack/*.ds?
|
||||||
|
myisampack/*.vcproj
|
||||||
mysql-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
|
mysql-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
|
||||||
mysql-4.0.2-alpha.tar.gz
|
mysql-4.0.2-alpha.tar.gz
|
||||||
mysql-4.1.8-win-src.zip
|
mysql-4.1.8-win-src.zip
|
||||||
mysql-5.0.2-alpha.tar.gz
|
mysql-5.0.2-alpha.tar.gz
|
||||||
mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
|
mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
|
||||||
|
mysql-test/*.ds?
|
||||||
|
mysql-test/*.vcproj
|
||||||
mysql-test/gmon.out
|
mysql-test/gmon.out
|
||||||
mysql-test/install_test_db
|
mysql-test/install_test_db
|
||||||
mysql-test/mysql-test-run
|
mysql-test/mysql-test-run
|
||||||
mysql-test/mysql-test-run.log
|
mysql-test/mysql-test-run.log
|
||||||
mysql-test/mysql_test_run_new
|
mysql-test/mysql_test_run_new
|
||||||
mysql-test/ndb/ndbcluster
|
mysql-test/ndb/ndbcluster
|
||||||
|
mysql-test/r/*.err
|
||||||
|
mysql-test/r/*.out
|
||||||
mysql-test/r/*.reject
|
mysql-test/r/*.reject
|
||||||
mysql-test/r/alter_table.err
|
mysql-test/r/alter_table.err
|
||||||
mysql-test/r/archive.err
|
mysql-test/r/archive.err
|
||||||
@ -654,13 +737,25 @@ mysql-test/var/*
|
|||||||
mysql.kdevprj
|
mysql.kdevprj
|
||||||
mysql.proj
|
mysql.proj
|
||||||
mysql_priv.h
|
mysql_priv.h
|
||||||
|
mysqlbinlog/*.ds?
|
||||||
|
mysqlbinlog/*.vcproj
|
||||||
|
mysqlcheck/*.ds?
|
||||||
|
mysqlcheck/*.vcproj
|
||||||
mysqld.S
|
mysqld.S
|
||||||
mysqld.sym
|
mysqld.sym
|
||||||
|
mysqldemb/*.ds?
|
||||||
|
mysqldemb/*.vcproj
|
||||||
|
mysqlserver/*.ds?
|
||||||
|
mysqlserver/*.vcproj
|
||||||
mysys/#mf_iocache.c#
|
mysys/#mf_iocache.c#
|
||||||
|
mysys/*.ds?
|
||||||
|
mysys/*.vcproj
|
||||||
mysys/charset2html
|
mysys/charset2html
|
||||||
mysys/getopt.c
|
mysys/getopt.c
|
||||||
mysys/getopt1.c
|
mysys/getopt1.c
|
||||||
mysys/main.cc
|
mysys/main.cc
|
||||||
|
mysys/my_new.cpp
|
||||||
|
mysys/raid.cpp
|
||||||
mysys/ste5KbMa
|
mysys/ste5KbMa
|
||||||
mysys/test_charset
|
mysys/test_charset
|
||||||
mysys/test_dir
|
mysys/test_dir
|
||||||
@ -924,13 +1019,20 @@ ndbcluster-1186/ndb_3.pid
|
|||||||
ndbcluster-1186/ndb_3_cluster.log
|
ndbcluster-1186/ndb_3_cluster.log
|
||||||
ndbcluster-1186/ndb_3_out.log
|
ndbcluster-1186/ndb_3_out.log
|
||||||
ndbcluster-1186/ndbcluster.pid
|
ndbcluster-1186/ndbcluster.pid
|
||||||
|
pack_isam/*.ds?
|
||||||
|
perror/*.ds?
|
||||||
|
perror/*.vcproj
|
||||||
pull.log
|
pull.log
|
||||||
|
regex/*.ds?
|
||||||
|
regex/*.vcproj
|
||||||
regex/re
|
regex/re
|
||||||
repl-tests/test-repl-ts/repl-timestamp.master.reject
|
repl-tests/test-repl-ts/repl-timestamp.master.reject
|
||||||
repl-tests/test-repl/foo-dump-slave.master.
|
repl-tests/test-repl/foo-dump-slave.master.
|
||||||
repl-tests/test-repl/sum-wlen-slave.master.
|
repl-tests/test-repl/sum-wlen-slave.master.
|
||||||
repl-tests/test-repl/sum-wlen-slave.master.re
|
repl-tests/test-repl/sum-wlen-slave.master.re
|
||||||
repl-tests/test-repl/sum-wlen-slave.master.reje
|
repl-tests/test-repl/sum-wlen-slave.master.reje
|
||||||
|
replace/*.ds?
|
||||||
|
replace/*.vcproj
|
||||||
scripts/fill_func_tables
|
scripts/fill_func_tables
|
||||||
scripts/fill_func_tables.sql
|
scripts/fill_func_tables.sql
|
||||||
scripts/fill_help_tables
|
scripts/fill_help_tables
|
||||||
@ -961,11 +1063,31 @@ scripts/mysqlhotcopy
|
|||||||
scripts/mysqlhotcopy.sh.rej
|
scripts/mysqlhotcopy.sh.rej
|
||||||
scripts/safe_mysqld
|
scripts/safe_mysqld
|
||||||
select_test
|
select_test
|
||||||
|
server-tools/instance-manager/buffer.cpp
|
||||||
server-tools/instance-manager/client.c
|
server-tools/instance-manager/client.c
|
||||||
server-tools/instance-manager/client_settings.h
|
server-tools/instance-manager/client_settings.h
|
||||||
|
server-tools/instance-manager/command.cpp
|
||||||
|
server-tools/instance-manager/commands.cpp
|
||||||
server-tools/instance-manager/errmsg.c
|
server-tools/instance-manager/errmsg.c
|
||||||
|
server-tools/instance-manager/guardian.cpp
|
||||||
|
server-tools/instance-manager/instance.cpp
|
||||||
|
server-tools/instance-manager/instance_map.cpp
|
||||||
|
server-tools/instance-manager/instance_options.cpp
|
||||||
|
server-tools/instance-manager/listener.cpp
|
||||||
|
server-tools/instance-manager/log.cpp
|
||||||
|
server-tools/instance-manager/manager.cpp
|
||||||
|
server-tools/instance-manager/messages.cpp
|
||||||
|
server-tools/instance-manager/mysql_connection.cpp
|
||||||
server-tools/instance-manager/mysqlmanager
|
server-tools/instance-manager/mysqlmanager
|
||||||
|
server-tools/instance-manager/mysqlmanager.cpp
|
||||||
|
server-tools/instance-manager/options.cpp
|
||||||
|
server-tools/instance-manager/parse.cpp
|
||||||
|
server-tools/instance-manager/parse_output.cpp
|
||||||
|
server-tools/instance-manager/priv.cpp
|
||||||
|
server-tools/instance-manager/protocol.cpp
|
||||||
server-tools/instance-manager/thr_alarm.c
|
server-tools/instance-manager/thr_alarm.c
|
||||||
|
server-tools/instance-manager/thread_registry.cpp
|
||||||
|
server-tools/instance-manager/user_map.cpp
|
||||||
sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686
|
sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686
|
||||||
sql-bench/bench-count-distinct
|
sql-bench/bench-count-distinct
|
||||||
sql-bench/bench-init.pl
|
sql-bench/bench-init.pl
|
||||||
@ -994,12 +1116,19 @@ sql-bench/test-insert
|
|||||||
sql-bench/test-select
|
sql-bench/test-select
|
||||||
sql-bench/test-transactions
|
sql-bench/test-transactions
|
||||||
sql-bench/test-wisconsin
|
sql-bench/test-wisconsin
|
||||||
|
sql/*.cpp
|
||||||
|
sql/*.ds?
|
||||||
|
sql/*.vcproj
|
||||||
sql/.gdbinit
|
sql/.gdbinit
|
||||||
sql/client.c
|
sql/client.c
|
||||||
sql/gen_lex_hash
|
sql/gen_lex_hash
|
||||||
sql/gmon.out
|
sql/gmon.out
|
||||||
sql/handlerton.cc
|
sql/handlerton.cc
|
||||||
sql/lex_hash.h
|
sql/lex_hash.h
|
||||||
|
sql/max/*
|
||||||
|
sql/message.h
|
||||||
|
sql/message.mc
|
||||||
|
sql/message.rc
|
||||||
sql/mini_client_errors.c
|
sql/mini_client_errors.c
|
||||||
sql/my_time.c
|
sql/my_time.c
|
||||||
sql/mysql_tzinfo_to_sql
|
sql/mysql_tzinfo_to_sql
|
||||||
@ -1338,7 +1467,6 @@ storage/ndb/src/common/transporter/libtransporter.dsp
|
|||||||
storage/ndb/src/common/util/libgeneral.dsp
|
storage/ndb/src/common/util/libgeneral.dsp
|
||||||
storage/ndb/src/cw/cpcd/ndb_cpcd
|
storage/ndb/src/cw/cpcd/ndb_cpcd
|
||||||
storage/ndb/src/dummy.cpp
|
storage/ndb/src/dummy.cpp
|
||||||
storage/ndb/src/kernel/blocks/ndb_print_file
|
|
||||||
storage/ndb/src/kernel/blocks/backup/libbackup.dsp
|
storage/ndb/src/kernel/blocks/backup/libbackup.dsp
|
||||||
storage/ndb/src/kernel/blocks/backup/ndb_print_backup_file
|
storage/ndb/src/kernel/blocks/backup/ndb_print_backup_file
|
||||||
storage/ndb/src/kernel/blocks/backup/restore/ndb_restore
|
storage/ndb/src/kernel/blocks/backup/restore/ndb_restore
|
||||||
@ -1355,6 +1483,7 @@ storage/ndb/src/kernel/blocks/dbtup/test_varpage
|
|||||||
storage/ndb/src/kernel/blocks/dbtux/libdbtux.dsp
|
storage/ndb/src/kernel/blocks/dbtux/libdbtux.dsp
|
||||||
storage/ndb/src/kernel/blocks/dbutil/libdbutil.dsp
|
storage/ndb/src/kernel/blocks/dbutil/libdbutil.dsp
|
||||||
storage/ndb/src/kernel/blocks/grep/libgrep.dsp
|
storage/ndb/src/kernel/blocks/grep/libgrep.dsp
|
||||||
|
storage/ndb/src/kernel/blocks/ndb_print_file
|
||||||
storage/ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp
|
storage/ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp
|
||||||
storage/ndb/src/kernel/blocks/ndbfs/libndbfs.dsp
|
storage/ndb/src/kernel/blocks/ndbfs/libndbfs.dsp
|
||||||
storage/ndb/src/kernel/blocks/qmgr/libqmgr.dsp
|
storage/ndb/src/kernel/blocks/qmgr/libqmgr.dsp
|
||||||
@ -1449,6 +1578,8 @@ storage/ndb/tools/ndb_show_tables.dsp
|
|||||||
storage/ndb/tools/ndb_test_platform
|
storage/ndb/tools/ndb_test_platform
|
||||||
storage/ndb/tools/ndb_waiter
|
storage/ndb/tools/ndb_waiter
|
||||||
storage/ndb/tools/ndb_waiter.dsp
|
storage/ndb/tools/ndb_waiter.dsp
|
||||||
|
strings/*.ds?
|
||||||
|
strings/*.vcproj
|
||||||
strings/conf_to_src
|
strings/conf_to_src
|
||||||
strings/ctype_autoconf.c
|
strings/ctype_autoconf.c
|
||||||
strings/ctype_extra_sources.c
|
strings/ctype_extra_sources.c
|
||||||
@ -1529,10 +1660,15 @@ test/tools/hugoScanUpdate
|
|||||||
test/tools/ndb_cpcc
|
test/tools/ndb_cpcc
|
||||||
test/tools/restart
|
test/tools/restart
|
||||||
test/tools/verify_index
|
test/tools/verify_index
|
||||||
|
test1/*
|
||||||
test_xml
|
test_xml
|
||||||
|
tests/*.ds?
|
||||||
|
tests/*.vcproj
|
||||||
tests/client_test
|
tests/client_test
|
||||||
tests/connect_test
|
tests/connect_test
|
||||||
tests/mysql_client_test
|
tests/mysql_client_test
|
||||||
|
thr_insert_test/*
|
||||||
|
thr_test/*
|
||||||
thread_test
|
thread_test
|
||||||
tmp/*
|
tmp/*
|
||||||
tools/my_vsnprintf.c
|
tools/my_vsnprintf.c
|
||||||
@ -1541,8 +1677,13 @@ tools/mysqlmngd
|
|||||||
tools/mysqltestmanager
|
tools/mysqltestmanager
|
||||||
tools/mysys_priv.h
|
tools/mysys_priv.h
|
||||||
vi.h
|
vi.h
|
||||||
|
vio/*.ds?
|
||||||
|
vio/*.vcproj
|
||||||
vio/test-ssl
|
vio/test-ssl
|
||||||
vio/test-sslclient
|
vio/test-sslclient
|
||||||
vio/test-sslserver
|
vio/test-sslserver
|
||||||
vio/viotest-ssl
|
vio/viotest-ssl
|
||||||
libmysqld/sql_plugin.cc
|
vio/viotest-sslconnect.cpp
|
||||||
|
vio/viotest.cpp
|
||||||
|
zlib/*.ds?
|
||||||
|
zlib/*.vcproj
|
||||||
|
@ -57,7 +57,7 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch
|
|||||||
c_warnings="$global_warnings -Wunused"
|
c_warnings="$global_warnings -Wunused"
|
||||||
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
|
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
|
||||||
base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition $SSL_LIBRARY"
|
base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition $SSL_LIBRARY"
|
||||||
base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY"
|
base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition $SSL_LIBRARY"
|
||||||
max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-embedded-server --with-big-tables --with-partition $SSL_LIBRARY"
|
max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-embedded-server --with-big-tables --with-partition $SSL_LIBRARY"
|
||||||
max_configs="$base_max_configs --with-embedded-server"
|
max_configs="$base_max_configs --with-embedded-server"
|
||||||
max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server"
|
max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server"
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
path=`dirname $0`
|
path=`dirname $0`
|
||||||
. "$path/SETUP.sh"
|
. "$path/SETUP.sh"
|
||||||
|
|
||||||
extra_flags="$pentium64_cflags $debug_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
|
extra_flags="$pentium64_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
|
||||||
c_warnings="$c_warnings $debug_extra_warnings"
|
c_warnings="$c_warnings $debug_extra_warnings"
|
||||||
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
||||||
extra_configs="$pentium_configs $debug_configs"
|
extra_configs="$pentium_configs $debug_configs"
|
||||||
|
|
||||||
# We want to test isam when building with valgrind
|
# We want to test isam when building with valgrind
|
||||||
extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-isam --with-embedded-server --with-openssl --with-raid --with-ndbcluster"
|
extra_configs="$extra_configs $max_leave_isam_configs --with-isam"
|
||||||
|
|
||||||
. "$path/FINISH.sh"
|
. "$path/FINISH.sh"
|
||||||
|
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
path=`dirname $0`
|
|
||||||
. "$path/SETUP.sh"
|
|
||||||
|
|
||||||
extra_flags="$pentium_cflags"
|
|
||||||
extra_configs="$pentium_configs --without-berkeley-db"
|
|
||||||
|
|
||||||
. "$path/FINISH.sh"
|
|
@ -1,9 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
path=`dirname $0`
|
|
||||||
. "$path/SETUP.sh"
|
|
||||||
|
|
||||||
extra_flags="$pentium_cflags $debug_cflags"
|
|
||||||
extra_configs="$pentium_configs $debug_configs --without-berkeley-db $static_link"
|
|
||||||
|
|
||||||
. "$path/FINISH.sh"
|
|
@ -22,7 +22,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
OptimizeForProcessor="2"
|
OptimizeForProcessor="2"
|
||||||
AdditionalIncludeDirectories="../include,../,../sql"
|
AdditionalIncludeDirectories="../include,../,../sql,../strings"
|
||||||
PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_CONSOLE;_WINDOWS;MYSQL_SERVER"
|
PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_CONSOLE;_WINDOWS;MYSQL_SERVER"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
PrecompiledHeaderFile=".\Debug/mysqlbinlog.pch"
|
PrecompiledHeaderFile=".\Debug/mysqlbinlog.pch"
|
||||||
|
@ -1872,9 +1872,13 @@ com_help(String *buffer __attribute__((unused)),
|
|||||||
if (help_arg)
|
if (help_arg)
|
||||||
return com_server_help(buffer,line,help_arg+1);
|
return com_server_help(buffer,line,help_arg+1);
|
||||||
|
|
||||||
put_info("\nFor the complete MySQL Manual online, visit:\n http://www.mysql.com/documentation\n", INFO_INFO);
|
put_info("\nFor information about MySQL products and services, visit:\n"
|
||||||
put_info("For info on technical support from MySQL developers, visit:\n http://www.mysql.com/support\n", INFO_INFO);
|
" http://www.mysql.com/\n"
|
||||||
put_info("For info on MySQL books, utilities, consultants, etc., visit:\n http://www.mysql.com/portal\n", INFO_INFO);
|
"For developer information, including the MySQL Reference Manual, "
|
||||||
|
"visit:\n"
|
||||||
|
" http://dev.mysql.com/\n"
|
||||||
|
"To buy MySQL Network Support, training, or other products, visit:\n"
|
||||||
|
" https://shop.mysql.com/\n", INFO_INFO);
|
||||||
put_info("List of all MySQL commands:", INFO_INFO);
|
put_info("List of all MySQL commands:", INFO_INFO);
|
||||||
if (!named_cmds)
|
if (!named_cmds)
|
||||||
put_info("Note that all text commands must be first on line and end with ';'",INFO_INFO);
|
put_info("Note that all text commands must be first on line and end with ';'",INFO_INFO);
|
||||||
|
17
configure.in
17
configure.in
@ -311,6 +311,10 @@ case "$target_os" in
|
|||||||
# Use the built-in alloca()
|
# Use the built-in alloca()
|
||||||
CFLAGS="$CFLAGS -Kalloca"
|
CFLAGS="$CFLAGS -Kalloca"
|
||||||
CXXFLAGS="$CFLAGS -Kalloca"
|
CXXFLAGS="$CFLAGS -Kalloca"
|
||||||
|
# Use no_implicit for templates
|
||||||
|
CXXFLAGS="$CXXFLAGS -Tno_implicit"
|
||||||
|
AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
|
||||||
|
[1], [Defined by configure. Use explicit template instantiation.])
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -1533,6 +1537,19 @@ if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
|
|||||||
OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
|
OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If the user specified CFLAGS, we won't add any optimizations
|
||||||
|
if test -n "$SAVE_CFLAGS"
|
||||||
|
then
|
||||||
|
OPTIMIZE_CFLAGS=""
|
||||||
|
DEBUG_OPTIMIZE_CC=""
|
||||||
|
fi
|
||||||
|
# Ditto for CXXFLAGS
|
||||||
|
if test -n "$SAVE_CXXFLAGS"
|
||||||
|
then
|
||||||
|
OPTIMIZE_CXXFLAGS=""
|
||||||
|
DEBUG_OPTIMIZE_CXX=""
|
||||||
|
fi
|
||||||
|
|
||||||
AC_ARG_WITH(debug,
|
AC_ARG_WITH(debug,
|
||||||
[ --without-debug Build a production version without debugging code],
|
[ --without-debug Build a production version without debugging code],
|
||||||
[with_debug=$withval],
|
[with_debug=$withval],
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#ifdef __sun
|
#if defined(__sun) || defined(__SCO_VERSION__)
|
||||||
#include <sys/filio.h>
|
#include <sys/filio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -26,13 +26,17 @@
|
|||||||
#include "runtime.hpp"
|
#include "runtime.hpp"
|
||||||
#include "timer.hpp"
|
#include "timer.hpp"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
|
#else
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace yaSSL {
|
namespace yaSSL {
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
timer_d timer()
|
timer_d timer()
|
||||||
{
|
{
|
||||||
static bool init(false);
|
static bool init(false);
|
||||||
@ -57,8 +61,6 @@ namespace yaSSL {
|
|||||||
|
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
|
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
timer_d timer()
|
timer_d timer()
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
@ -392,8 +392,8 @@ inline double ulonglong2double(ulonglong value)
|
|||||||
#define HAVE_SPATIAL 1
|
#define HAVE_SPATIAL 1
|
||||||
#define HAVE_RTREE_KEYS 1
|
#define HAVE_RTREE_KEYS 1
|
||||||
|
|
||||||
#define HAVE_OPENSSL 1
|
/* #undef HAVE_OPENSSL */
|
||||||
#define HAVE_YASSL 1
|
/* #undef HAVE_YASSL */
|
||||||
|
|
||||||
/* Define charsets you want */
|
/* Define charsets you want */
|
||||||
/* #undef HAVE_CHARSET_armscii8 */
|
/* #undef HAVE_CHARSET_armscii8 */
|
||||||
|
@ -641,6 +641,15 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||||||
#define O_NOFOLLOW 0
|
#define O_NOFOLLOW 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* additional file share flags for win32 */
|
||||||
|
#ifdef __WIN__
|
||||||
|
#define _SH_DENYRWD 0x110 /* deny read/write mode & delete */
|
||||||
|
#define _SH_DENYWRD 0x120 /* deny write mode & delete */
|
||||||
|
#define _SH_DENYRDD 0x130 /* deny read mode & delete */
|
||||||
|
#define _SH_DENYDEL 0x140 /* deny delete only */
|
||||||
|
#endif /* __WIN__ */
|
||||||
|
|
||||||
|
|
||||||
/* #define USE_RECORD_LOCK */
|
/* #define USE_RECORD_LOCK */
|
||||||
|
|
||||||
/* Unsigned types supported by the compiler */
|
/* Unsigned types supported by the compiler */
|
||||||
|
@ -536,9 +536,15 @@ void safe_mutex_end(FILE *file);
|
|||||||
#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
|
#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
|
||||||
#define pthread_mutex_trylock(A) pthread_mutex_lock(A)
|
#define pthread_mutex_trylock(A) pthread_mutex_lock(A)
|
||||||
#define pthread_mutex_t safe_mutex_t
|
#define pthread_mutex_t safe_mutex_t
|
||||||
#define safe_mutex_assert_owner(mp) DBUG_ASSERT((mp)->count > 0 && pthread_equal(pthread_self(),(mp)->thread))
|
#define safe_mutex_assert_owner(mp) \
|
||||||
|
DBUG_ASSERT((mp)->count > 0 && \
|
||||||
|
pthread_equal(pthread_self(), (mp)->thread))
|
||||||
|
#define safe_mutex_assert_not_owner(mp) \
|
||||||
|
DBUG_ASSERT(! (mp)->count || \
|
||||||
|
! pthread_equal(pthread_self(), (mp)->thread))
|
||||||
#else
|
#else
|
||||||
#define safe_mutex_assert_owner(mp)
|
#define safe_mutex_assert_owner(mp)
|
||||||
|
#define safe_mutex_assert_not_owner(mp)
|
||||||
#endif /* SAFE_MUTEX */
|
#endif /* SAFE_MUTEX */
|
||||||
|
|
||||||
/* READ-WRITE thread locking */
|
/* READ-WRITE thread locking */
|
||||||
|
@ -601,6 +601,7 @@ extern char *_my_strdup_with_length(const byte *from, uint length,
|
|||||||
|
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
extern int my_access(const char *path, int amode);
|
extern int my_access(const char *path, int amode);
|
||||||
|
extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
|
||||||
#else
|
#else
|
||||||
#define my_access access
|
#define my_access access
|
||||||
#endif
|
#endif
|
||||||
|
@ -930,7 +930,7 @@ sub executable_setup () {
|
|||||||
}
|
}
|
||||||
$exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck");
|
$exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck");
|
||||||
$exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
|
$exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
|
||||||
$exe_mysqlimport= mtr_exe_exists("$path_client_bindir/mysqlimport");
|
$exe_mysqlimport= mtr_exe_exists("$path_client_bindir/mysqlimport");
|
||||||
$exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
|
$exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
|
||||||
$exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog");
|
$exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog");
|
||||||
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
|
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
|
||||||
@ -947,6 +947,7 @@ sub executable_setup () {
|
|||||||
$path_client_bindir= mtr_path_exists("$glob_basedir/bin");
|
$path_client_bindir= mtr_path_exists("$glob_basedir/bin");
|
||||||
$exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck");
|
$exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck");
|
||||||
$exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
|
$exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
|
||||||
|
$exe_mysqlimport= mtr_exe_exists("$path_client_bindir/mysqlimport");
|
||||||
$exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
|
$exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
|
||||||
$exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog");
|
$exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog");
|
||||||
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
|
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
|
||||||
@ -2008,7 +2009,7 @@ sub mysqld_arguments ($$$$$) {
|
|||||||
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
|
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
|
||||||
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
|
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
|
||||||
mtr_add_arg($args, "%s--core", $prefix);
|
mtr_add_arg($args, "%s--core", $prefix);
|
||||||
mtr_add_arg($args, "%s--log-bin-trust-routine-creators", $prefix);
|
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
|
||||||
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
|
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
|
||||||
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
|
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
|
||||||
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
|
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
|
||||||
@ -2131,7 +2132,7 @@ sub mysqld_arguments ($$$$$) {
|
|||||||
mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix);
|
mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix);
|
||||||
mtr_add_arg($args, "%s--sort_buffer=256K", $prefix);
|
mtr_add_arg($args, "%s--sort_buffer=256K", $prefix);
|
||||||
mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix);
|
mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix);
|
||||||
mtr_add_arg($args, "%s--log-bin-trust-routine-creators", $prefix);
|
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
|
||||||
|
|
||||||
if ( $opt_ssl_supported )
|
if ( $opt_ssl_supported )
|
||||||
{
|
{
|
||||||
|
@ -1275,7 +1275,7 @@ start_master()
|
|||||||
--language=$LANGUAGE \
|
--language=$LANGUAGE \
|
||||||
--innodb_data_file_path=ibdata1:128M:autoextend \
|
--innodb_data_file_path=ibdata1:128M:autoextend \
|
||||||
--open-files-limit=1024 \
|
--open-files-limit=1024 \
|
||||||
--log-bin-trust-routine-creators \
|
--log-bin-trust-function-creators \
|
||||||
$MASTER_40_ARGS \
|
$MASTER_40_ARGS \
|
||||||
$SMALL_SERVER \
|
$SMALL_SERVER \
|
||||||
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
|
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
|
||||||
@ -1296,7 +1296,7 @@ start_master()
|
|||||||
--tmpdir=$MYSQL_TMP_DIR \
|
--tmpdir=$MYSQL_TMP_DIR \
|
||||||
--language=$LANGUAGE \
|
--language=$LANGUAGE \
|
||||||
--innodb_data_file_path=ibdata1:128M:autoextend \
|
--innodb_data_file_path=ibdata1:128M:autoextend \
|
||||||
--log-bin-trust-routine-creators \
|
--log-bin-trust-function-creators \
|
||||||
$MASTER_40_ARGS \
|
$MASTER_40_ARGS \
|
||||||
$SMALL_SERVER \
|
$SMALL_SERVER \
|
||||||
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
|
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
|
||||||
@ -1429,7 +1429,7 @@ start_slave()
|
|||||||
--report-port=$slave_port \
|
--report-port=$slave_port \
|
||||||
--master-retry-count=10 \
|
--master-retry-count=10 \
|
||||||
-O slave_net_timeout=10 \
|
-O slave_net_timeout=10 \
|
||||||
--log-bin-trust-routine-creators \
|
--log-bin-trust-function-creators \
|
||||||
$SMALL_SERVER \
|
$SMALL_SERVER \
|
||||||
$EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
|
$EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
|
||||||
CUR_MYERR=$slave_err
|
CUR_MYERR=$slave_err
|
||||||
|
@ -486,7 +486,7 @@ void start_master()
|
|||||||
#endif
|
#endif
|
||||||
add_arg(&al, "--local-infile");
|
add_arg(&al, "--local-infile");
|
||||||
add_arg(&al, "--core");
|
add_arg(&al, "--core");
|
||||||
add_arg(&al, "--log-bin-trust-routine-creators");
|
add_arg(&al, "--log-bin-trust-function-creators");
|
||||||
add_arg(&al, "--datadir=%s", master_dir);
|
add_arg(&al, "--datadir=%s", master_dir);
|
||||||
#ifndef __WIN__
|
#ifndef __WIN__
|
||||||
add_arg(&al, "--pid-file=%s", master_pid);
|
add_arg(&al, "--pid-file=%s", master_pid);
|
||||||
|
@ -30,3 +30,10 @@ check table t1;
|
|||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 check status OK
|
test.t1 check status OK
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t1 (a int);
|
||||||
|
prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()";
|
||||||
|
execute stmt1;
|
||||||
|
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||||
|
execute stmt1;
|
||||||
|
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||||
|
deallocate prepare stmt1;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1, t2;
|
||||||
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
|
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
|
||||||
0 256 00000000000000065536 2147483647 -2147483648 2147483648 4294967296
|
0 256 00000000000000065536 2147483647 -2147483648 2147483648 4294967296
|
||||||
0 256 65536 2147483647 -2147483648 2147483648 4294967296
|
0 256 65536 2147483647 -2147483648 2147483648 4294967296
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
drop table if exists t1,t2,t3;
|
drop table if exists t1,t2,t3,t4,t5;
|
||||||
drop database if exists mysqltest;
|
drop database if exists mysqltest;
|
||||||
create table t1 (b char(0));
|
create table t1 (b char(0));
|
||||||
insert into t1 values (""),(null);
|
insert into t1 values (""),(null);
|
||||||
@ -654,3 +654,92 @@ t1 CREATE TABLE `t1` (
|
|||||||
PRIMARY KEY (`a`)
|
PRIMARY KEY (`a`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t2 (
|
||||||
|
a int(11) default NULL
|
||||||
|
);
|
||||||
|
insert into t2 values(111);
|
||||||
|
create table t1 (
|
||||||
|
a varchar(12) charset utf8 collate utf8_bin not null,
|
||||||
|
b int not null, primary key (a)
|
||||||
|
) select a, 1 as b from t2 ;
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'a' doesn't have a default value
|
||||||
|
Warning 1364 Field 'b' doesn't have a default value
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` varchar(12) character set utf8 collate utf8_bin NOT NULL,
|
||||||
|
`b` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`a`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
create table t1 (
|
||||||
|
a varchar(12) charset utf8 collate utf8_bin not null,
|
||||||
|
b int not null, primary key (a)
|
||||||
|
) select 'a' as a , 1 as b from t2 ;
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'a' doesn't have a default value
|
||||||
|
Warning 1364 Field 'b' doesn't have a default value
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` varchar(12) character set utf8 collate utf8_bin NOT NULL,
|
||||||
|
`b` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`a`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
create table t1 (
|
||||||
|
a varchar(12) charset utf8 collate utf8_bin,
|
||||||
|
b int not null, primary key (a)
|
||||||
|
) select 'a' as a , 1 as b from t2 ;
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'b' doesn't have a default value
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` varchar(12) character set utf8 collate utf8_bin NOT NULL default '',
|
||||||
|
`b` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`a`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1, t2;
|
||||||
|
create table t1 (
|
||||||
|
a1 int not null,
|
||||||
|
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
|
||||||
|
);
|
||||||
|
insert into t1 values (1,1,1, 1,1,1, 1,1,1);
|
||||||
|
create table t2 (
|
||||||
|
a1 varchar(12) charset utf8 collate utf8_bin not null,
|
||||||
|
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int,
|
||||||
|
primary key (a1)
|
||||||
|
) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ;
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'a1' doesn't have a default value
|
||||||
|
drop table t2;
|
||||||
|
create table t2 (
|
||||||
|
a1 varchar(12) charset utf8 collate utf8_bin,
|
||||||
|
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
|
||||||
|
) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1;
|
||||||
|
drop table t1, t2;
|
||||||
|
create table t1 (
|
||||||
|
a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
|
||||||
|
);
|
||||||
|
insert into t1 values (1,1,1, 1,1,1, 1,1,1);
|
||||||
|
create table t2 (
|
||||||
|
a1 varchar(12) charset utf8 collate utf8_bin not null,
|
||||||
|
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int,
|
||||||
|
primary key (a1)
|
||||||
|
) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ;
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'a1' doesn't have a default value
|
||||||
|
drop table t2;
|
||||||
|
create table t2 ( a int default 3, b int default 3)
|
||||||
|
select a1,a2 from t1;
|
||||||
|
show create table t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`a` int(11) default '3',
|
||||||
|
`b` int(11) default '3',
|
||||||
|
`a1` int(11) default NULL,
|
||||||
|
`a2` int(11) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1, t2;
|
||||||
|
@ -4929,3 +4929,50 @@ Warnings:
|
|||||||
Note 1051 Unknown table 't2'
|
Note 1051 Unknown table 't2'
|
||||||
Note 1051 Unknown table 't3'
|
Note 1051 Unknown table 't3'
|
||||||
Note 1051 Unknown table 't4'
|
Note 1051 Unknown table 't4'
|
||||||
|
DROP TABLE IF EXISTS bug13894;
|
||||||
|
CREATE TABLE bug13894 ( val integer ) ENGINE = CSV;
|
||||||
|
INSERT INTO bug13894 VALUES (5);
|
||||||
|
INSERT INTO bug13894 VALUES (10);
|
||||||
|
INSERT INTO bug13894 VALUES (11);
|
||||||
|
INSERT INTO bug13894 VALUES (10);
|
||||||
|
SELECT * FROM bug13894;
|
||||||
|
val
|
||||||
|
5
|
||||||
|
10
|
||||||
|
11
|
||||||
|
10
|
||||||
|
UPDATE bug13894 SET val=6 WHERE val=10;
|
||||||
|
SELECT * FROM bug13894;
|
||||||
|
val
|
||||||
|
5
|
||||||
|
11
|
||||||
|
6
|
||||||
|
6
|
||||||
|
DROP TABLE bug13894;
|
||||||
|
DROP TABLE IF EXISTS bug14672;
|
||||||
|
CREATE TABLE bug14672 (c1 integer) engine = CSV;
|
||||||
|
INSERT INTO bug14672 VALUES (1), (2), (3);
|
||||||
|
SELECT * FROM bug14672;
|
||||||
|
c1
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
DELETE FROM bug14672 WHERE c1 = 2;
|
||||||
|
SELECT * FROM bug14672;
|
||||||
|
c1
|
||||||
|
1
|
||||||
|
3
|
||||||
|
INSERT INTO bug14672 VALUES (4);
|
||||||
|
SELECT * FROM bug14672;
|
||||||
|
c1
|
||||||
|
1
|
||||||
|
3
|
||||||
|
4
|
||||||
|
INSERT INTO bug14672 VALUES (5);
|
||||||
|
SELECT * FROM bug14672;
|
||||||
|
c1
|
||||||
|
1
|
||||||
|
3
|
||||||
|
4
|
||||||
|
5
|
||||||
|
DROP TABLE bug14672;
|
||||||
|
@ -429,4 +429,8 @@ REPAIR TABLE t1;
|
|||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 repair status OK
|
test.t1 repair status OK
|
||||||
SET myisam_repair_threads=@@global.myisam_repair_threads;
|
SET myisam_repair_threads=@@global.myisam_repair_threads;
|
||||||
|
INSERT INTO t1 VALUES('testword\'\'');
|
||||||
|
SELECT a FROM t1 WHERE MATCH a AGAINST('testword' IN BOOLEAN MODE);
|
||||||
|
a
|
||||||
|
testword''
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
@ -596,3 +596,18 @@ GROUP_CONCAT(a ORDER BY a)
|
|||||||
,x
|
,x
|
||||||
,z
|
,z
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
set names latin1;
|
||||||
|
create table t1 (a char, b char);
|
||||||
|
insert into t1 values ('a', 'a'), ('a', 'b'), ('b', 'a'), ('b', 'b');
|
||||||
|
create table t2 select group_concat(b) as a from t1 where a = 'a';
|
||||||
|
create table t3 (select group_concat(a) as a from t1 where a = 'a') union
|
||||||
|
(select group_concat(b) as a from t1 where a = 'b');
|
||||||
|
select charset(a) from t2;
|
||||||
|
charset(a)
|
||||||
|
latin1
|
||||||
|
select charset(a) from t3;
|
||||||
|
charset(a)
|
||||||
|
latin1
|
||||||
|
latin1
|
||||||
|
drop table t1, t2, t3;
|
||||||
|
set names default;
|
||||||
|
@ -445,3 +445,40 @@ drop table t2;
|
|||||||
drop table t3;
|
drop table t3;
|
||||||
drop table t4;
|
drop table t4;
|
||||||
drop table t5;
|
drop table t5;
|
||||||
|
create table t1 (c1 int);
|
||||||
|
insert into t1 values (1);
|
||||||
|
handler t1 open;
|
||||||
|
handler t1 read first;
|
||||||
|
c1
|
||||||
|
1
|
||||||
|
send the below to another connection, do not wait for the result
|
||||||
|
optimize table t1;
|
||||||
|
proceed with the normal connection
|
||||||
|
handler t1 read next;
|
||||||
|
c1
|
||||||
|
1
|
||||||
|
handler t1 close;
|
||||||
|
read the result from the other connection
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 optimize status OK
|
||||||
|
proceed with the normal connection
|
||||||
|
drop table t1;
|
||||||
|
create table t1 (c1 int);
|
||||||
|
insert into t1 values (14397);
|
||||||
|
flush tables with read lock;
|
||||||
|
drop table t1;
|
||||||
|
ERROR HY000: Can't execute the query because you have a conflicting read lock
|
||||||
|
send the below to another connection, do not wait for the result
|
||||||
|
drop table t1;
|
||||||
|
proceed with the normal connection
|
||||||
|
select * from t1;
|
||||||
|
c1
|
||||||
|
14397
|
||||||
|
unlock tables;
|
||||||
|
read the result from the other connection
|
||||||
|
proceed with the normal connection
|
||||||
|
select * from t1;
|
||||||
|
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||||
|
drop table if exists t1;
|
||||||
|
Warnings:
|
||||||
|
Note 1051 Unknown table 't1'
|
||||||
|
@ -648,12 +648,16 @@ drop function sub1;
|
|||||||
select table_name from information_schema.views
|
select table_name from information_schema.views
|
||||||
where table_schema='test';
|
where table_schema='test';
|
||||||
table_name
|
table_name
|
||||||
|
v2
|
||||||
|
v3
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||||
Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||||
select table_name from information_schema.views
|
select table_name from information_schema.views
|
||||||
where table_schema='test';
|
where table_schema='test';
|
||||||
table_name
|
table_name
|
||||||
|
v2
|
||||||
|
v3
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||||
Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||||
@ -670,6 +674,16 @@ f1_key
|
|||||||
select constraint_name from information_schema.table_constraints
|
select constraint_name from information_schema.table_constraints
|
||||||
where table_schema='test';
|
where table_schema='test';
|
||||||
constraint_name
|
constraint_name
|
||||||
|
show create view v2;
|
||||||
|
View Create View
|
||||||
|
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `test`.`t1`.`f1` AS `c` from `t1`
|
||||||
|
Warnings:
|
||||||
|
Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||||
|
show create table v3;
|
||||||
|
View Create View
|
||||||
|
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select sql_no_cache `test`.`sub1`(1) AS `c`
|
||||||
|
Warnings:
|
||||||
|
Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||||
drop view v2;
|
drop view v2;
|
||||||
drop view v3;
|
drop view v3;
|
||||||
drop table t4;
|
drop table t4;
|
||||||
@ -723,6 +737,7 @@ information_schema ROUTINES SQL_MODE
|
|||||||
information_schema TRIGGERS ACTION_CONDITION
|
information_schema TRIGGERS ACTION_CONDITION
|
||||||
information_schema TRIGGERS ACTION_STATEMENT
|
information_schema TRIGGERS ACTION_STATEMENT
|
||||||
information_schema TRIGGERS SQL_MODE
|
information_schema TRIGGERS SQL_MODE
|
||||||
|
information_schema TRIGGERS DEFINER
|
||||||
information_schema VIEWS VIEW_DEFINITION
|
information_schema VIEWS VIEW_DEFINITION
|
||||||
select table_name, column_name, data_type from information_schema.columns
|
select table_name, column_name, data_type from information_schema.columns
|
||||||
where data_type = 'datetime';
|
where data_type = 'datetime';
|
||||||
@ -801,45 +816,45 @@ set @fired:= "Yes";
|
|||||||
end if;
|
end if;
|
||||||
end|
|
end|
|
||||||
show triggers;
|
show triggers;
|
||||||
Trigger Event Table Statement Timing Created sql_mode
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
trg1 INSERT t1
|
trg1 INSERT t1
|
||||||
begin
|
begin
|
||||||
if new.j > 10 then
|
if new.j > 10 then
|
||||||
set new.j := 10;
|
set new.j := 10;
|
||||||
end if;
|
end if;
|
||||||
end BEFORE NULL
|
end BEFORE NULL root@localhost
|
||||||
trg2 UPDATE t1
|
trg2 UPDATE t1
|
||||||
begin
|
begin
|
||||||
if old.i % 2 = 0 then
|
if old.i % 2 = 0 then
|
||||||
set new.j := -1;
|
set new.j := -1;
|
||||||
end if;
|
end if;
|
||||||
end BEFORE NULL
|
end BEFORE NULL root@localhost
|
||||||
trg3 UPDATE t1
|
trg3 UPDATE t1
|
||||||
begin
|
begin
|
||||||
if new.j = -1 then
|
if new.j = -1 then
|
||||||
set @fired:= "Yes";
|
set @fired:= "Yes";
|
||||||
end if;
|
end if;
|
||||||
end AFTER NULL
|
end AFTER NULL root@localhost
|
||||||
select * from information_schema.triggers;
|
select * from information_schema.triggers;
|
||||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE
|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||||
NULL test trg1 INSERT NULL test t1 0 NULL
|
NULL test trg1 INSERT NULL test t1 0 NULL
|
||||||
begin
|
begin
|
||||||
if new.j > 10 then
|
if new.j > 10 then
|
||||||
set new.j := 10;
|
set new.j := 10;
|
||||||
end if;
|
end if;
|
||||||
end ROW BEFORE NULL NULL OLD NEW NULL
|
end ROW BEFORE NULL NULL OLD NEW NULL root@localhost
|
||||||
NULL test trg2 UPDATE NULL test t1 0 NULL
|
NULL test trg2 UPDATE NULL test t1 0 NULL
|
||||||
begin
|
begin
|
||||||
if old.i % 2 = 0 then
|
if old.i % 2 = 0 then
|
||||||
set new.j := -1;
|
set new.j := -1;
|
||||||
end if;
|
end if;
|
||||||
end ROW BEFORE NULL NULL OLD NEW NULL
|
end ROW BEFORE NULL NULL OLD NEW NULL root@localhost
|
||||||
NULL test trg3 UPDATE NULL test t1 0 NULL
|
NULL test trg3 UPDATE NULL test t1 0 NULL
|
||||||
begin
|
begin
|
||||||
if new.j = -1 then
|
if new.j = -1 then
|
||||||
set @fired:= "Yes";
|
set @fired:= "Yes";
|
||||||
end if;
|
end if;
|
||||||
end ROW AFTER NULL NULL OLD NEW NULL
|
end ROW AFTER NULL NULL OLD NEW NULL root@localhost
|
||||||
drop trigger trg1;
|
drop trigger trg1;
|
||||||
drop trigger trg2;
|
drop trigger trg2;
|
||||||
drop trigger trg3;
|
drop trigger trg3;
|
||||||
|
@ -1403,3 +1403,67 @@ SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
|
|||||||
ERROR 42S22: Unknown column 'v2.x' in 'field list'
|
ERROR 42S22: Unknown column 'v2.x' in 'field list'
|
||||||
DROP VIEW v1, v2;
|
DROP VIEW v1, v2;
|
||||||
DROP TABLE t1, t2, t3, t4, t5, t6;
|
DROP TABLE t1, t2, t3, t4, t5, t6;
|
||||||
|
create table t1 (id1 int(11) not null);
|
||||||
|
insert into t1 values (1),(2);
|
||||||
|
create table t2 (id2 int(11) not null);
|
||||||
|
insert into t2 values (1),(2),(3),(4);
|
||||||
|
create table t3 (id3 char(16) not null);
|
||||||
|
insert into t3 values ('100');
|
||||||
|
create table t4 (id2 int(11) not null, id3 char(16));
|
||||||
|
create table t5 (id1 int(11) not null, key (id1));
|
||||||
|
insert into t5 values (1),(2),(1);
|
||||||
|
create view v1 as
|
||||||
|
select t4.id3 from t4 join t2 on t4.id2 = t2.id2;
|
||||||
|
select t1.id1 from t1 inner join (t3 left join v1 on t3.id3 = v1.id3);
|
||||||
|
id1
|
||||||
|
1
|
||||||
|
2
|
||||||
|
drop view v1;
|
||||||
|
drop table t1, t2, t3, t4, t5;
|
||||||
|
create table t0 (a int);
|
||||||
|
insert into t0 values (0),(1),(2),(3);
|
||||||
|
create table t1(a int);
|
||||||
|
insert into t1 select A.a + 10*(B.a) from t0 A, t0 B;
|
||||||
|
create table t2 (a int, b int);
|
||||||
|
insert into t2 values (1,1), (2,2), (3,3);
|
||||||
|
create table t3(a int, b int, filler char(200), key(a));
|
||||||
|
insert into t3 select a,a,'filler' from t1;
|
||||||
|
insert into t3 select a,a,'filler' from t1;
|
||||||
|
create table t4 like t3;
|
||||||
|
insert into t4 select * from t3;
|
||||||
|
insert into t4 select * from t3;
|
||||||
|
create table t5 like t4;
|
||||||
|
insert into t5 select * from t4;
|
||||||
|
insert into t5 select * from t4;
|
||||||
|
create table t6 like t5;
|
||||||
|
insert into t6 select * from t5;
|
||||||
|
insert into t6 select * from t5;
|
||||||
|
create table t7 like t6;
|
||||||
|
insert into t7 select * from t6;
|
||||||
|
insert into t7 select * from t6;
|
||||||
|
explain select * from t4 join
|
||||||
|
t2 left join (t3 join t5 on t5.a=t3.b) on t3.a=t2.b where t4.a<=>t3.b;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t2 ALL NULL NULL NULL NULL X
|
||||||
|
1 SIMPLE t3 ref a a 5 test.t2.b X
|
||||||
|
1 SIMPLE t5 ref a a 5 test.t3.b X
|
||||||
|
1 SIMPLE t4 ref a a 5 test.t3.b X Using where
|
||||||
|
explain select * from (t4 join t6 on t6.a=t4.b) right join t3 on t4.a=t3.b
|
||||||
|
join t2 left join (t5 join t7 on t7.a=t5.b) on t5.a=t2.b where t3.a<=>t2.b;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t2 ALL NULL NULL NULL NULL X
|
||||||
|
1 SIMPLE t3 ref a a 5 test.t2.b X Using where
|
||||||
|
1 SIMPLE t4 ref a a 5 test.t3.b X
|
||||||
|
1 SIMPLE t6 ref a a 5 test.t4.b X
|
||||||
|
1 SIMPLE t5 ref a a 5 test.t2.b X
|
||||||
|
1 SIMPLE t7 ref a a 5 test.t5.b X
|
||||||
|
explain select * from t2 left join
|
||||||
|
(t3 left join (t4 join t6 on t6.a=t4.b) on t4.a=t3.b
|
||||||
|
join t5 on t5.a=t3.b) on t3.a=t2.b;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t2 ALL NULL NULL NULL NULL X
|
||||||
|
1 SIMPLE t3 ref a a 5 test.t2.b X
|
||||||
|
1 SIMPLE t4 ref a a 5 test.t3.b X
|
||||||
|
1 SIMPLE t6 ref a a 5 test.t4.b X
|
||||||
|
1 SIMPLE t5 ref a a 5 test.t3.b X
|
||||||
|
drop table t0, t1, t2, t4, t5, t6;
|
||||||
|
@ -205,3 +205,54 @@ select (@after-@before) >= 2;
|
|||||||
(@after-@before) >= 2
|
(@after-@before) >= 2
|
||||||
1
|
1
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
commit;
|
||||||
|
begin;
|
||||||
|
create temporary table ti (a int) engine=innodb;
|
||||||
|
rollback;
|
||||||
|
Warnings:
|
||||||
|
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||||
|
insert into ti values(1);
|
||||||
|
set autocommit=0;
|
||||||
|
create temporary table t1 (a int) engine=myisam;
|
||||||
|
commit;
|
||||||
|
insert t1 values (1);
|
||||||
|
rollback;
|
||||||
|
Warnings:
|
||||||
|
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||||
|
create table t0 (n int);
|
||||||
|
insert t0 select * from t1;
|
||||||
|
set autocommit=1;
|
||||||
|
insert into t0 select GET_LOCK("lock1",null);
|
||||||
|
set autocommit=0;
|
||||||
|
create table t2 (n int) engine=innodb;
|
||||||
|
insert into t2 values (3);
|
||||||
|
select get_lock("lock1",60);
|
||||||
|
get_lock("lock1",60)
|
||||||
|
1
|
||||||
|
show binlog events from 98;
|
||||||
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
|
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||||
|
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(16)
|
||||||
|
master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
|
||||||
|
master-bin.000001 342 Xid 1 # COMMIT /* xid=105 */
|
||||||
|
master-bin.000001 369 Query 1 # use `test`; delete from t1
|
||||||
|
master-bin.000001 446 Xid 1 # COMMIT /* xid=114 */
|
||||||
|
master-bin.000001 473 Query 1 # use `test`; delete from t2
|
||||||
|
master-bin.000001 550 Xid 1 # COMMIT /* xid=115 */
|
||||||
|
master-bin.000001 577 Query 1 # use `test`; alter table t2 type=MyISAM
|
||||||
|
master-bin.000001 666 Query 1 # use `test`; insert into t1 values (1)
|
||||||
|
master-bin.000001 754 Xid 1 # COMMIT /* xid=117 */
|
||||||
|
master-bin.000001 781 Query 1 # use `test`; insert into t2 values (20)
|
||||||
|
master-bin.000001 870 Query 1 # use `test`; drop table t1,t2
|
||||||
|
master-bin.000001 949 Query 1 # use `test`; create temporary table ti (a int) engine=innodb
|
||||||
|
master-bin.000001 1059 Query 1 # use `test`; insert into ti values(1)
|
||||||
|
master-bin.000001 1146 Xid 1 # COMMIT /* xid=132 */
|
||||||
|
master-bin.000001 1173 Query 1 # use `test`; create temporary table t1 (a int) engine=myisam
|
||||||
|
master-bin.000001 1283 Query 1 # use `test`; insert t1 values (1)
|
||||||
|
master-bin.000001 1366 Query 1 # use `test`; create table t0 (n int)
|
||||||
|
master-bin.000001 1452 Query 1 # use `test`; insert t0 select * from t1
|
||||||
|
master-bin.000001 1541 Query 1 # use `test`; insert into t0 select GET_LOCK("lock1",null)
|
||||||
|
master-bin.000001 1648 Query 1 # use `test`; create table t2 (n int) engine=innodb
|
||||||
|
master-bin.000001 1748 Query 1 # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
|
||||||
|
do release_lock("lock1");
|
||||||
|
drop table t0,t2;
|
||||||
|
@ -505,6 +505,16 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary
|
1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary
|
||||||
1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
|
1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
create table t1 (
|
||||||
|
c1 varchar(32),
|
||||||
|
key (c1)
|
||||||
|
) engine=myisam;
|
||||||
|
alter table t1 disable keys;
|
||||||
|
insert into t1 values ('a'), ('b');
|
||||||
|
select c1 from t1 order by c1 limit 1;
|
||||||
|
c1
|
||||||
|
a
|
||||||
|
drop table t1;
|
||||||
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
|
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
create table t1 (a int, b varchar(200), c text not null) checksum=1;
|
create table t1 (a int, b varchar(200), c text not null) checksum=1;
|
||||||
@ -701,6 +711,24 @@ t1 1 a 2 b A 0 NULL NULL YES BTREE
|
|||||||
t1 1 a 3 c A 0 NULL NULL YES BTREE
|
t1 1 a 3 c A 0 NULL NULL YES BTREE
|
||||||
t1 1 a 4 d A 0 NULL NULL YES BTREE
|
t1 1 a 4 d A 0 NULL NULL YES BTREE
|
||||||
set myisam_stats_method=DEFAULT;
|
set myisam_stats_method=DEFAULT;
|
||||||
|
drop table t1;
|
||||||
|
create table t1(
|
||||||
|
cip INT NOT NULL,
|
||||||
|
time TIME NOT NULL,
|
||||||
|
score INT NOT NULL DEFAULT 0,
|
||||||
|
bob TINYBLOB
|
||||||
|
);
|
||||||
|
insert into t1 (cip, time) VALUES (1, '00:01'), (2, '00:02'), (3,'00:03');
|
||||||
|
insert into t1 (cip, bob, time) VALUES (4, 'a', '00:04'), (5, 'b', '00:05'),
|
||||||
|
(6, 'c', '00:06');
|
||||||
|
select * from t1 where bob is null and cip=1;
|
||||||
|
cip time score bob
|
||||||
|
1 00:01:00 0 NULL
|
||||||
|
create index bug on t1 (bob(22), cip, time);
|
||||||
|
select * from t1 where bob is null and cip=1;
|
||||||
|
cip time score bob
|
||||||
|
1 00:01:00 0 NULL
|
||||||
|
drop table t1;
|
||||||
set storage_engine=MyISAM;
|
set storage_engine=MyISAM;
|
||||||
drop table if exists t1,t2,t3;
|
drop table if exists t1,t2,t3;
|
||||||
--- Testing varchar ---
|
--- Testing varchar ---
|
||||||
|
@ -1614,6 +1614,16 @@ mysqldump: Couldn't find table: "t\1"
|
|||||||
|
|
||||||
mysqldump: Couldn't find table: "t/1"
|
mysqldump: Couldn't find table: "t/1"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "T_1"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "T%1"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "T'1"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "T_1"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "T_"
|
||||||
|
|
||||||
test_sequence
|
test_sequence
|
||||||
------ Testing with illegal database names ------
|
------ Testing with illegal database names ------
|
||||||
mysqldump: Got error: 1049: Unknown database 'mysqldump_test_d' when selecting the database
|
mysqldump: Got error: 1049: Unknown database 'mysqldump_test_d' when selecting the database
|
||||||
@ -1926,23 +1936,23 @@ end if;
|
|||||||
end|
|
end|
|
||||||
set sql_mode=default|
|
set sql_mode=default|
|
||||||
show triggers like "t1";
|
show triggers like "t1";
|
||||||
Trigger Event Table Statement Timing Created sql_mode
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
trg1 INSERT t1
|
trg1 INSERT t1
|
||||||
begin
|
begin
|
||||||
if new.a > 10 then
|
if new.a > 10 then
|
||||||
set new.a := 10;
|
set new.a := 10;
|
||||||
set new.a := 11;
|
set new.a := 11;
|
||||||
end if;
|
end if;
|
||||||
end BEFORE 0000-00-00 00:00:00
|
end BEFORE 0000-00-00 00:00:00 root@localhost
|
||||||
trg2 UPDATE t1 begin
|
trg2 UPDATE t1 begin
|
||||||
if old.a % 2 = 0 then set new.b := 12; end if;
|
if old.a % 2 = 0 then set new.b := 12; end if;
|
||||||
end BEFORE 0000-00-00 00:00:00
|
end BEFORE 0000-00-00 00:00:00 root@localhost
|
||||||
trg3 UPDATE t1
|
trg3 UPDATE t1
|
||||||
begin
|
begin
|
||||||
if new.a = -1 then
|
if new.a = -1 then
|
||||||
set @fired:= "Yes";
|
set @fired:= "Yes";
|
||||||
end if;
|
end if;
|
||||||
end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost
|
||||||
INSERT INTO t1 (a) VALUES (1),(2),(3),(22);
|
INSERT INTO t1 (a) VALUES (1),(2),(3),(22);
|
||||||
update t1 set a = 4 where a=3;
|
update t1 set a = 4 where a=3;
|
||||||
|
|
||||||
@ -2085,29 +2095,29 @@ Tables_in_test
|
|||||||
t1
|
t1
|
||||||
t2
|
t2
|
||||||
show triggers;
|
show triggers;
|
||||||
Trigger Event Table Statement Timing Created sql_mode
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
trg1 INSERT t1
|
trg1 INSERT t1
|
||||||
begin
|
begin
|
||||||
if new.a > 10 then
|
if new.a > 10 then
|
||||||
set new.a := 10;
|
set new.a := 10;
|
||||||
set new.a := 11;
|
set new.a := 11;
|
||||||
end if;
|
end if;
|
||||||
end BEFORE #
|
end BEFORE # root@localhost
|
||||||
trg2 UPDATE t1 begin
|
trg2 UPDATE t1 begin
|
||||||
if old.a % 2 = 0 then set new.b := 12; end if;
|
if old.a % 2 = 0 then set new.b := 12; end if;
|
||||||
end BEFORE #
|
end BEFORE # root@localhost
|
||||||
trg3 UPDATE t1
|
trg3 UPDATE t1
|
||||||
begin
|
begin
|
||||||
if new.a = -1 then
|
if new.a = -1 then
|
||||||
set @fired:= "Yes";
|
set @fired:= "Yes";
|
||||||
end if;
|
end if;
|
||||||
end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost
|
||||||
trg4 INSERT t2
|
trg4 INSERT t2
|
||||||
begin
|
begin
|
||||||
if new.a > 10 then
|
if new.a > 10 then
|
||||||
set @fired:= "No";
|
set @fired:= "No";
|
||||||
end if;
|
end if;
|
||||||
end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
--port=1234
|
--port=1234
|
||||||
--port=1234
|
--port=1234
|
||||||
@ -2130,9 +2140,9 @@ SELECT * FROM `test2`;
|
|||||||
a2
|
a2
|
||||||
1
|
1
|
||||||
SHOW TRIGGERS;
|
SHOW TRIGGERS;
|
||||||
Trigger Event Table Statement Timing Created sql_mode
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
testref INSERT test1 BEGIN
|
testref INSERT test1 BEGIN
|
||||||
INSERT INTO test2 SET a2 = NEW.a1; END BEFORE NULL
|
INSERT INTO test2 SET a2 = NEW.a1; END BEFORE NULL root@localhost
|
||||||
SELECT * FROM `test1`;
|
SELECT * FROM `test1`;
|
||||||
a1
|
a1
|
||||||
1
|
1
|
||||||
@ -2147,6 +2157,7 @@ DROP FUNCTION IF EXISTS bug9056_func1;
|
|||||||
DROP FUNCTION IF EXISTS bug9056_func2;
|
DROP FUNCTION IF EXISTS bug9056_func2;
|
||||||
DROP PROCEDURE IF EXISTS bug9056_proc1;
|
DROP PROCEDURE IF EXISTS bug9056_proc1;
|
||||||
DROP PROCEDURE IF EXISTS bug9056_proc2;
|
DROP PROCEDURE IF EXISTS bug9056_proc2;
|
||||||
|
DROP PROCEDURE IF EXISTS `a'b`;
|
||||||
CREATE TABLE t1 (id int);
|
CREATE TABLE t1 (id int);
|
||||||
INSERT INTO t1 VALUES(1), (2), (3), (4), (5);
|
INSERT INTO t1 VALUES(1), (2), (3), (4), (5);
|
||||||
CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b //
|
CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b //
|
||||||
|
@ -306,11 +306,21 @@ count(*)
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (
|
create table t1 (
|
||||||
a char(10) primary key
|
a char(10) primary key
|
||||||
) engine=ndb;
|
) engine=ndbcluster default charset=latin1;
|
||||||
insert into t1 values ('jonas % ');
|
insert into t1 values ('aaabb');
|
||||||
replace into t1 values ('jonas % ');
|
|
||||||
replace into t1 values ('jonas % ');
|
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
jonas %
|
aaabb
|
||||||
|
replace into t1 set a = 'AAABB';
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
AAABB
|
||||||
|
replace into t1 set a = 'aAaBb';
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
aAaBb
|
||||||
|
replace into t1 set a = 'aaabb';
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
aaabb
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@ -108,3 +108,9 @@ insert into t1 values (3);
|
|||||||
insert into t1 values (4);
|
insert into t1 values (4);
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`id` int(11) default NULL
|
||||||
|
) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id
|
||||||
|
drop table t1;
|
||||||
|
43
mysql-test/r/read_only.result
Normal file
43
mysql-test/r/read_only.result
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
DROP TABLE IF EXISTS t1,t2,t3;
|
||||||
|
grant CREATE, SELECT, DROP on *.* to test@localhost;
|
||||||
|
set global read_only=0;
|
||||||
|
create table t1 (a int);
|
||||||
|
insert into t1 values(1);
|
||||||
|
create table t2 select * from t1;
|
||||||
|
set global read_only=1;
|
||||||
|
create table t3 (a int);
|
||||||
|
drop table t3;
|
||||||
|
select @@global.read_only;
|
||||||
|
@@global.read_only
|
||||||
|
1
|
||||||
|
create table t3 (a int);
|
||||||
|
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||||
|
insert into t1 values(1);
|
||||||
|
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||||
|
update t1 set a=1 where 1=0;
|
||||||
|
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||||
|
update t1,t2 set t1.a=t2.a+1 where t1.a=t2.a;
|
||||||
|
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||||
|
delete t1,t2 from t1,t2 where t1.a=t2.a;
|
||||||
|
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||||
|
create temporary table t3 (a int);
|
||||||
|
create temporary table t4 (a int) select * from t3;
|
||||||
|
insert into t3 values(1);
|
||||||
|
insert into t4 select * from t3;
|
||||||
|
update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
|
||||||
|
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||||
|
update t1,t3 set t3.a=t1.a+1 where t1.a=t3.a;
|
||||||
|
update t4,t3 set t4.a=t3.a+1 where t4.a=t3.a;
|
||||||
|
delete t1 from t1,t3 where t1.a=t3.a;
|
||||||
|
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||||
|
delete t3 from t1,t3 where t1.a=t3.a;
|
||||||
|
delete t4 from t3,t4 where t4.a=t3.a;
|
||||||
|
create temporary table t1 (a int);
|
||||||
|
insert into t1 values(1);
|
||||||
|
update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
|
||||||
|
delete t1 from t1,t3 where t1.a=t3.a;
|
||||||
|
drop table t1;
|
||||||
|
insert into t1 values(1);
|
||||||
|
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||||
|
drop table t1,t2;
|
||||||
|
drop user test@localhost;
|
@ -1465,13 +1465,13 @@ flush logs;
|
|||||||
|
|
||||||
-------- switch to master -------
|
-------- switch to master -------
|
||||||
SHOW TRIGGERS;
|
SHOW TRIGGERS;
|
||||||
Trigger Event Table Statement Timing Created sql_mode
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
trg1 INSERT t1 SET @a:=1 BEFORE NULL
|
trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost
|
||||||
|
|
||||||
-------- switch to slave -------
|
-------- switch to slave -------
|
||||||
SHOW TRIGGERS;
|
SHOW TRIGGERS;
|
||||||
Trigger Event Table Statement Timing Created sql_mode
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
trg1 INSERT t1 SET @a:=1 BEFORE NULL
|
trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost
|
||||||
|
|
||||||
######## DROP TRIGGER trg1 ########
|
######## DROP TRIGGER trg1 ########
|
||||||
|
|
||||||
@ -1520,11 +1520,11 @@ flush logs;
|
|||||||
|
|
||||||
-------- switch to master -------
|
-------- switch to master -------
|
||||||
SHOW TRIGGERS;
|
SHOW TRIGGERS;
|
||||||
Trigger Event Table Statement Timing Created sql_mode
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
|
|
||||||
-------- switch to slave -------
|
-------- switch to slave -------
|
||||||
SHOW TRIGGERS;
|
SHOW TRIGGERS;
|
||||||
Trigger Event Table Statement Timing Created sql_mode
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
|
|
||||||
######## CREATE USER user1@localhost ########
|
######## CREATE USER user1@localhost ########
|
||||||
|
|
||||||
|
@ -4,16 +4,11 @@ reset master;
|
|||||||
reset slave;
|
reset slave;
|
||||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
start slave;
|
start slave;
|
||||||
create database if not exists mysqltest1;
|
drop database if exists mysqltest1;
|
||||||
|
create database mysqltest1;
|
||||||
use mysqltest1;
|
use mysqltest1;
|
||||||
create table t1 (a varchar(100));
|
create table t1 (a varchar(100));
|
||||||
use mysqltest1;
|
use mysqltest1;
|
||||||
drop procedure if exists foo;
|
|
||||||
drop procedure if exists foo2;
|
|
||||||
drop procedure if exists foo3;
|
|
||||||
drop procedure if exists foo4;
|
|
||||||
drop procedure if exists bar;
|
|
||||||
drop function if exists fn1;
|
|
||||||
create procedure foo()
|
create procedure foo()
|
||||||
begin
|
begin
|
||||||
declare b int;
|
declare b int;
|
||||||
@ -21,21 +16,9 @@ set b = 8;
|
|||||||
insert into t1 values (b);
|
insert into t1 values (b);
|
||||||
insert into t1 values (unix_timestamp());
|
insert into t1 values (unix_timestamp());
|
||||||
end|
|
end|
|
||||||
ERROR HY000: This routine has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_routine_creators variable)
|
|
||||||
show binlog events from 98|
|
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
|
||||||
master-bin.000001 # Query 1 # create database if not exists mysqltest1
|
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a varchar(100))
|
|
||||||
create procedure foo() deterministic
|
|
||||||
begin
|
|
||||||
declare b int;
|
|
||||||
set b = 8;
|
|
||||||
insert into t1 values (b);
|
|
||||||
insert into t1 values (unix_timestamp());
|
|
||||||
end|
|
|
||||||
select * from mysql.proc where name='foo' and db='mysqltest1';
|
select * from mysql.proc where name='foo' and db='mysqltest1';
|
||||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
|
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
|
||||||
mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL YES DEFINER begin
|
mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
|
||||||
declare b int;
|
declare b int;
|
||||||
set b = 8;
|
set b = 8;
|
||||||
insert into t1 values (b);
|
insert into t1 values (b);
|
||||||
@ -43,7 +26,7 @@ insert into t1 values (unix_timestamp());
|
|||||||
end root@localhost # #
|
end root@localhost # #
|
||||||
select * from mysql.proc where name='foo' and db='mysqltest1';
|
select * from mysql.proc where name='foo' and db='mysqltest1';
|
||||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
|
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
|
||||||
mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL YES DEFINER begin
|
mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
|
||||||
declare b int;
|
declare b int;
|
||||||
set b = 8;
|
set b = 8;
|
||||||
insert into t1 values (b);
|
insert into t1 values (b);
|
||||||
@ -51,17 +34,6 @@ insert into t1 values (unix_timestamp());
|
|||||||
end @ # #
|
end @ # #
|
||||||
set timestamp=1000000000;
|
set timestamp=1000000000;
|
||||||
call foo();
|
call foo();
|
||||||
show binlog events from 308;
|
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo() deterministic
|
|
||||||
begin
|
|
||||||
declare b int;
|
|
||||||
set b = 8;
|
|
||||||
insert into t1 values (b);
|
|
||||||
insert into t1 values (unix_timestamp());
|
|
||||||
end
|
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8))
|
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (unix_timestamp())
|
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
8
|
8
|
||||||
@ -72,22 +44,10 @@ a
|
|||||||
1000000000
|
1000000000
|
||||||
delete from t1;
|
delete from t1;
|
||||||
create procedure foo2()
|
create procedure foo2()
|
||||||
not deterministic
|
|
||||||
reads sql data
|
|
||||||
select * from mysqltest1.t1;
|
select * from mysqltest1.t1;
|
||||||
call foo2();
|
call foo2();
|
||||||
a
|
a
|
||||||
show binlog events from 518;
|
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8))
|
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (unix_timestamp())
|
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
|
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo2()
|
|
||||||
not deterministic
|
|
||||||
reads sql data
|
|
||||||
select * from mysqltest1.t1
|
|
||||||
alter procedure foo2 contains sql;
|
alter procedure foo2 contains sql;
|
||||||
ERROR HY000: This routine has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_routine_creators variable)
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (a int);
|
create table t1 (a int);
|
||||||
create table t2 like t1;
|
create table t2 like t1;
|
||||||
@ -99,80 +59,62 @@ grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1;
|
|||||||
grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
|
grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
|
||||||
create procedure foo4()
|
create procedure foo4()
|
||||||
deterministic
|
deterministic
|
||||||
insert into t1 values (10);
|
|
||||||
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_routine_creators variable)
|
|
||||||
set global log_bin_trust_routine_creators=1;
|
|
||||||
create procedure foo4()
|
|
||||||
deterministic
|
|
||||||
begin
|
begin
|
||||||
insert into t2 values(3);
|
insert into t2 values(3);
|
||||||
insert into t1 values (5);
|
insert into t1 values (5);
|
||||||
end|
|
end|
|
||||||
call foo4();
|
call foo4();
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
show warnings;
|
|
||||||
Level Code Message
|
|
||||||
Error 1142 INSERT command denied to user 'zedjzlcsjhd'@'localhost' for table 't1'
|
|
||||||
Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
|
|
||||||
call foo3();
|
call foo3();
|
||||||
show warnings;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
call foo4();
|
call foo4();
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
show warnings;
|
|
||||||
Level Code Message
|
|
||||||
Error 1142 INSERT command denied to user 'zedjzlcsjhd'@'127.0.0.1' for table 't1'
|
|
||||||
Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
|
|
||||||
alter procedure foo4 sql security invoker;
|
alter procedure foo4 sql security invoker;
|
||||||
call foo4();
|
call foo4();
|
||||||
show warnings;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
show binlog events from 990;
|
select * from t1;
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
a
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1
|
15
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int)
|
5
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 like t1
|
select * from t2;
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo3()
|
a
|
||||||
deterministic
|
3
|
||||||
insert into t1 values (15)
|
3
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1
|
3
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1
|
select * from t1;
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1
|
a
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo4()
|
15
|
||||||
|
5
|
||||||
|
select * from t2;
|
||||||
|
a
|
||||||
|
3
|
||||||
|
3
|
||||||
|
3
|
||||||
|
delete from t2;
|
||||||
|
alter table t2 add unique (a);
|
||||||
|
drop procedure foo4;
|
||||||
|
create procedure foo4()
|
||||||
deterministic
|
deterministic
|
||||||
begin
|
begin
|
||||||
insert into t2 values(3);
|
insert into t2 values(20),(20);
|
||||||
insert into t1 values (5);
|
end|
|
||||||
end
|
call foo4();
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3)
|
ERROR 23000: Duplicate entry '20' for key 1
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (15)
|
show warnings;
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3)
|
Level Code Message
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; alter procedure foo4 sql security invoker
|
Error 1062 Duplicate entry '20' for key 1
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3)
|
|
||||||
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (5)
|
|
||||||
select * from t1;
|
|
||||||
a
|
|
||||||
15
|
|
||||||
5
|
|
||||||
select * from t2;
|
select * from t2;
|
||||||
a
|
a
|
||||||
3
|
20
|
||||||
3
|
|
||||||
3
|
|
||||||
select * from t1;
|
|
||||||
a
|
|
||||||
15
|
|
||||||
5
|
|
||||||
select * from t2;
|
select * from t2;
|
||||||
a
|
a
|
||||||
3
|
20
|
||||||
3
|
|
||||||
3
|
|
||||||
select * from mysql.proc where name="foo4" and db='mysqltest1';
|
select * from mysql.proc where name="foo4" and db='mysqltest1';
|
||||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
|
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
|
||||||
mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES INVOKER begin
|
mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin
|
||||||
insert into t2 values(3);
|
insert into t2 values(20),(20);
|
||||||
insert into t1 values (5);
|
|
||||||
end @ # #
|
end @ # #
|
||||||
drop procedure foo4;
|
drop procedure foo4;
|
||||||
select * from mysql.proc where name="foo4" and db='mysqltest1';
|
select * from mysql.proc where name="foo4" and db='mysqltest1';
|
||||||
@ -184,6 +126,13 @@ drop procedure foo2;
|
|||||||
drop procedure foo3;
|
drop procedure foo3;
|
||||||
create function fn1(x int)
|
create function fn1(x int)
|
||||||
returns int
|
returns int
|
||||||
|
begin
|
||||||
|
insert into t1 values (x);
|
||||||
|
return x+2;
|
||||||
|
end|
|
||||||
|
ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
|
||||||
|
create function fn1(x int)
|
||||||
|
returns int
|
||||||
deterministic
|
deterministic
|
||||||
begin
|
begin
|
||||||
insert into t1 values (x);
|
insert into t1 values (x);
|
||||||
@ -211,18 +160,55 @@ a
|
|||||||
drop function fn1;
|
drop function fn1;
|
||||||
create function fn1()
|
create function fn1()
|
||||||
returns int
|
returns int
|
||||||
deterministic
|
no sql
|
||||||
begin
|
begin
|
||||||
return unix_timestamp();
|
return unix_timestamp();
|
||||||
end|
|
end|
|
||||||
|
alter function fn1 contains sql;
|
||||||
|
ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
|
||||||
delete from t1;
|
delete from t1;
|
||||||
set timestamp=1000000000;
|
set timestamp=1000000000;
|
||||||
insert into t1 values(fn1());
|
insert into t1 values(fn1());
|
||||||
|
create function fn2()
|
||||||
|
returns int
|
||||||
|
no sql
|
||||||
|
begin
|
||||||
|
return unix_timestamp();
|
||||||
|
end|
|
||||||
|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
|
||||||
|
set global log_bin_trust_routine_creators=1;
|
||||||
|
Warnings:
|
||||||
|
Warning 1287 'log_bin_trust_routine_creators' is deprecated; use 'log_bin_trust_function_creators' instead
|
||||||
|
set global log_bin_trust_function_creators=0;
|
||||||
|
set global log_bin_trust_function_creators=1;
|
||||||
|
set global log_bin_trust_function_creators=1;
|
||||||
|
create function fn2()
|
||||||
|
returns int
|
||||||
|
no sql
|
||||||
|
begin
|
||||||
|
return unix_timestamp();
|
||||||
|
end|
|
||||||
|
create function fn3()
|
||||||
|
returns int
|
||||||
|
not deterministic
|
||||||
|
reads sql data
|
||||||
|
begin
|
||||||
|
return 0;
|
||||||
|
end|
|
||||||
|
select fn3();
|
||||||
|
fn3()
|
||||||
|
0
|
||||||
select * from mysql.proc where db='mysqltest1';
|
select * from mysql.proc where db='mysqltest1';
|
||||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
|
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
|
||||||
mysqltest1 fn1 FUNCTION fn1 SQL CONTAINS_SQL YES DEFINER int(11) begin
|
mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
|
||||||
return unix_timestamp();
|
return unix_timestamp();
|
||||||
end root@localhost # #
|
end root@localhost # #
|
||||||
|
mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
|
||||||
|
return unix_timestamp();
|
||||||
|
end zedjzlcsjhd@localhost # #
|
||||||
|
mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
|
||||||
|
return 0;
|
||||||
|
end root@localhost # #
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
1000000000
|
1000000000
|
||||||
@ -232,12 +218,34 @@ a
|
|||||||
1000000000
|
1000000000
|
||||||
select * from mysql.proc where db='mysqltest1';
|
select * from mysql.proc where db='mysqltest1';
|
||||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
|
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
|
||||||
mysqltest1 fn1 FUNCTION fn1 SQL CONTAINS_SQL YES DEFINER int(11) begin
|
mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
|
||||||
return unix_timestamp();
|
return unix_timestamp();
|
||||||
end @ # #
|
end @ # #
|
||||||
|
mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
|
||||||
|
return unix_timestamp();
|
||||||
|
end @ # #
|
||||||
|
mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
|
||||||
|
return 0;
|
||||||
|
end @ # #
|
||||||
|
delete from t2;
|
||||||
|
alter table t2 add unique (a);
|
||||||
|
drop function fn1;
|
||||||
|
create function fn1()
|
||||||
|
returns int
|
||||||
|
begin
|
||||||
|
insert into t2 values(20),(20);
|
||||||
|
return 10;
|
||||||
|
end|
|
||||||
|
select fn1();
|
||||||
|
ERROR 23000: Duplicate entry '20' for key 1
|
||||||
|
select * from t2;
|
||||||
|
a
|
||||||
|
20
|
||||||
|
select * from t2;
|
||||||
|
a
|
||||||
|
20
|
||||||
create trigger trg before insert on t1 for each row set new.a= 10;
|
create trigger trg before insert on t1 for each row set new.a= 10;
|
||||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||||
flush logs;
|
|
||||||
delete from t1;
|
delete from t1;
|
||||||
create trigger trg before insert on t1 for each row set new.a= 10;
|
create trigger trg before insert on t1 for each row set new.a= 10;
|
||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
@ -253,14 +261,106 @@ insert into t1 values (1);
|
|||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
show binlog events in 'master-bin.000002' from 98;
|
show binlog events in 'master-bin.000001' from 98;
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000002 # Query 1 # use `mysqltest1`; delete from t1
|
master-bin.000001 # Query 1 # drop database if exists mysqltest1
|
||||||
master-bin.000002 # Query 1 # use `mysqltest1`; create trigger trg before insert on t1 for each row set new.a= 10
|
master-bin.000001 # Query 1 # create database mysqltest1
|
||||||
master-bin.000002 # Query 1 # use `mysqltest1`; insert into t1 values (1)
|
master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a varchar(100))
|
||||||
master-bin.000002 # Query 1 # use `mysqltest1`; delete from t1
|
master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo()
|
||||||
master-bin.000002 # Query 1 # use `mysqltest1`; drop trigger trg
|
begin
|
||||||
master-bin.000002 # Query 1 # use `mysqltest1`; insert into t1 values (1)
|
declare b int;
|
||||||
|
set b = 8;
|
||||||
|
insert into t1 values (b);
|
||||||
|
insert into t1 values (unix_timestamp());
|
||||||
|
end
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8))
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (unix_timestamp())
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo2()
|
||||||
|
select * from mysqltest1.t1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; alter procedure foo2 contains sql
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 like t1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo3()
|
||||||
|
deterministic
|
||||||
|
insert into t1 values (15)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo4()
|
||||||
|
deterministic
|
||||||
|
begin
|
||||||
|
insert into t2 values(3);
|
||||||
|
insert into t1 values (5);
|
||||||
|
end
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (15)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; alter procedure foo4 sql security invoker
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(3)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (5)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo4
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo4()
|
||||||
|
deterministic
|
||||||
|
begin
|
||||||
|
insert into t2 values(20),(20);
|
||||||
|
end
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(20),(20)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo4
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo2
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; drop procedure foo3
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create function fn1(x int)
|
||||||
|
returns int
|
||||||
|
deterministic
|
||||||
|
begin
|
||||||
|
insert into t1 values (x);
|
||||||
|
return x+2;
|
||||||
|
end
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; delete t1,t2 from t1,t2
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; DO `fn1`(20)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(fn1(21))
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create function fn1()
|
||||||
|
returns int
|
||||||
|
no sql
|
||||||
|
begin
|
||||||
|
return unix_timestamp();
|
||||||
|
end
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(fn1())
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create function fn2()
|
||||||
|
returns int
|
||||||
|
no sql
|
||||||
|
begin
|
||||||
|
return unix_timestamp();
|
||||||
|
end
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create function fn3()
|
||||||
|
returns int
|
||||||
|
not deterministic
|
||||||
|
reads sql data
|
||||||
|
begin
|
||||||
|
return 0;
|
||||||
|
end
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; create function fn1()
|
||||||
|
returns int
|
||||||
|
begin
|
||||||
|
insert into t2 values(20),(20);
|
||||||
|
return 10;
|
||||||
|
end
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; DO `fn1`()
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1)
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; drop trigger trg
|
||||||
|
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1)
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
@ -275,3 +375,28 @@ drop procedure foo;
|
|||||||
drop function fn1;
|
drop function fn1;
|
||||||
drop database mysqltest1;
|
drop database mysqltest1;
|
||||||
drop user "zedjzlcsjhd"@127.0.0.1;
|
drop user "zedjzlcsjhd"@127.0.0.1;
|
||||||
|
use test;
|
||||||
|
use test;
|
||||||
|
drop function if exists f1;
|
||||||
|
create function f1() returns int reads sql data
|
||||||
|
begin
|
||||||
|
declare var integer;
|
||||||
|
declare c cursor for select a from v1;
|
||||||
|
open c;
|
||||||
|
fetch c into var;
|
||||||
|
close c;
|
||||||
|
return var;
|
||||||
|
end|
|
||||||
|
create view v1 as select 1 as a;
|
||||||
|
create table t1 (a int);
|
||||||
|
insert into t1 (a) values (f1());
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
drop view v1;
|
||||||
|
drop function f1;
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
drop table t1;
|
||||||
|
reset master;
|
||||||
|
@ -89,8 +89,24 @@ insert into t1 set a = now();
|
|||||||
select a=b && a=c from t1;
|
select a=b && a=c from t1;
|
||||||
a=b && a=c
|
a=b && a=c
|
||||||
1
|
1
|
||||||
|
SELECT routine_name, definer
|
||||||
|
FROM information_schema.routines;
|
||||||
|
routine_name definer
|
||||||
|
bug12480 root@localhost
|
||||||
|
SELECT trigger_name, definer
|
||||||
|
FROM information_schema.triggers;
|
||||||
|
trigger_name definer
|
||||||
|
t1_first root@localhost
|
||||||
|
|
||||||
--- On slave --
|
--- On slave --
|
||||||
|
SELECT routine_name, definer
|
||||||
|
FROM information_schema.routines;
|
||||||
|
routine_name definer
|
||||||
|
bug12480 @
|
||||||
|
SELECT trigger_name, definer
|
||||||
|
FROM information_schema.triggers;
|
||||||
|
trigger_name definer
|
||||||
|
t1_first root@localhost
|
||||||
select a=b && a=c from t1;
|
select a=b && a=c from t1;
|
||||||
a=b && a=c
|
a=b && a=c
|
||||||
1
|
1
|
||||||
|
@ -3241,3 +3241,45 @@ f1 f2
|
|||||||
Warnings:
|
Warnings:
|
||||||
Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1
|
Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (f1 int, f2 int);
|
||||||
|
insert into t1 values (1, 30), (2, 20), (3, 10);
|
||||||
|
create algorithm=merge view v1 as select f1, f2 from t1;
|
||||||
|
create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1;
|
||||||
|
create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1;
|
||||||
|
select t1.f1 as x1, f1 from t1 order by t1.f1;
|
||||||
|
x1 f1
|
||||||
|
1 1
|
||||||
|
2 2
|
||||||
|
3 3
|
||||||
|
select v1.f1 as x1, f1 from v1 order by v1.f1;
|
||||||
|
x1 f1
|
||||||
|
1 1
|
||||||
|
2 2
|
||||||
|
3 3
|
||||||
|
select v2.f1 as x1, f1 from v2 order by v2.f1;
|
||||||
|
x1 f1
|
||||||
|
10 10
|
||||||
|
20 20
|
||||||
|
30 30
|
||||||
|
select v3.f1 as x1, f1 from v3 order by v3.f1;
|
||||||
|
x1 f1
|
||||||
|
10 10
|
||||||
|
20 20
|
||||||
|
30 30
|
||||||
|
select f1, f2, v1.f1 as x1 from v1 order by v1.f1;
|
||||||
|
f1 f2 x1
|
||||||
|
1 30 1
|
||||||
|
2 20 2
|
||||||
|
3 10 3
|
||||||
|
select f1, f2, v2.f1 as x1 from v2 order by v2.f1;
|
||||||
|
f1 f2 x1
|
||||||
|
10 3 10
|
||||||
|
20 2 20
|
||||||
|
30 1 30
|
||||||
|
select f1, f2, v3.f1 as x1 from v3 order by v3.f1;
|
||||||
|
f1 f2 x1
|
||||||
|
10 3 10
|
||||||
|
20 2 20
|
||||||
|
30 1 30
|
||||||
|
drop table t1;
|
||||||
|
drop view v1, v2, v3;
|
||||||
|
@ -564,3 +564,21 @@ DROP TABLE tyt2;
|
|||||||
DROP TABLE urkunde;
|
DROP TABLE urkunde;
|
||||||
SHOW TABLES FROM non_existing_database;
|
SHOW TABLES FROM non_existing_database;
|
||||||
ERROR 42000: Unknown database 'non_existing_database'
|
ERROR 42000: Unknown database 'non_existing_database'
|
||||||
|
SHOW AUTHORS;
|
||||||
|
Name Location Comment
|
||||||
|
Brian "Krow" Aker Seattle, WA. USA Architecture, archive, federated, buncha of little stuff :)
|
||||||
|
David Axmark Uppsala, Sweden Small stuff long time ago, Monty ripped it out!
|
||||||
|
Omer BarNir Sunnyvale, CA. USA Testing (sometimes) and general QA stuff
|
||||||
|
Nikolay Grishakin Austin, TX. USA Testing - Server
|
||||||
|
Serge Kozlov Velikie Luki, Russia Testing - Cluster
|
||||||
|
Matthias Leich Berlin, Germany Testing - Server
|
||||||
|
Jonathan (Jeb) Miller Kyle, TX. USA Testing - Cluster, Replication
|
||||||
|
Carsten Segieth (Pino) Fredersdorf, Germany Testing - Server
|
||||||
|
Punita Srivastava Austin, TX. USA Testing - Merlin
|
||||||
|
Alexey Stroganov (Ranger) Lugansk, Ukraine Testing - Benchmarks
|
||||||
|
Oleksandr Byelkin Lugansk, Ukraine Query Cache (4.0), Subqueries (4.1), Views (5.0)
|
||||||
|
Dmitri Lenev Moscow, Russia Time zones support (4.1), Triggers (5.0)
|
||||||
|
Konstantin Osipov Moscow, Russia Prepared statements (4.1), Cursors (5.0)
|
||||||
|
Petr Chardin Moscow, Russia Instance Manager (5.0)
|
||||||
|
Sergey Vojtovich Izhevsk, Russia Plugins infrastructure (5.1)
|
||||||
|
Alexander Nozdrin Moscow, Russia Bugfixing (Stored Procedures, 5.0)
|
||||||
|
@ -4,7 +4,7 @@ drop procedure if exists f1;
|
|||||||
use test;
|
use test;
|
||||||
create table t1 (field1 INT);
|
create table t1 (field1 INT);
|
||||||
CREATE VIEW v1 AS SELECT field1 FROM t1;
|
CREATE VIEW v1 AS SELECT field1 FROM t1;
|
||||||
ERROR HY000: View definer is not fully qualified
|
ERROR HY000: Definer is not fully qualified
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create procedure f1() select 1;
|
create procedure f1() select 1;
|
||||||
drop procedure f1;
|
drop procedure f1;
|
||||||
|
@ -845,6 +845,8 @@ set password = 'foo1';
|
|||||||
select password;
|
select password;
|
||||||
end|
|
end|
|
||||||
ERROR 42000: Variable 'password' must be quoted with `...`, or renamed
|
ERROR 42000: Variable 'password' must be quoted with `...`, or renamed
|
||||||
|
set names='foo2'|
|
||||||
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
||||||
create procedure bug13510_2()
|
create procedure bug13510_2()
|
||||||
begin
|
begin
|
||||||
declare names varchar(10);
|
declare names varchar(10);
|
||||||
@ -872,6 +874,127 @@ names
|
|||||||
foo4
|
foo4
|
||||||
drop procedure bug13510_3|
|
drop procedure bug13510_3|
|
||||||
drop procedure bug13510_4|
|
drop procedure bug13510_4|
|
||||||
|
drop function if exists bug_13627_f|
|
||||||
|
CREATE TABLE t1 (a int)|
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DROP TRIGGER test1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN DROP TRIGGER test1; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN load table t1 from master; END |
|
||||||
|
ERROR 0A000: LOAD TABLE is not allowed in stored procedures
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN load table t1 from master; return 1; END |
|
||||||
|
ERROR 0A000: LOAD TABLE is not allowed in stored procedures
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create table t2 (a int); END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create table t2 (a int); return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create index t1_i on t1 (a); END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create index t1_i on t1 (a); return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN alter table t1 add column b int; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN alter table t1 add column b int; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN rename table t1 to t2; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN rename table t1 to t2; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN truncate table t1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN truncate table t1; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop table t1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop table t1; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop index t1_i on t1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop index t1_i on t1; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN unlock tables; END |
|
||||||
|
ERROR 0A000: UNLOCK is not allowed in stored procedures
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN unlock tables; return 1; END |
|
||||||
|
ERROR 0A000: UNLOCK is not allowed in stored procedures
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN LOCK TABLE t1 READ; END |
|
||||||
|
ERROR 0A000: LOCK is not allowed in stored procedures
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN LOCK TABLE t1 READ; return 1; END |
|
||||||
|
ERROR 0A000: LOCK is not allowed in stored procedures
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create database mysqltest; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create database mysqltest; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop database mysqltest; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop database mysqltest; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create user 'mysqltest_1'; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create user 'mysqltest_1'; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop user 'mysqltest_1'; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop user 'mysqltest_1'; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN rename user 'mysqltest_2' to 'mysqltest_1'; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN rename user 'mysqltest_2' to 'mysqltest_1'; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create view v1 as select 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create view v1 as select 1; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN alter view v1 as select 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN alter view v1 as select 1; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop view v1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop view v1; return 1; END |
|
||||||
|
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create trigger tr2 before insert on t1 for each row do select 1; END |
|
||||||
|
ERROR 2F003: Can't create a TRIGGER from within another stored routine
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create trigger tr2 before insert on t1 for each row do select 1; return 1; END |
|
||||||
|
ERROR 2F003: Can't create a TRIGGER from within another stored routine
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop function bug_13627_f; END |
|
||||||
|
ERROR HY000: Can't drop or alter a FUNCTION from within another stored routine
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop function bug_13627_f; return 1; END |
|
||||||
|
ERROR HY000: Can't drop or alter a FUNCTION from within another stored routine
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create function f2 () returns int return 1; END |
|
||||||
|
ERROR 2F003: Can't create a FUNCTION from within another stored routine
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create function f2 () returns int return 1; return 1; END |
|
||||||
|
ERROR 2F003: Can't create a FUNCTION from within another stored routine
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
CREATE TEMPORARY TABLE t2 (a int);
|
||||||
|
DROP TEMPORARY TABLE t2;
|
||||||
|
END |
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int
|
||||||
|
BEGIN
|
||||||
|
CREATE TEMPORARY TABLE t2 (a int);
|
||||||
|
DROP TEMPORARY TABLE t2;
|
||||||
|
return 1;
|
||||||
|
END |
|
||||||
|
drop table t1|
|
||||||
|
drop function bug_13627_f|
|
||||||
|
drop function if exists bug12329;
|
||||||
|
create table t1 as select 1 a;
|
||||||
|
create table t2 as select 1 a;
|
||||||
|
create function bug12329() returns int return (select a from t1);
|
||||||
|
prepare stmt1 from 'select bug12329()';
|
||||||
|
execute stmt1;
|
||||||
|
bug12329()
|
||||||
|
1
|
||||||
|
drop function bug12329;
|
||||||
|
create function bug12329() returns int return (select a+100 from t2);
|
||||||
|
select bug12329();
|
||||||
|
bug12329()
|
||||||
|
101
|
||||||
|
execute stmt1;
|
||||||
|
ERROR HY000: Table 't2' was not locked with LOCK TABLES
|
||||||
|
deallocate prepare stmt1;
|
||||||
|
drop function bug12329;
|
||||||
|
drop table t1, t2;
|
||||||
create database mysqltest1;
|
create database mysqltest1;
|
||||||
use mysqltest1;
|
use mysqltest1;
|
||||||
drop database mysqltest1;
|
drop database mysqltest1;
|
||||||
@ -916,3 +1039,16 @@ ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
|
|||||||
DROP PROCEDURE bug13037_p1;
|
DROP PROCEDURE bug13037_p1;
|
||||||
DROP PROCEDURE bug13037_p2;
|
DROP PROCEDURE bug13037_p2;
|
||||||
DROP PROCEDURE bug13037_p3;
|
DROP PROCEDURE bug13037_p3;
|
||||||
|
create database mysqltest1;
|
||||||
|
create database mysqltest2;
|
||||||
|
use mysqltest1;
|
||||||
|
drop database mysqltest1;
|
||||||
|
create procedure mysqltest2.p1() select version();
|
||||||
|
create procedure p2() select version();
|
||||||
|
ERROR 3D000: No database selected
|
||||||
|
use mysqltest2;
|
||||||
|
show procedure status;
|
||||||
|
Db Name Type Definer Modified Created Security_type Comment
|
||||||
|
mysqltest2 p1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
|
||||||
|
drop database mysqltest2;
|
||||||
|
use test;
|
||||||
|
@ -3617,4 +3617,54 @@ count(*)
|
|||||||
drop table t3, t4|
|
drop table t3, t4|
|
||||||
drop procedure bug14210|
|
drop procedure bug14210|
|
||||||
set @@session.max_heap_table_size=default|
|
set @@session.max_heap_table_size=default|
|
||||||
|
drop function if exists bug14723|
|
||||||
|
drop procedure if exists bug14723|
|
||||||
|
/*!50003 create function bug14723()
|
||||||
|
returns bigint(20)
|
||||||
|
main_loop: begin
|
||||||
|
return 42;
|
||||||
|
end */;;
|
||||||
|
show create function bug14723;;
|
||||||
|
Function sql_mode Create Function
|
||||||
|
bug14723 CREATE FUNCTION `bug14723`() RETURNS bigint(20)
|
||||||
|
main_loop: begin
|
||||||
|
return 42;
|
||||||
|
end
|
||||||
|
select bug14723();;
|
||||||
|
bug14723()
|
||||||
|
42
|
||||||
|
/*!50003 create procedure bug14723()
|
||||||
|
main_loop: begin
|
||||||
|
select 42;
|
||||||
|
end */;;
|
||||||
|
show create procedure bug14723;;
|
||||||
|
Procedure sql_mode Create Procedure
|
||||||
|
bug14723 CREATE PROCEDURE `bug14723`()
|
||||||
|
main_loop: begin
|
||||||
|
select 42;
|
||||||
|
end
|
||||||
|
call bug14723();;
|
||||||
|
42
|
||||||
|
42
|
||||||
|
drop function bug14723|
|
||||||
|
drop procedure bug14723|
|
||||||
|
create procedure bug14845()
|
||||||
|
begin
|
||||||
|
declare a char(255);
|
||||||
|
declare done int default 0;
|
||||||
|
declare c cursor for select count(*) from t1 where 1 = 0;
|
||||||
|
declare continue handler for sqlstate '02000' set done = 1;
|
||||||
|
open c;
|
||||||
|
repeat
|
||||||
|
fetch c into a;
|
||||||
|
if not done then
|
||||||
|
select a;
|
||||||
|
end if;
|
||||||
|
until done end repeat;
|
||||||
|
close c;
|
||||||
|
end|
|
||||||
|
call bug14845()|
|
||||||
|
a
|
||||||
|
0
|
||||||
|
drop procedure bug14845|
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
@ -172,3 +172,75 @@ group by country;
|
|||||||
countrycount smcnt country total_funds
|
countrycount smcnt country total_funds
|
||||||
1 1200 USA 1200
|
1 1200 USA 1200
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`t3_id` int NOT NULL,
|
||||||
|
`t1_id` int NOT NULL,
|
||||||
|
PRIMARY KEY (`t1_id`)
|
||||||
|
);
|
||||||
|
CREATE TABLE `t2` (
|
||||||
|
`t2_id` int NOT NULL,
|
||||||
|
`t1_id` int NOT NULL,
|
||||||
|
`b` int NOT NULL,
|
||||||
|
PRIMARY KEY (`t2_id`),
|
||||||
|
UNIQUE KEY `idx_t2_t1_b` (`t1_id`,`b`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
CREATE TABLE `t3` (
|
||||||
|
`t3_id` int NOT NULL
|
||||||
|
);
|
||||||
|
INSERT INTO `t3` VALUES (3);
|
||||||
|
select
|
||||||
|
(SELECT rs.t2_id
|
||||||
|
FROM t2 rs
|
||||||
|
WHERE rs.t1_id=
|
||||||
|
(SELECT lt.t1_id
|
||||||
|
FROM t1 lt
|
||||||
|
WHERE lt.t3_id=a.t3_id)
|
||||||
|
ORDER BY b DESC LIMIT 1)
|
||||||
|
from t3 AS a;
|
||||||
|
(SELECT rs.t2_id
|
||||||
|
FROM t2 rs
|
||||||
|
WHERE rs.t1_id=
|
||||||
|
(SELECT lt.t1_id
|
||||||
|
FROM t1 lt
|
||||||
|
WHERE lt.t3_id=a.t3_id)
|
||||||
|
ORDER BY b DESC LIMIT 1)
|
||||||
|
NULL
|
||||||
|
DROP PROCEDURE IF EXISTS p1;
|
||||||
|
create procedure p1()
|
||||||
|
begin
|
||||||
|
declare done int default 3;
|
||||||
|
repeat
|
||||||
|
select
|
||||||
|
(SELECT rs.t2_id
|
||||||
|
FROM t2 rs
|
||||||
|
WHERE rs.t1_id=
|
||||||
|
(SELECT lt.t1_id
|
||||||
|
FROM t1 lt
|
||||||
|
WHERE lt.t3_id=a.t3_id)
|
||||||
|
ORDER BY b DESC LIMIT 1) as x
|
||||||
|
from t3 AS a;
|
||||||
|
set done= done-1;
|
||||||
|
until done <= 0 end repeat;
|
||||||
|
end//
|
||||||
|
call p1();
|
||||||
|
x
|
||||||
|
NULL
|
||||||
|
x
|
||||||
|
NULL
|
||||||
|
x
|
||||||
|
NULL
|
||||||
|
call p1();
|
||||||
|
x
|
||||||
|
NULL
|
||||||
|
x
|
||||||
|
NULL
|
||||||
|
x
|
||||||
|
NULL
|
||||||
|
call p1();
|
||||||
|
x
|
||||||
|
NULL
|
||||||
|
x
|
||||||
|
NULL
|
||||||
|
x
|
||||||
|
NULL
|
||||||
|
drop tables t1,t2,t3;
|
||||||
|
40
mysql-test/r/trigger-compat.result
Normal file
40
mysql-test/r/trigger-compat.result
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
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;
|
||||||
|
CREATE USER mysqltest_dfn@localhost;
|
||||||
|
CREATE USER mysqltest_inv@localhost;
|
||||||
|
GRANT SUPER ON *.* TO mysqltest_dfn@localhost;
|
||||||
|
GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
---> connection: wl2818_definer_con
|
||||||
|
CREATE TABLE t1(num_value INT);
|
||||||
|
CREATE TABLE t2(user_str TEXT);
|
||||||
|
CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
INSERT INTO t2 VALUES(CURRENT_USER());
|
||||||
|
|
||||||
|
---> patching t1.TRG...
|
||||||
|
|
||||||
|
CREATE TRIGGER wl2818_trg2 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
INSERT INTO t2 VALUES(CURRENT_USER());
|
||||||
|
Warnings:
|
||||||
|
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
|
||||||
|
|
||||||
|
SELECT trigger_name, definer FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
|
||||||
|
trigger_name definer
|
||||||
|
wl2818_trg1
|
||||||
|
wl2818_trg2 mysqltest_dfn@localhost
|
||||||
|
Warnings:
|
||||||
|
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
|
||||||
|
|
||||||
|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
|
||||||
|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||||
|
NULL mysqltest_db1 wl2818_trg1 INSERT NULL mysqltest_db1 t1 0 NULL
|
||||||
|
INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL
|
||||||
|
NULL mysqltest_db1 wl2818_trg2 INSERT NULL mysqltest_db1 t1 0 NULL
|
||||||
|
INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL mysqltest_dfn@localhost
|
238
mysql-test/r/trigger-grant.result
Normal file
238
mysql-test/r/trigger-grant.result
Normal file
@ -0,0 +1,238 @@
|
|||||||
|
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;
|
||||||
|
CREATE USER mysqltest_dfn@localhost;
|
||||||
|
CREATE USER mysqltest_inv@localhost;
|
||||||
|
GRANT SUPER ON *.* TO mysqltest_dfn@localhost;
|
||||||
|
GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
---> connection: wl2818_definer_con
|
||||||
|
CREATE TABLE t1(num_value INT);
|
||||||
|
CREATE TABLE t2(user_str TEXT);
|
||||||
|
CREATE TRIGGER trg1 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
INSERT INTO t2 VALUES(CURRENT_USER());
|
||||||
|
|
||||||
|
---> connection: default
|
||||||
|
GRANT ALL PRIVILEGES ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
|
||||||
|
GRANT ALL PRIVILEGES ON mysqltest_db1.t2 TO mysqltest_dfn@localhost;
|
||||||
|
GRANT ALL PRIVILEGES ON mysqltest_db1.t1
|
||||||
|
TO 'mysqltest_inv'@localhost;
|
||||||
|
GRANT SELECT ON mysqltest_db1.t2
|
||||||
|
TO 'mysqltest_inv'@localhost;
|
||||||
|
|
||||||
|
---> connection: wl2818_definer_con
|
||||||
|
use mysqltest_db1;
|
||||||
|
INSERT INTO t1 VALUES(1);
|
||||||
|
SELECT * FROM t1;
|
||||||
|
num_value
|
||||||
|
1
|
||||||
|
SELECT * FROM t2;
|
||||||
|
user_str
|
||||||
|
mysqltest_dfn@localhost
|
||||||
|
|
||||||
|
---> connection: wl2818_invoker_con
|
||||||
|
use mysqltest_db1;
|
||||||
|
INSERT INTO t1 VALUES(2);
|
||||||
|
SELECT * FROM t1;
|
||||||
|
num_value
|
||||||
|
1
|
||||||
|
2
|
||||||
|
SELECT * FROM t2;
|
||||||
|
user_str
|
||||||
|
mysqltest_dfn@localhost
|
||||||
|
mysqltest_dfn@localhost
|
||||||
|
|
||||||
|
---> connection: default
|
||||||
|
use mysqltest_db1;
|
||||||
|
REVOKE INSERT ON mysqltest_db1.t2 FROM mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
---> connection: wl2818_invoker_con
|
||||||
|
use mysqltest_db1;
|
||||||
|
INSERT INTO t1 VALUES(3);
|
||||||
|
ERROR 42000: INSERT command denied to user 'mysqltest_dfn'@'localhost' for table 't2'
|
||||||
|
SELECT * FROM t1;
|
||||||
|
num_value
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
SELECT * FROM t2;
|
||||||
|
user_str
|
||||||
|
mysqltest_dfn@localhost
|
||||||
|
mysqltest_dfn@localhost
|
||||||
|
|
||||||
|
---> connection: default
|
||||||
|
use mysqltest_db1;
|
||||||
|
REVOKE SELECT ON mysqltest_db1.t1 FROM mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
---> connection: wl2818_definer_con
|
||||||
|
use mysqltest_db1;
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
SET @new_sum = 0;
|
||||||
|
SET @old_sum = 0;
|
||||||
|
---> INSERT INTO statement; BEFORE timing
|
||||||
|
CREATE TRIGGER trg1 BEFORE INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
INSERT INTO t1 VALUES(4);
|
||||||
|
ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
---> INSERT INTO statement; AFTER timing
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE TRIGGER trg1 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
INSERT INTO t1 VALUES(5);
|
||||||
|
ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
---> UPDATE statement; BEFORE timing
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE TRIGGER trg1 BEFORE UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
UPDATE t1 SET num_value = 10;
|
||||||
|
ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
---> UPDATE statement; AFTER timing
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE TRIGGER trg1 AFTER UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
UPDATE t1 SET num_value = 20;
|
||||||
|
ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
---> DELETE statement; BEFORE timing
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE TRIGGER trg1 BEFORE DELETE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
DELETE FROM t1;
|
||||||
|
ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
---> DELETE statement; AFTER timing
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE TRIGGER trg1 AFTER DELETE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
DELETE FROM t1;
|
||||||
|
ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
|
||||||
|
---> connection: default
|
||||||
|
use mysqltest_db1;
|
||||||
|
GRANT SELECT ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
|
||||||
|
REVOKE UPDATE ON mysqltest_db1.t1 FROM mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
---> connection: wl2818_definer_con
|
||||||
|
use mysqltest_db1;
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
SET @new_sum = 0;
|
||||||
|
SET @old_sum = 0;
|
||||||
|
---> INSERT INTO statement; BEFORE timing
|
||||||
|
CREATE TRIGGER trg1 BEFORE INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
INSERT INTO t1 VALUES(4);
|
||||||
|
ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
---> INSERT INTO statement; AFTER timing
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE TRIGGER trg1 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
INSERT INTO t1 VALUES(5);
|
||||||
|
ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
---> UPDATE statement; BEFORE timing
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE TRIGGER trg1 BEFORE UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
UPDATE t1 SET num_value = 10;
|
||||||
|
ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
---> UPDATE statement; AFTER timing
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE TRIGGER trg1 AFTER UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
UPDATE t1 SET num_value = 20;
|
||||||
|
ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
---> DELETE statement; BEFORE timing
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE TRIGGER trg1 BEFORE DELETE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
DELETE FROM t1;
|
||||||
|
ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
---> DELETE statement; AFTER timing
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE TRIGGER trg1 AFTER DELETE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
DELETE FROM t1;
|
||||||
|
ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
|
||||||
|
|
||||||
|
---> connection: wl2818_definer_con
|
||||||
|
use mysqltest_db1;
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
CREATE DEFINER='mysqltest_inv'@'localhost'
|
||||||
|
TRIGGER trg1 BEFORE INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = 0;
|
||||||
|
CREATE DEFINER='mysqltest_nonexs'@'localhost'
|
||||||
|
TRIGGER trg2 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = 0;
|
||||||
|
Warnings:
|
||||||
|
Note 1449 There is no 'mysqltest_nonexs'@'localhost' registered
|
||||||
|
INSERT INTO t1 VALUES(6);
|
||||||
|
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||||
|
SHOW TRIGGERS;
|
||||||
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
|
trg1 INSERT t1
|
||||||
|
SET @new_sum = 0 BEFORE NULL mysqltest_inv@localhost
|
||||||
|
trg2 INSERT t1
|
||||||
|
SET @new_sum = 0 AFTER NULL mysqltest_nonexs@localhost
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
DROP TRIGGER trg2;
|
||||||
|
CREATE TRIGGER trg1 BEFORE INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @a = 1;
|
||||||
|
CREATE TRIGGER trg2 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @a = 2;
|
||||||
|
CREATE TRIGGER trg3 BEFORE UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @a = 3;
|
||||||
|
CREATE TRIGGER trg4 AFTER UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @a = 4;
|
||||||
|
CREATE TRIGGER trg5 BEFORE DELETE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @a = 5;
|
||||||
|
|
||||||
|
SELECT trigger_name, definer FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
|
||||||
|
trigger_name definer
|
||||||
|
trg1
|
||||||
|
trg2 @
|
||||||
|
trg3 @abc@def@@
|
||||||
|
trg4 @hostname
|
||||||
|
trg5 @abcdef@@@hostname
|
||||||
|
Warnings:
|
||||||
|
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
|
||||||
|
|
||||||
|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
|
||||||
|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||||
|
NULL mysqltest_db1 trg1 INSERT NULL mysqltest_db1 t1 0 NULL
|
||||||
|
SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL
|
||||||
|
NULL mysqltest_db1 trg2 INSERT NULL mysqltest_db1 t1 0 NULL
|
||||||
|
SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL @
|
||||||
|
NULL mysqltest_db1 trg3 UPDATE NULL mysqltest_db1 t1 0 NULL
|
||||||
|
SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL @abc@def@@
|
||||||
|
NULL mysqltest_db1 trg4 UPDATE NULL mysqltest_db1 t1 0 NULL
|
||||||
|
SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL @hostname
|
||||||
|
NULL mysqltest_db1 trg5 DELETE NULL mysqltest_db1 t1 0 NULL
|
||||||
|
SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL @abcdef@@@hostname
|
||||||
|
|
||||||
|
---> connection: default
|
||||||
|
DROP USER mysqltest_dfn@localhost;
|
||||||
|
DROP USER mysqltest_inv@localhost;
|
||||||
|
DROP DATABASE mysqltest_db1;
|
||||||
|
Warnings:
|
||||||
|
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
|
@ -611,9 +611,9 @@ select @a;
|
|||||||
@a
|
@a
|
||||||
10
|
10
|
||||||
show triggers;
|
show triggers;
|
||||||
Trigger Event Table Statement Timing Created sql_mode
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
t1_bi INSERT t1 set new."t1 column" = 5 BEFORE # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
|
t1_bi INSERT t1 set new."t1 column" = 5 BEFORE # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI root@localhost
|
||||||
t1_af INSERT t1 set @a=10 AFTER #
|
t1_af INSERT t1 set @a=10 AFTER # root@localhost
|
||||||
drop table t1;
|
drop table t1;
|
||||||
set sql_mode="traditional";
|
set sql_mode="traditional";
|
||||||
create table t1 (a date);
|
create table t1 (a date);
|
||||||
@ -633,8 +633,8 @@ t1 CREATE TABLE `t1` (
|
|||||||
`a` date default NULL
|
`a` date default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
show triggers;
|
show triggers;
|
||||||
Trigger Event Table Statement Timing Created sql_mode
|
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||||
t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE #
|
t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE # root@localhost
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (id int);
|
create table t1 (id int);
|
||||||
create trigger t1_ai after insert on t1 for each row flush tables;
|
create trigger t1_ai after insert on t1 for each row flush tables;
|
||||||
@ -738,3 +738,28 @@ f1
|
|||||||
1
|
1
|
||||||
drop trigger t1_bi;
|
drop trigger t1_bi;
|
||||||
drop tables t1, t2;
|
drop tables t1, t2;
|
||||||
|
create table t1 (id int);
|
||||||
|
create table t2 (id int);
|
||||||
|
create trigger t1_bi before insert on t1 for each row insert into t2 values (new.id);
|
||||||
|
prepare stmt1 from "insert into t1 values (10)";
|
||||||
|
create procedure p1() insert into t1 values (10);
|
||||||
|
call p1();
|
||||||
|
drop trigger t1_bi;
|
||||||
|
execute stmt1;
|
||||||
|
call p1();
|
||||||
|
deallocate prepare stmt1;
|
||||||
|
drop procedure p1;
|
||||||
|
create table t3 (id int);
|
||||||
|
create trigger t1_bi after insert on t1 for each row insert into t2 values (new.id);
|
||||||
|
prepare stmt1 from "insert into t1 values (10)";
|
||||||
|
create procedure p1() insert into t1 values (10);
|
||||||
|
call p1();
|
||||||
|
drop trigger t1_bi;
|
||||||
|
create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id);
|
||||||
|
execute stmt1;
|
||||||
|
ERROR HY000: Table 't3' was not locked with LOCK TABLES
|
||||||
|
call p1();
|
||||||
|
ERROR HY000: Table 't3' was not locked with LOCK TABLES
|
||||||
|
deallocate prepare stmt1;
|
||||||
|
drop procedure p1;
|
||||||
|
drop table t1, t2, t3;
|
||||||
|
@ -1020,6 +1020,416 @@ cast(@non_existing_user_var/2 as DECIMAL)
|
|||||||
NULL
|
NULL
|
||||||
create table t (d decimal(0,10));
|
create table t (d decimal(0,10));
|
||||||
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'd').
|
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'd').
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
my_float FLOAT,
|
||||||
|
my_double DOUBLE,
|
||||||
|
my_varchar VARCHAR(50),
|
||||||
|
my_decimal DECIMAL(65,30)
|
||||||
|
);
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`my_float` float default NULL,
|
||||||
|
`my_double` double default NULL,
|
||||||
|
`my_varchar` varchar(50) default NULL,
|
||||||
|
`my_decimal` decimal(65,30) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-32,
|
||||||
|
my_double = 1.175494345e-32,
|
||||||
|
my_varchar = '1.175494345e-32';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-31,
|
||||||
|
my_double = 1.175494345e-31,
|
||||||
|
my_varchar = '1.175494345e-31';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-30,
|
||||||
|
my_double = 1.175494345e-30,
|
||||||
|
my_varchar = '1.175494345e-30';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-29,
|
||||||
|
my_double = 1.175494345e-29,
|
||||||
|
my_varchar = '1.175494345e-29';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-28,
|
||||||
|
my_double = 1.175494345e-28,
|
||||||
|
my_varchar = '1.175494345e-28';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-27,
|
||||||
|
my_double = 1.175494345e-27,
|
||||||
|
my_varchar = '1.175494345e-27';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-26,
|
||||||
|
my_double = 1.175494345e-26,
|
||||||
|
my_varchar = '1.175494345e-26';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-25,
|
||||||
|
my_double = 1.175494345e-25,
|
||||||
|
my_varchar = '1.175494345e-25';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-24,
|
||||||
|
my_double = 1.175494345e-24,
|
||||||
|
my_varchar = '1.175494345e-24';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-23,
|
||||||
|
my_double = 1.175494345e-23,
|
||||||
|
my_varchar = '1.175494345e-23';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-22,
|
||||||
|
my_double = 1.175494345e-22,
|
||||||
|
my_varchar = '1.175494345e-22';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-21,
|
||||||
|
my_double = 1.175494345e-21,
|
||||||
|
my_varchar = '1.175494345e-21';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-20,
|
||||||
|
my_double = 1.175494345e-20,
|
||||||
|
my_varchar = '1.175494345e-20';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-19,
|
||||||
|
my_double = 1.175494345e-19,
|
||||||
|
my_varchar = '1.175494345e-19';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-18,
|
||||||
|
my_double = 1.175494345e-18,
|
||||||
|
my_varchar = '1.175494345e-18';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-17,
|
||||||
|
my_double = 1.175494345e-17,
|
||||||
|
my_varchar = '1.175494345e-17';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-16,
|
||||||
|
my_double = 1.175494345e-16,
|
||||||
|
my_varchar = '1.175494345e-16';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-15,
|
||||||
|
my_double = 1.175494345e-15,
|
||||||
|
my_varchar = '1.175494345e-15';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-14,
|
||||||
|
my_double = 1.175494345e-14,
|
||||||
|
my_varchar = '1.175494345e-14';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-13,
|
||||||
|
my_double = 1.175494345e-13,
|
||||||
|
my_varchar = '1.175494345e-13';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-12,
|
||||||
|
my_double = 1.175494345e-12,
|
||||||
|
my_varchar = '1.175494345e-12';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-11,
|
||||||
|
my_double = 1.175494345e-11,
|
||||||
|
my_varchar = '1.175494345e-11';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-10,
|
||||||
|
my_double = 1.175494345e-10,
|
||||||
|
my_varchar = '1.175494345e-10';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-9,
|
||||||
|
my_double = 1.175494345e-9,
|
||||||
|
my_varchar = '1.175494345e-9';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-8,
|
||||||
|
my_double = 1.175494345e-8,
|
||||||
|
my_varchar = '1.175494345e-8';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-7,
|
||||||
|
my_double = 1.175494345e-7,
|
||||||
|
my_varchar = '1.175494345e-7';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-6,
|
||||||
|
my_double = 1.175494345e-6,
|
||||||
|
my_varchar = '1.175494345e-6';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-5,
|
||||||
|
my_double = 1.175494345e-5,
|
||||||
|
my_varchar = '1.175494345e-5';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-4,
|
||||||
|
my_double = 1.175494345e-4,
|
||||||
|
my_varchar = '1.175494345e-4';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-3,
|
||||||
|
my_double = 1.175494345e-3,
|
||||||
|
my_varchar = '1.175494345e-3';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-2,
|
||||||
|
my_double = 1.175494345e-2,
|
||||||
|
my_varchar = '1.175494345e-2';
|
||||||
|
INSERT INTO t1 SET my_float = 1.175494345e-1,
|
||||||
|
my_double = 1.175494345e-1,
|
||||||
|
my_varchar = '1.175494345e-1';
|
||||||
|
SELECT my_float, my_double, my_varchar FROM t1;
|
||||||
|
my_float my_double my_varchar
|
||||||
|
1.17549e-32 1.175494345e-32 1.175494345e-32
|
||||||
|
1.17549e-31 1.175494345e-31 1.175494345e-31
|
||||||
|
1.17549e-30 1.175494345e-30 1.175494345e-30
|
||||||
|
1.17549e-29 1.175494345e-29 1.175494345e-29
|
||||||
|
1.17549e-28 1.175494345e-28 1.175494345e-28
|
||||||
|
1.17549e-27 1.175494345e-27 1.175494345e-27
|
||||||
|
1.17549e-26 1.175494345e-26 1.175494345e-26
|
||||||
|
1.17549e-25 1.175494345e-25 1.175494345e-25
|
||||||
|
1.17549e-24 1.175494345e-24 1.175494345e-24
|
||||||
|
1.17549e-23 1.175494345e-23 1.175494345e-23
|
||||||
|
1.17549e-22 1.175494345e-22 1.175494345e-22
|
||||||
|
1.17549e-21 1.175494345e-21 1.175494345e-21
|
||||||
|
1.17549e-20 1.175494345e-20 1.175494345e-20
|
||||||
|
1.17549e-19 1.175494345e-19 1.175494345e-19
|
||||||
|
1.17549e-18 1.175494345e-18 1.175494345e-18
|
||||||
|
1.17549e-17 1.175494345e-17 1.175494345e-17
|
||||||
|
1.17549e-16 1.175494345e-16 1.175494345e-16
|
||||||
|
1.17549e-15 1.175494345e-15 1.175494345e-15
|
||||||
|
1.17549e-14 1.175494345e-14 1.175494345e-14
|
||||||
|
1.17549e-13 1.175494345e-13 1.175494345e-13
|
||||||
|
1.17549e-12 1.175494345e-12 1.175494345e-12
|
||||||
|
1.17549e-11 1.175494345e-11 1.175494345e-11
|
||||||
|
1.17549e-10 1.175494345e-10 1.175494345e-10
|
||||||
|
1.17549e-09 1.175494345e-09 1.175494345e-9
|
||||||
|
1.17549e-08 1.175494345e-08 1.175494345e-8
|
||||||
|
1.17549e-07 1.175494345e-07 1.175494345e-7
|
||||||
|
1.17549e-06 1.175494345e-06 1.175494345e-6
|
||||||
|
1.17549e-05 1.175494345e-05 1.175494345e-5
|
||||||
|
0.000117549 0.0001175494345 1.175494345e-4
|
||||||
|
0.00117549 0.001175494345 1.175494345e-3
|
||||||
|
0.0117549 0.01175494345 1.175494345e-2
|
||||||
|
0.117549 0.1175494345 1.175494345e-1
|
||||||
|
SELECT CAST(my_float AS DECIMAL(65,30)), my_float FROM t1;
|
||||||
|
CAST(my_float AS DECIMAL(65,30)) my_float
|
||||||
|
0.000000000000000000000000000000 1.17549e-32
|
||||||
|
0.000000000000000000000000000000 1.17549e-31
|
||||||
|
0.000000000000000000000000000001 1.17549e-30
|
||||||
|
0.000000000000000000000000000012 1.17549e-29
|
||||||
|
0.000000000000000000000000000118 1.17549e-28
|
||||||
|
0.000000000000000000000000001175 1.17549e-27
|
||||||
|
0.000000000000000000000000011755 1.17549e-26
|
||||||
|
0.000000000000000000000000117549 1.17549e-25
|
||||||
|
0.000000000000000000000001175494 1.17549e-24
|
||||||
|
0.000000000000000000000011754943 1.17549e-23
|
||||||
|
0.000000000000000000000117549438 1.17549e-22
|
||||||
|
0.000000000000000000001175494332 1.17549e-21
|
||||||
|
0.000000000000000000011754943324 1.17549e-20
|
||||||
|
0.000000000000000000117549434853 1.17549e-19
|
||||||
|
0.000000000000000001175494374380 1.17549e-18
|
||||||
|
0.000000000000000011754943743802 1.17549e-17
|
||||||
|
0.000000000000000117549432474939 1.17549e-16
|
||||||
|
0.000000000000001175494324749389 1.17549e-15
|
||||||
|
0.000000000000011754943671010360 1.17549e-14
|
||||||
|
0.000000000000117549429933840000 1.17549e-13
|
||||||
|
0.000000000001175494380653563000 1.17549e-12
|
||||||
|
0.000000000011754943372854760000 1.17549e-11
|
||||||
|
0.000000000117549428524377200000 1.17549e-10
|
||||||
|
0.000000001175494368510499000000 1.17549e-09
|
||||||
|
0.000000011754943685104990000000 1.17549e-08
|
||||||
|
0.000000117549433298336200000000 1.17549e-07
|
||||||
|
0.000001175494389826781000000000 1.17549e-06
|
||||||
|
0.000011754943443520460000000000 1.17549e-05
|
||||||
|
0.000117549432616215200000000000 0.000117549
|
||||||
|
0.001175494398921728000000000000 0.00117549
|
||||||
|
0.011754943057894710000000000000 0.0117549
|
||||||
|
0.117549434304237400000000000000 0.117549
|
||||||
|
SELECT CAST(my_double AS DECIMAL(65,30)), my_double FROM t1;
|
||||||
|
CAST(my_double AS DECIMAL(65,30)) my_double
|
||||||
|
0.000000000000000000000000000000 1.175494345e-32
|
||||||
|
0.000000000000000000000000000000 1.175494345e-31
|
||||||
|
0.000000000000000000000000000001 1.175494345e-30
|
||||||
|
0.000000000000000000000000000012 1.175494345e-29
|
||||||
|
0.000000000000000000000000000118 1.175494345e-28
|
||||||
|
0.000000000000000000000000001175 1.175494345e-27
|
||||||
|
0.000000000000000000000000011755 1.175494345e-26
|
||||||
|
0.000000000000000000000000117549 1.175494345e-25
|
||||||
|
0.000000000000000000000001175494 1.175494345e-24
|
||||||
|
0.000000000000000000000011754943 1.175494345e-23
|
||||||
|
0.000000000000000000000117549435 1.175494345e-22
|
||||||
|
0.000000000000000000001175494345 1.175494345e-21
|
||||||
|
0.000000000000000000011754943450 1.175494345e-20
|
||||||
|
0.000000000000000000117549434500 1.175494345e-19
|
||||||
|
0.000000000000000001175494345000 1.175494345e-18
|
||||||
|
0.000000000000000011754943450000 1.175494345e-17
|
||||||
|
0.000000000000000117549434500000 1.175494345e-16
|
||||||
|
0.000000000000001175494345000000 1.175494345e-15
|
||||||
|
0.000000000000011754943450000000 1.175494345e-14
|
||||||
|
0.000000000000117549434500000000 1.175494345e-13
|
||||||
|
0.000000000001175494345000000000 1.175494345e-12
|
||||||
|
0.000000000011754943450000000000 1.175494345e-11
|
||||||
|
0.000000000117549434500000000000 1.175494345e-10
|
||||||
|
0.000000001175494345000000000000 1.175494345e-09
|
||||||
|
0.000000011754943450000000000000 1.175494345e-08
|
||||||
|
0.000000117549434500000000000000 1.175494345e-07
|
||||||
|
0.000001175494345000000000000000 1.175494345e-06
|
||||||
|
0.000011754943450000000000000000 1.175494345e-05
|
||||||
|
0.000117549434500000000000000000 0.0001175494345
|
||||||
|
0.001175494345000000000000000000 0.001175494345
|
||||||
|
0.011754943450000000000000000000 0.01175494345
|
||||||
|
0.117549434500000000000000000000 0.1175494345
|
||||||
|
SELECT CAST(my_varchar AS DECIMAL(65,30)), my_varchar FROM t1;
|
||||||
|
CAST(my_varchar AS DECIMAL(65,30)) my_varchar
|
||||||
|
0.000000000000000000000000000000 1.175494345e-32
|
||||||
|
0.000000000000000000000000000000 1.175494345e-31
|
||||||
|
0.000000000000000000000000000001 1.175494345e-30
|
||||||
|
0.000000000000000000000000000012 1.175494345e-29
|
||||||
|
0.000000000000000000000000000118 1.175494345e-28
|
||||||
|
0.000000000000000000000000001175 1.175494345e-27
|
||||||
|
0.000000000000000000000000011755 1.175494345e-26
|
||||||
|
0.000000000000000000000000117549 1.175494345e-25
|
||||||
|
0.000000000000000000000001175494 1.175494345e-24
|
||||||
|
0.000000000000000000000011754943 1.175494345e-23
|
||||||
|
0.000000000000000000000117549435 1.175494345e-22
|
||||||
|
0.000000000000000000001175494345 1.175494345e-21
|
||||||
|
0.000000000000000000011754943450 1.175494345e-20
|
||||||
|
0.000000000000000000117549434500 1.175494345e-19
|
||||||
|
0.000000000000000001175494345000 1.175494345e-18
|
||||||
|
0.000000000000000011754943450000 1.175494345e-17
|
||||||
|
0.000000000000000117549434500000 1.175494345e-16
|
||||||
|
0.000000000000001175494345000000 1.175494345e-15
|
||||||
|
0.000000000000011754943450000000 1.175494345e-14
|
||||||
|
0.000000000000117549434500000000 1.175494345e-13
|
||||||
|
0.000000000001175494345000000000 1.175494345e-12
|
||||||
|
0.000000000011754943450000000000 1.175494345e-11
|
||||||
|
0.000000000117549434500000000000 1.175494345e-10
|
||||||
|
0.000000001175494345000000000000 1.175494345e-9
|
||||||
|
0.000000011754943450000000000000 1.175494345e-8
|
||||||
|
0.000000117549434500000000000000 1.175494345e-7
|
||||||
|
0.000001175494345000000000000000 1.175494345e-6
|
||||||
|
0.000011754943450000000000000000 1.175494345e-5
|
||||||
|
0.000117549434500000000000000000 1.175494345e-4
|
||||||
|
0.001175494345000000000000000000 1.175494345e-3
|
||||||
|
0.011754943450000000000000000000 1.175494345e-2
|
||||||
|
0.117549434500000000000000000000 1.175494345e-1
|
||||||
|
UPDATE t1 SET my_decimal = my_float;
|
||||||
|
Warnings:
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 1
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 2
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 3
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 4
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 5
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 6
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 7
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 8
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 9
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 10
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 11
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 12
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 13
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 14
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 15
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 16
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 17
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 19
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 20
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 21
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 22
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 23
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 26
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 27
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 30
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 31
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 32
|
||||||
|
SELECT my_decimal, my_float FROM t1;
|
||||||
|
my_decimal my_float
|
||||||
|
0.000000000000000000000000000000 1.17549e-32
|
||||||
|
0.000000000000000000000000000000 1.17549e-31
|
||||||
|
0.000000000000000000000000000001 1.17549e-30
|
||||||
|
0.000000000000000000000000000012 1.17549e-29
|
||||||
|
0.000000000000000000000000000118 1.17549e-28
|
||||||
|
0.000000000000000000000000001175 1.17549e-27
|
||||||
|
0.000000000000000000000000011755 1.17549e-26
|
||||||
|
0.000000000000000000000000117549 1.17549e-25
|
||||||
|
0.000000000000000000000001175494 1.17549e-24
|
||||||
|
0.000000000000000000000011754943 1.17549e-23
|
||||||
|
0.000000000000000000000117549438 1.17549e-22
|
||||||
|
0.000000000000000000001175494332 1.17549e-21
|
||||||
|
0.000000000000000000011754943324 1.17549e-20
|
||||||
|
0.000000000000000000117549434853 1.17549e-19
|
||||||
|
0.000000000000000001175494374380 1.17549e-18
|
||||||
|
0.000000000000000011754943743802 1.17549e-17
|
||||||
|
0.000000000000000117549432474939 1.17549e-16
|
||||||
|
0.000000000000001175494324749389 1.17549e-15
|
||||||
|
0.000000000000011754943671010360 1.17549e-14
|
||||||
|
0.000000000000117549429933840000 1.17549e-13
|
||||||
|
0.000000000001175494380653563000 1.17549e-12
|
||||||
|
0.000000000011754943372854760000 1.17549e-11
|
||||||
|
0.000000000117549428524377200000 1.17549e-10
|
||||||
|
0.000000001175494368510499000000 1.17549e-09
|
||||||
|
0.000000011754943685104990000000 1.17549e-08
|
||||||
|
0.000000117549433298336200000000 1.17549e-07
|
||||||
|
0.000001175494389826781000000000 1.17549e-06
|
||||||
|
0.000011754943443520460000000000 1.17549e-05
|
||||||
|
0.000117549432616215200000000000 0.000117549
|
||||||
|
0.001175494398921728000000000000 0.00117549
|
||||||
|
0.011754943057894710000000000000 0.0117549
|
||||||
|
0.117549434304237400000000000000 0.117549
|
||||||
|
UPDATE t1 SET my_decimal = my_double;
|
||||||
|
Warnings:
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 1
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 2
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 3
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 4
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 5
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 6
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 7
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 8
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 9
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 10
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 11
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 13
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 14
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 16
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 18
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 20
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 31
|
||||||
|
SELECT my_decimal, my_double FROM t1;
|
||||||
|
my_decimal my_double
|
||||||
|
0.000000000000000000000000000000 1.175494345e-32
|
||||||
|
0.000000000000000000000000000000 1.175494345e-31
|
||||||
|
0.000000000000000000000000000001 1.175494345e-30
|
||||||
|
0.000000000000000000000000000012 1.175494345e-29
|
||||||
|
0.000000000000000000000000000118 1.175494345e-28
|
||||||
|
0.000000000000000000000000001175 1.175494345e-27
|
||||||
|
0.000000000000000000000000011755 1.175494345e-26
|
||||||
|
0.000000000000000000000000117549 1.175494345e-25
|
||||||
|
0.000000000000000000000001175494 1.175494345e-24
|
||||||
|
0.000000000000000000000011754943 1.175494345e-23
|
||||||
|
0.000000000000000000000117549435 1.175494345e-22
|
||||||
|
0.000000000000000000001175494345 1.175494345e-21
|
||||||
|
0.000000000000000000011754943450 1.175494345e-20
|
||||||
|
0.000000000000000000117549434500 1.175494345e-19
|
||||||
|
0.000000000000000001175494345000 1.175494345e-18
|
||||||
|
0.000000000000000011754943450000 1.175494345e-17
|
||||||
|
0.000000000000000117549434500000 1.175494345e-16
|
||||||
|
0.000000000000001175494345000000 1.175494345e-15
|
||||||
|
0.000000000000011754943450000000 1.175494345e-14
|
||||||
|
0.000000000000117549434500000000 1.175494345e-13
|
||||||
|
0.000000000001175494345000000000 1.175494345e-12
|
||||||
|
0.000000000011754943450000000000 1.175494345e-11
|
||||||
|
0.000000000117549434500000000000 1.175494345e-10
|
||||||
|
0.000000001175494345000000000000 1.175494345e-09
|
||||||
|
0.000000011754943450000000000000 1.175494345e-08
|
||||||
|
0.000000117549434500000000000000 1.175494345e-07
|
||||||
|
0.000001175494345000000000000000 1.175494345e-06
|
||||||
|
0.000011754943450000000000000000 1.175494345e-05
|
||||||
|
0.000117549434500000000000000000 0.0001175494345
|
||||||
|
0.001175494345000000000000000000 0.001175494345
|
||||||
|
0.011754943450000000000000000000 0.01175494345
|
||||||
|
0.117549434500000000000000000000 0.1175494345
|
||||||
|
UPDATE t1 SET my_decimal = my_varchar;
|
||||||
|
Warnings:
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 1
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 2
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 3
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 4
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 5
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 6
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 7
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 8
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 9
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 10
|
||||||
|
Note 1265 Data truncated for column 'my_decimal' at row 11
|
||||||
|
SELECT my_decimal, my_varchar FROM t1;
|
||||||
|
my_decimal my_varchar
|
||||||
|
0.000000000000000000000000000000 1.175494345e-32
|
||||||
|
0.000000000000000000000000000000 1.175494345e-31
|
||||||
|
0.000000000000000000000000000001 1.175494345e-30
|
||||||
|
0.000000000000000000000000000012 1.175494345e-29
|
||||||
|
0.000000000000000000000000000118 1.175494345e-28
|
||||||
|
0.000000000000000000000000001175 1.175494345e-27
|
||||||
|
0.000000000000000000000000011755 1.175494345e-26
|
||||||
|
0.000000000000000000000000117549 1.175494345e-25
|
||||||
|
0.000000000000000000000001175494 1.175494345e-24
|
||||||
|
0.000000000000000000000011754943 1.175494345e-23
|
||||||
|
0.000000000000000000000117549435 1.175494345e-22
|
||||||
|
0.000000000000000000001175494345 1.175494345e-21
|
||||||
|
0.000000000000000000011754943450 1.175494345e-20
|
||||||
|
0.000000000000000000117549434500 1.175494345e-19
|
||||||
|
0.000000000000000001175494345000 1.175494345e-18
|
||||||
|
0.000000000000000011754943450000 1.175494345e-17
|
||||||
|
0.000000000000000117549434500000 1.175494345e-16
|
||||||
|
0.000000000000001175494345000000 1.175494345e-15
|
||||||
|
0.000000000000011754943450000000 1.175494345e-14
|
||||||
|
0.000000000000117549434500000000 1.175494345e-13
|
||||||
|
0.000000000001175494345000000000 1.175494345e-12
|
||||||
|
0.000000000011754943450000000000 1.175494345e-11
|
||||||
|
0.000000000117549434500000000000 1.175494345e-10
|
||||||
|
0.000000001175494345000000000000 1.175494345e-9
|
||||||
|
0.000000011754943450000000000000 1.175494345e-8
|
||||||
|
0.000000117549434500000000000000 1.175494345e-7
|
||||||
|
0.000001175494345000000000000000 1.175494345e-6
|
||||||
|
0.000011754943450000000000000000 1.175494345e-5
|
||||||
|
0.000117549434500000000000000000 1.175494345e-4
|
||||||
|
0.001175494345000000000000000000 1.175494345e-3
|
||||||
|
0.011754943450000000000000000000 1.175494345e-2
|
||||||
|
0.117549434500000000000000000000 1.175494345e-1
|
||||||
|
DROP TABLE t1;
|
||||||
create table t1 (c1 decimal(64));
|
create table t1 (c1 decimal(64));
|
||||||
insert into t1 values(
|
insert into t1 values(
|
||||||
89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
|
89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
drop table if exists t1,t2,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
drop table if exists t1,t2,t3,t4,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
||||||
drop view if exists t1,t2,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
drop view if exists t1,t2,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
||||||
drop database if exists mysqltest;
|
drop database if exists mysqltest;
|
||||||
use test;
|
use test;
|
||||||
@ -204,6 +204,21 @@ create table t1 (a int);
|
|||||||
insert into t1 values (1), (2), (3);
|
insert into t1 values (1), (2), (3);
|
||||||
create view v1 (a) as select a+1 from t1;
|
create view v1 (a) as select a+1 from t1;
|
||||||
create view v2 (a) as select a-1 from t1;
|
create view v2 (a) as select a-1 from t1;
|
||||||
|
select * from t1 natural left join v1;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
select * from v2 natural left join t1;
|
||||||
|
a
|
||||||
|
0
|
||||||
|
1
|
||||||
|
2
|
||||||
|
select * from v2 natural left join v1;
|
||||||
|
a
|
||||||
|
0
|
||||||
|
1
|
||||||
|
2
|
||||||
drop view v1, v2;
|
drop view v1, v2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (a int);
|
create table t1 (a int);
|
||||||
@ -2199,10 +2214,10 @@ r_object_id users_names
|
|||||||
drop view v1, v2;
|
drop view v1, v2;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
create definer=some_user@`` sql security invoker view v1 as select 1;
|
create definer=some_user@`` sql security invoker view v1 as select 1;
|
||||||
ERROR HY000: View definer is not fully qualified
|
ERROR HY000: Definer is not fully qualified
|
||||||
create definer=some_user@localhost sql security invoker view v1 as select 1;
|
create definer=some_user@localhost sql security invoker view v1 as select 1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1449 There is not some_user@localhost registered
|
Note 1449 There is no 'some_user'@'localhost' registered
|
||||||
show create view v1;
|
show create view v1;
|
||||||
View Create View
|
View Create View
|
||||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
|
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
|
||||||
@ -2323,6 +2338,14 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
|
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
|
||||||
DROP VIEW v1,v2;
|
DROP VIEW v1,v2;
|
||||||
DROP TABLE t1,t2,t3;
|
DROP TABLE t1,t2,t3;
|
||||||
|
create table t1 (f1 int);
|
||||||
|
create view v1 as select t1.f1 as '123
|
||||||
|
456' from t1;
|
||||||
|
select * from v1;
|
||||||
|
123
|
||||||
|
456
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
create table t1 (f1 int, f2 int);
|
create table t1 (f1 int, f2 int);
|
||||||
insert into t1 values(1,1),(1,2),(1,3);
|
insert into t1 values(1,1),(1,2),(1,3);
|
||||||
create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1;
|
create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1;
|
||||||
@ -2335,3 +2358,69 @@ f1 group_concat(f2 order by f2 desc)
|
|||||||
1 3,2,1
|
1 3,2,1
|
||||||
drop view v1,v2;
|
drop view v1,v2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (x int, y int);
|
||||||
|
create table t2 (x int, y int, z int);
|
||||||
|
create table t3 (x int, y int, z int);
|
||||||
|
create table t4 (x int, y int, z int);
|
||||||
|
create view v1 as
|
||||||
|
select t1.x
|
||||||
|
from (
|
||||||
|
(t1 join t2 on ((t1.y = t2.y)))
|
||||||
|
join
|
||||||
|
(t3 left join t4 on (t3.y = t4.y) and (t3.z = t4.z))
|
||||||
|
);
|
||||||
|
prepare stmt1 from "select count(*) from v1 where x = ?";
|
||||||
|
set @parm1=1;
|
||||||
|
execute stmt1 using @parm1;
|
||||||
|
count(*)
|
||||||
|
0
|
||||||
|
execute stmt1 using @parm1;
|
||||||
|
count(*)
|
||||||
|
0
|
||||||
|
drop view v1;
|
||||||
|
drop table t1,t2,t3,t4;
|
||||||
|
CREATE TABLE t1(id INT);
|
||||||
|
CREATE VIEW v1 AS SELECT id FROM t1;
|
||||||
|
OPTIMIZE TABLE v1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.v1 optimize note Unknown table 'test.v1'
|
||||||
|
ANALYZE TABLE v1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.v1 analyze note Unknown table 'test.v1'
|
||||||
|
REPAIR TABLE v1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.v1 repair note Unknown table 'test.v1'
|
||||||
|
DROP TABLE t1;
|
||||||
|
OPTIMIZE TABLE v1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.v1 optimize note Unknown table 'test.v1'
|
||||||
|
Warnings:
|
||||||
|
Error 1146 Table 'test.t1' doesn't exist
|
||||||
|
Error 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||||
|
DROP VIEW v1;
|
||||||
|
create definer = current_user() sql security invoker view v1 as select 1;
|
||||||
|
show create view v1;
|
||||||
|
View Create View
|
||||||
|
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
|
||||||
|
drop view v1;
|
||||||
|
create definer = current_user sql security invoker view v1 as select 1;
|
||||||
|
show create view v1;
|
||||||
|
View Create View
|
||||||
|
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
|
||||||
|
drop view v1;
|
||||||
|
create table t1 (id INT, primary key(id));
|
||||||
|
insert into t1 values (1),(2);
|
||||||
|
create view v1 as select * from t1;
|
||||||
|
explain select id from v1 order by id;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY t1 index NULL PRIMARY 4 NULL 2 Using index
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
create table t1(f1 int, f2 int);
|
||||||
|
insert into t1 values (null, 10), (null,2);
|
||||||
|
create view v1 as select * from t1;
|
||||||
|
select f1, sum(f2) from v1 group by f1;
|
||||||
|
f1 sum(f2)
|
||||||
|
NULL 12
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
@ -13,7 +13,7 @@ create table mysqltest.t2 (a int, b int);
|
|||||||
grant select on mysqltest.t1 to mysqltest_1@localhost;
|
grant select on mysqltest.t1 to mysqltest_1@localhost;
|
||||||
grant create view,select on test.* to mysqltest_1@localhost;
|
grant create view,select on test.* to mysqltest_1@localhost;
|
||||||
create definer=root@localhost view v1 as select * from mysqltest.t1;
|
create definer=root@localhost view v1 as select * from mysqltest.t1;
|
||||||
ERROR HY000: You need the SUPER privilege for creation view with root@localhost definer
|
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||||
create view v1 as select * from mysqltest.t1;
|
create view v1 as select * from mysqltest.t1;
|
||||||
alter view v1 as select * from mysqltest.t1;
|
alter view v1 as select * from mysqltest.t1;
|
||||||
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 'v1'
|
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 'v1'
|
||||||
|
@ -39,4 +39,13 @@ check table t1;
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# procedure in PS BUG#13673
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a int);
|
||||||
|
prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()";
|
||||||
|
execute stmt1;
|
||||||
|
execute stmt1;
|
||||||
|
deallocate prepare stmt1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Initialize
|
# Initialize
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
drop table if exists t1;
|
drop table if exists t1, t2;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
drop table if exists t1,t2,t3;
|
drop table if exists t1,t2,t3,t4,t5;
|
||||||
drop database if exists mysqltest;
|
drop database if exists mysqltest;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
@ -554,4 +554,80 @@ create table t1 (
|
|||||||
show create table t1;
|
show create table t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#14480: assert failure in CREATE ... SELECT because of wrong
|
||||||
|
# calculation of number of NULLs.
|
||||||
|
#
|
||||||
|
CREATE TABLE t2 (
|
||||||
|
a int(11) default NULL
|
||||||
|
);
|
||||||
|
insert into t2 values(111);
|
||||||
|
|
||||||
|
--warning 1364
|
||||||
|
create table t1 (
|
||||||
|
a varchar(12) charset utf8 collate utf8_bin not null,
|
||||||
|
b int not null, primary key (a)
|
||||||
|
) select a, 1 as b from t2 ;
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
--warning 1364
|
||||||
|
create table t1 (
|
||||||
|
a varchar(12) charset utf8 collate utf8_bin not null,
|
||||||
|
b int not null, primary key (a)
|
||||||
|
) select 'a' as a , 1 as b from t2 ;
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
--warning 1364
|
||||||
|
create table t1 (
|
||||||
|
a varchar(12) charset utf8 collate utf8_bin,
|
||||||
|
b int not null, primary key (a)
|
||||||
|
) select 'a' as a , 1 as b from t2 ;
|
||||||
|
show create table t1;
|
||||||
|
drop table t1, t2;
|
||||||
|
|
||||||
|
create table t1 (
|
||||||
|
a1 int not null,
|
||||||
|
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
|
||||||
|
);
|
||||||
|
insert into t1 values (1,1,1, 1,1,1, 1,1,1);
|
||||||
|
|
||||||
|
--warning 1364
|
||||||
|
create table t2 (
|
||||||
|
a1 varchar(12) charset utf8 collate utf8_bin not null,
|
||||||
|
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int,
|
||||||
|
primary key (a1)
|
||||||
|
) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ;
|
||||||
|
drop table t2;
|
||||||
|
|
||||||
|
--warning 1364
|
||||||
|
create table t2 (
|
||||||
|
a1 varchar(12) charset utf8 collate utf8_bin,
|
||||||
|
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
|
||||||
|
) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1;
|
||||||
|
|
||||||
|
drop table t1, t2;
|
||||||
|
--warning 1364
|
||||||
|
create table t1 (
|
||||||
|
a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
|
||||||
|
);
|
||||||
|
insert into t1 values (1,1,1, 1,1,1, 1,1,1);
|
||||||
|
|
||||||
|
--warning 1364
|
||||||
|
create table t2 (
|
||||||
|
a1 varchar(12) charset utf8 collate utf8_bin not null,
|
||||||
|
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int,
|
||||||
|
primary key (a1)
|
||||||
|
) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ;
|
||||||
|
|
||||||
|
# Test the default value
|
||||||
|
drop table t2;
|
||||||
|
|
||||||
|
create table t2 ( a int default 3, b int default 3)
|
||||||
|
select a1,a2 from t1;
|
||||||
|
show create table t2;
|
||||||
|
|
||||||
|
drop table t1, t2;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
@ -1314,4 +1314,41 @@ select period from t1;
|
|||||||
|
|
||||||
drop table if exists t1,t2,t3,t4;
|
drop table if exists t1,t2,t3,t4;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #13894 Server crashes on update of CSV table
|
||||||
|
#
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS bug13894;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE bug13894 ( val integer ) ENGINE = CSV;
|
||||||
|
INSERT INTO bug13894 VALUES (5);
|
||||||
|
INSERT INTO bug13894 VALUES (10);
|
||||||
|
INSERT INTO bug13894 VALUES (11);
|
||||||
|
INSERT INTO bug13894 VALUES (10);
|
||||||
|
SELECT * FROM bug13894;
|
||||||
|
UPDATE bug13894 SET val=6 WHERE val=10;
|
||||||
|
SELECT * FROM bug13894;
|
||||||
|
DROP TABLE bug13894;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #14672 Bug in deletion
|
||||||
|
#
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS bug14672;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE bug14672 (c1 integer) engine = CSV;
|
||||||
|
INSERT INTO bug14672 VALUES (1), (2), (3);
|
||||||
|
SELECT * FROM bug14672;
|
||||||
|
DELETE FROM bug14672 WHERE c1 = 2;
|
||||||
|
SELECT * FROM bug14672;
|
||||||
|
INSERT INTO bug14672 VALUES (4);
|
||||||
|
SELECT * FROM bug14672;
|
||||||
|
INSERT INTO bug14672 VALUES (5);
|
||||||
|
SELECT * FROM bug14672;
|
||||||
|
DROP TABLE bug14672;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
@ -15,5 +15,4 @@ rpl_relayrotate : Unstable test case, bug#12429
|
|||||||
rpl_until : Unstable test case, bug#12429
|
rpl_until : Unstable test case, bug#12429
|
||||||
rpl_deadlock : Unstable test case, bug#12429
|
rpl_deadlock : Unstable test case, bug#12429
|
||||||
kill : Unstable test case, bug#9712
|
kill : Unstable test case, bug#9712
|
||||||
archive_gis : The test fails on 32bit Linux
|
|
||||||
compress : Magnus will fix
|
compress : Magnus will fix
|
||||||
|
@ -348,6 +348,12 @@ INSERT INTO t1 VALUES('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
|
|||||||
SET myisam_repair_threads=2;
|
SET myisam_repair_threads=2;
|
||||||
REPAIR TABLE t1;
|
REPAIR TABLE t1;
|
||||||
SET myisam_repair_threads=@@global.myisam_repair_threads;
|
SET myisam_repair_threads=@@global.myisam_repair_threads;
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#5686 - #1034 - Incorrect key file for table - only utf8
|
||||||
|
#
|
||||||
|
INSERT INTO t1 VALUES('testword\'\'');
|
||||||
|
SELECT a FROM t1 WHERE MATCH a AGAINST('testword' IN BOOLEAN MODE);
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
@ -390,3 +390,19 @@ SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY id;
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#8568 "GROUP_CONCAT returns string, unless in a UNION in which case
|
||||||
|
# returns BLOB": add a test case, the bug can not be repeated any more.
|
||||||
|
#
|
||||||
|
|
||||||
|
set names latin1;
|
||||||
|
create table t1 (a char, b char);
|
||||||
|
insert into t1 values ('a', 'a'), ('a', 'b'), ('b', 'a'), ('b', 'b');
|
||||||
|
create table t2 select group_concat(b) as a from t1 where a = 'a';
|
||||||
|
create table t3 (select group_concat(a) as a from t1 where a = 'a') union
|
||||||
|
(select group_concat(b) as a from t1 where a = 'b');
|
||||||
|
select charset(a) from t2;
|
||||||
|
select charset(a) from t3;
|
||||||
|
drop table t1, t2, t3;
|
||||||
|
set names default;
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
# simple test of all group functions
|
# simple test of all group functions
|
||||||
#
|
#
|
||||||
|
|
||||||
--source include/have_innodb.inc
|
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
drop table if exists t1,t2;
|
drop table if exists t1,t2;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
@ -545,10 +543,12 @@ DROP TABLE t1;
|
|||||||
# Bug #12882 min/max inconsistent on empty table
|
# Bug #12882 min/max inconsistent on empty table
|
||||||
#
|
#
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
create table t1m (a int) engine=myisam;
|
create table t1m (a int) engine=myisam;
|
||||||
create table t1i (a int) engine=innodb;
|
create table t1i (a int) engine=innodb;
|
||||||
create table t2m (a int) engine=myisam;
|
create table t2m (a int) engine=myisam;
|
||||||
create table t2i (a int) engine=innodb;
|
create table t2i (a int) engine=innodb;
|
||||||
|
--enable_warnings
|
||||||
insert into t2m values (5);
|
insert into t2m values (5);
|
||||||
insert into t2i values (5);
|
insert into t2i values (5);
|
||||||
|
|
||||||
|
@ -347,4 +347,79 @@ drop table t3;
|
|||||||
drop table t4;
|
drop table t4;
|
||||||
drop table t5;
|
drop table t5;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
|
||||||
|
#
|
||||||
|
create table t1 (c1 int);
|
||||||
|
insert into t1 values (1);
|
||||||
|
# client 1
|
||||||
|
handler t1 open;
|
||||||
|
handler t1 read first;
|
||||||
|
# client 2
|
||||||
|
connect (con2,localhost,root,,);
|
||||||
|
connection con2;
|
||||||
|
--exec echo send the below to another connection, do not wait for the result
|
||||||
|
send optimize table t1;
|
||||||
|
--sleep 1
|
||||||
|
# client 1
|
||||||
|
--exec echo proceed with the normal connection
|
||||||
|
connection default;
|
||||||
|
handler t1 read next;
|
||||||
|
handler t1 close;
|
||||||
|
# client 2
|
||||||
|
--exec echo read the result from the other connection
|
||||||
|
connection con2;
|
||||||
|
reap;
|
||||||
|
# client 1
|
||||||
|
--exec echo proceed with the normal connection
|
||||||
|
connection default;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
|
#
|
||||||
|
# Addendum to Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
|
||||||
|
# Show that DROP TABLE can no longer deadlock against
|
||||||
|
# FLUSH TABLES WITH READ LOCK. This is a 5.0 issue.
|
||||||
|
#
|
||||||
|
create table t1 (c1 int);
|
||||||
|
insert into t1 values (14397);
|
||||||
|
flush tables with read lock;
|
||||||
|
# The thread with the global read lock cannot drop the table itself:
|
||||||
|
--error 1223
|
||||||
|
drop table t1;
|
||||||
|
#
|
||||||
|
# client 2
|
||||||
|
# We need a second connection to try the drop.
|
||||||
|
# The drop waits for the global read lock to go away.
|
||||||
|
# Without the addendum fix it locked LOCK_open before entering the wait loop.
|
||||||
|
connection con2;
|
||||||
|
--exec echo send the below to another connection, do not wait for the result
|
||||||
|
send drop table t1;
|
||||||
|
--sleep 1
|
||||||
|
#
|
||||||
|
# client 1
|
||||||
|
# Now we need something that wants LOCK_open. A simple table access which
|
||||||
|
# opens the table does the trick.
|
||||||
|
--exec echo proceed with the normal connection
|
||||||
|
connection default;
|
||||||
|
# This would hang on LOCK_open without the 5.0 addendum fix.
|
||||||
|
select * from t1;
|
||||||
|
# Release the read lock. This should make the DROP go through.
|
||||||
|
unlock tables;
|
||||||
|
#
|
||||||
|
# client 2
|
||||||
|
# Read the result of the drop command.
|
||||||
|
connection con2;
|
||||||
|
--exec echo read the result from the other connection
|
||||||
|
reap;
|
||||||
|
#
|
||||||
|
# client 1
|
||||||
|
# Now back to normal operation. The table should not exist any more.
|
||||||
|
--exec echo proceed with the normal connection
|
||||||
|
connection default;
|
||||||
|
--error 1146
|
||||||
|
select * from t1;
|
||||||
|
# Just to be sure and not confuse the next test case writer.
|
||||||
|
drop table if exists t1;
|
||||||
|
|
||||||
|
@ -379,6 +379,8 @@ where table_schema='test';
|
|||||||
select index_name from information_schema.statistics where table_schema='test';
|
select index_name from information_schema.statistics where table_schema='test';
|
||||||
select constraint_name from information_schema.table_constraints
|
select constraint_name from information_schema.table_constraints
|
||||||
where table_schema='test';
|
where table_schema='test';
|
||||||
|
show create view v2;
|
||||||
|
show create table v3;
|
||||||
drop view v2;
|
drop view v2;
|
||||||
drop view v3;
|
drop view v3;
|
||||||
drop table t4;
|
drop table t4;
|
||||||
|
@ -832,3 +832,71 @@ SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
|
|||||||
|
|
||||||
DROP VIEW v1, v2;
|
DROP VIEW v1, v2;
|
||||||
DROP TABLE t1, t2, t3, t4, t5, t6;
|
DROP TABLE t1, t2, t3, t4, t5, t6;
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#13126 -test case from bug report
|
||||||
|
#
|
||||||
|
create table t1 (id1 int(11) not null);
|
||||||
|
insert into t1 values (1),(2);
|
||||||
|
|
||||||
|
create table t2 (id2 int(11) not null);
|
||||||
|
insert into t2 values (1),(2),(3),(4);
|
||||||
|
|
||||||
|
create table t3 (id3 char(16) not null);
|
||||||
|
insert into t3 values ('100');
|
||||||
|
|
||||||
|
create table t4 (id2 int(11) not null, id3 char(16));
|
||||||
|
|
||||||
|
create table t5 (id1 int(11) not null, key (id1));
|
||||||
|
insert into t5 values (1),(2),(1);
|
||||||
|
|
||||||
|
create view v1 as
|
||||||
|
select t4.id3 from t4 join t2 on t4.id2 = t2.id2;
|
||||||
|
|
||||||
|
select t1.id1 from t1 inner join (t3 left join v1 on t3.id3 = v1.id3);
|
||||||
|
|
||||||
|
drop view v1;
|
||||||
|
drop table t1, t2, t3, t4, t5;
|
||||||
|
|
||||||
|
create table t0 (a int);
|
||||||
|
insert into t0 values (0),(1),(2),(3);
|
||||||
|
create table t1(a int);
|
||||||
|
insert into t1 select A.a + 10*(B.a) from t0 A, t0 B;
|
||||||
|
|
||||||
|
create table t2 (a int, b int);
|
||||||
|
insert into t2 values (1,1), (2,2), (3,3);
|
||||||
|
|
||||||
|
create table t3(a int, b int, filler char(200), key(a));
|
||||||
|
insert into t3 select a,a,'filler' from t1;
|
||||||
|
insert into t3 select a,a,'filler' from t1;
|
||||||
|
|
||||||
|
create table t4 like t3;
|
||||||
|
insert into t4 select * from t3;
|
||||||
|
insert into t4 select * from t3;
|
||||||
|
|
||||||
|
create table t5 like t4;
|
||||||
|
insert into t5 select * from t4;
|
||||||
|
insert into t5 select * from t4;
|
||||||
|
|
||||||
|
create table t6 like t5;
|
||||||
|
insert into t6 select * from t5;
|
||||||
|
insert into t6 select * from t5;
|
||||||
|
|
||||||
|
create table t7 like t6;
|
||||||
|
insert into t7 select * from t6;
|
||||||
|
insert into t7 select * from t6;
|
||||||
|
|
||||||
|
--replace_column 9 X
|
||||||
|
explain select * from t4 join
|
||||||
|
t2 left join (t3 join t5 on t5.a=t3.b) on t3.a=t2.b where t4.a<=>t3.b;
|
||||||
|
|
||||||
|
--replace_column 9 X
|
||||||
|
explain select * from (t4 join t6 on t6.a=t4.b) right join t3 on t4.a=t3.b
|
||||||
|
join t2 left join (t5 join t7 on t7.a=t5.b) on t5.a=t2.b where t3.a<=>t2.b;
|
||||||
|
|
||||||
|
--replace_column 9 X
|
||||||
|
explain select * from t2 left join
|
||||||
|
(t3 left join (t4 join t6 on t6.a=t4.b) on t4.a=t3.b
|
||||||
|
join t5 on t5.a=t3.b) on t3.a=t2.b;
|
||||||
|
|
||||||
|
drop table t0, t1, t2, t4, t5, t6;
|
||||||
|
@ -227,7 +227,37 @@ select (@after:=unix_timestamp())*0; # always give repeatable output
|
|||||||
# the bug, the reap would return immediately after the insert into t2.
|
# the bug, the reap would return immediately after the insert into t2.
|
||||||
select (@after-@before) >= 2;
|
select (@after-@before) >= 2;
|
||||||
|
|
||||||
# cleanup
|
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
commit;
|
||||||
|
|
||||||
|
# test for BUG#7947 - DO RELEASE_LOCK() not written to binlog on rollback in the middle
|
||||||
|
# of a transaction
|
||||||
|
|
||||||
|
connection con2;
|
||||||
|
begin;
|
||||||
|
create temporary table ti (a int) engine=innodb;
|
||||||
|
rollback;
|
||||||
|
insert into ti values(1);
|
||||||
|
set autocommit=0;
|
||||||
|
create temporary table t1 (a int) engine=myisam;
|
||||||
|
commit;
|
||||||
|
insert t1 values (1);
|
||||||
|
rollback;
|
||||||
|
create table t0 (n int);
|
||||||
|
insert t0 select * from t1;
|
||||||
|
set autocommit=1;
|
||||||
|
insert into t0 select GET_LOCK("lock1",null);
|
||||||
|
set autocommit=0;
|
||||||
|
create table t2 (n int) engine=innodb;
|
||||||
|
insert into t2 values (3);
|
||||||
|
disconnect con2;
|
||||||
|
connection con3;
|
||||||
|
select get_lock("lock1",60);
|
||||||
|
--replace_column 5 #
|
||||||
|
--replace_result "xid=208" "xid=105" "xid=227" "xid=114" "xid=230" "xid=115" "xid=234" "xid=117" "xid=261" "xid=132"
|
||||||
|
show binlog events from 98;
|
||||||
|
do release_lock("lock1");
|
||||||
|
drop table t0,t2;
|
||||||
|
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
@ -476,6 +476,18 @@ explain select sql_big_result distinct t1.a from t1,t2 order by t2.a;
|
|||||||
explain select distinct t1.a from t1,t2 order by t2.a;
|
explain select distinct t1.a from t1,t2 order by t2.a;
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#14616 - Freshly imported table returns error 124 when using LIMIT
|
||||||
|
#
|
||||||
|
create table t1 (
|
||||||
|
c1 varchar(32),
|
||||||
|
key (c1)
|
||||||
|
) engine=myisam;
|
||||||
|
alter table t1 disable keys;
|
||||||
|
insert into t1 values ('a'), ('b');
|
||||||
|
select c1 from t1 order by c1 limit 1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test RTREE index
|
# Test RTREE index
|
||||||
#
|
#
|
||||||
@ -648,6 +660,24 @@ analyze table t1;
|
|||||||
show index from t1;
|
show index from t1;
|
||||||
|
|
||||||
set myisam_stats_method=DEFAULT;
|
set myisam_stats_method=DEFAULT;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
# BUG#13814 - key value packed incorrectly for TINYBLOBs
|
||||||
|
|
||||||
|
create table t1(
|
||||||
|
cip INT NOT NULL,
|
||||||
|
time TIME NOT NULL,
|
||||||
|
score INT NOT NULL DEFAULT 0,
|
||||||
|
bob TINYBLOB
|
||||||
|
);
|
||||||
|
|
||||||
|
insert into t1 (cip, time) VALUES (1, '00:01'), (2, '00:02'), (3,'00:03');
|
||||||
|
insert into t1 (cip, bob, time) VALUES (4, 'a', '00:04'), (5, 'b', '00:05'),
|
||||||
|
(6, 'c', '00:06');
|
||||||
|
select * from t1 where bob is null and cip=1;
|
||||||
|
create index bug on t1 (bob(22), cip, time);
|
||||||
|
select * from t1 where bob is null and cip=1;
|
||||||
|
drop table t1;
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -658,19 +658,19 @@ select '------ Testing with illegal table names ------' as test_sequence ;
|
|||||||
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1
|
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1
|
||||||
|
|
||||||
--error 6
|
--error 6
|
||||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_1"
|
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
|
||||||
|
|
||||||
--error 6
|
--error 6
|
||||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T%1"
|
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T%1" 2>&1
|
||||||
|
|
||||||
--error 6
|
--error 6
|
||||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T'1"
|
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T'1" 2>&1
|
||||||
|
|
||||||
--error 6
|
--error 6
|
||||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_1"
|
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
|
||||||
|
|
||||||
--error 6
|
--error 6
|
||||||
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_"
|
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T_" 2>&1
|
||||||
|
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
select '------ Testing with illegal database names ------' as test_sequence ;
|
select '------ Testing with illegal database names ------' as test_sequence ;
|
||||||
@ -882,6 +882,7 @@ DROP FUNCTION IF EXISTS bug9056_func1;
|
|||||||
DROP FUNCTION IF EXISTS bug9056_func2;
|
DROP FUNCTION IF EXISTS bug9056_func2;
|
||||||
DROP PROCEDURE IF EXISTS bug9056_proc1;
|
DROP PROCEDURE IF EXISTS bug9056_proc1;
|
||||||
DROP PROCEDURE IF EXISTS bug9056_proc2;
|
DROP PROCEDURE IF EXISTS bug9056_proc2;
|
||||||
|
DROP PROCEDURE IF EXISTS `a'b`;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
CREATE TABLE t1 (id int);
|
CREATE TABLE t1 (id int);
|
||||||
|
@ -237,13 +237,18 @@ drop table t1;
|
|||||||
#select a,b,length(a),length(b) from t1 where a='c' and b='c';
|
#select a,b,length(a),length(b) from t1 where a='c' and b='c';
|
||||||
#drop table t1;
|
#drop table t1;
|
||||||
|
|
||||||
# bug
|
# bug#14007
|
||||||
create table t1 (
|
create table t1 (
|
||||||
a char(10) primary key
|
a char(10) primary key
|
||||||
) engine=ndb;
|
) engine=ndbcluster default charset=latin1;
|
||||||
insert into t1 values ('jonas % ');
|
|
||||||
replace into t1 values ('jonas % ');
|
insert into t1 values ('aaabb');
|
||||||
replace into t1 values ('jonas % ');
|
select * from t1;
|
||||||
|
replace into t1 set a = 'AAABB';
|
||||||
|
select * from t1;
|
||||||
|
replace into t1 set a = 'aAaBb';
|
||||||
|
select * from t1;
|
||||||
|
replace into t1 set a = 'aaabb';
|
||||||
select * from t1;
|
select * from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
@ -162,3 +162,13 @@ UNLOCK TABLES;
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG 14524
|
||||||
|
#
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`id` int(11) default NULL
|
||||||
|
) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
103
mysql-test/t/read_only.test
Normal file
103
mysql-test/t/read_only.test
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
# Test of the READ_ONLY global variable:
|
||||||
|
# check that it blocks updates unless they are only on temporary tables.
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS t1,t2,t3;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
# READ_ONLY does nothing to SUPER users
|
||||||
|
# so we use a non-SUPER one:
|
||||||
|
|
||||||
|
grant CREATE, SELECT, DROP on *.* to test@localhost;
|
||||||
|
|
||||||
|
connect (con1,localhost,test,,test);
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
|
||||||
|
set global read_only=0;
|
||||||
|
|
||||||
|
connection con1;
|
||||||
|
|
||||||
|
create table t1 (a int);
|
||||||
|
|
||||||
|
insert into t1 values(1);
|
||||||
|
|
||||||
|
create table t2 select * from t1;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
|
||||||
|
set global read_only=1;
|
||||||
|
|
||||||
|
# We check that SUPER can:
|
||||||
|
|
||||||
|
create table t3 (a int);
|
||||||
|
drop table t3;
|
||||||
|
|
||||||
|
connection con1;
|
||||||
|
|
||||||
|
select @@global.read_only;
|
||||||
|
|
||||||
|
--error 1290
|
||||||
|
create table t3 (a int);
|
||||||
|
|
||||||
|
--error 1290
|
||||||
|
insert into t1 values(1);
|
||||||
|
|
||||||
|
# if a statement, after parse stage, looks like it will update a
|
||||||
|
# non-temp table, it will be rejected, even if at execution it would
|
||||||
|
# have turned out that 0 rows would be updated
|
||||||
|
--error 1290
|
||||||
|
update t1 set a=1 where 1=0;
|
||||||
|
|
||||||
|
# multi-update is special (see sql_parse.cc) so we test it
|
||||||
|
--error 1290
|
||||||
|
update t1,t2 set t1.a=t2.a+1 where t1.a=t2.a;
|
||||||
|
|
||||||
|
# check multi-delete to be sure
|
||||||
|
--error 1290
|
||||||
|
delete t1,t2 from t1,t2 where t1.a=t2.a;
|
||||||
|
|
||||||
|
# With temp tables updates should be accepted:
|
||||||
|
|
||||||
|
create temporary table t3 (a int);
|
||||||
|
|
||||||
|
create temporary table t4 (a int) select * from t3;
|
||||||
|
|
||||||
|
insert into t3 values(1);
|
||||||
|
|
||||||
|
insert into t4 select * from t3;
|
||||||
|
|
||||||
|
# a non-temp table updated:
|
||||||
|
--error 1290
|
||||||
|
update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
|
||||||
|
|
||||||
|
# no non-temp table updated (just swapped):
|
||||||
|
update t1,t3 set t3.a=t1.a+1 where t1.a=t3.a;
|
||||||
|
|
||||||
|
update t4,t3 set t4.a=t3.a+1 where t4.a=t3.a;
|
||||||
|
|
||||||
|
--error 1290
|
||||||
|
delete t1 from t1,t3 where t1.a=t3.a;
|
||||||
|
|
||||||
|
delete t3 from t1,t3 where t1.a=t3.a;
|
||||||
|
|
||||||
|
delete t4 from t3,t4 where t4.a=t3.a;
|
||||||
|
|
||||||
|
# and even homonymous ones
|
||||||
|
|
||||||
|
create temporary table t1 (a int);
|
||||||
|
|
||||||
|
insert into t1 values(1);
|
||||||
|
|
||||||
|
update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
|
||||||
|
|
||||||
|
delete t1 from t1,t3 where t1.a=t3.a;
|
||||||
|
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
--error 1290
|
||||||
|
insert into t1 values(1);
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
drop table t1,t2;
|
||||||
|
drop user test@localhost;
|
@ -13,6 +13,7 @@ insert into mysqltest1.t1 values (1);
|
|||||||
select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
|
select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
|
||||||
create table mysqltest1.t2 (n int);
|
create table mysqltest1.t2 (n int);
|
||||||
create table mysqltest1.t3 (n int);
|
create table mysqltest1.t3 (n int);
|
||||||
|
--replace_result \\ /
|
||||||
--error 1010
|
--error 1010
|
||||||
drop database mysqltest1;
|
drop database mysqltest1;
|
||||||
use mysqltest1;
|
use mysqltest1;
|
||||||
@ -29,6 +30,7 @@ while ($1)
|
|||||||
}
|
}
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
|
--replace_result \\ /
|
||||||
--error 1010
|
--error 1010
|
||||||
drop database mysqltest1;
|
drop database mysqltest1;
|
||||||
use mysqltest1;
|
use mysqltest1;
|
||||||
|
@ -1 +1 @@
|
|||||||
--log_bin_trust_routine_creators=0
|
--log_bin_trust_routine_creators=0 --slave-skip-errors=1062
|
||||||
|
@ -1,10 +1,18 @@
|
|||||||
# Test of replication of stored procedures (WL#2146 for MySQL 5.0)
|
# Test of replication of stored procedures (WL#2146 for MySQL 5.0)
|
||||||
|
# Modified by WL#2971.
|
||||||
|
|
||||||
|
# Note that in the .opt files we still use the old variable name
|
||||||
|
# log-bin-trust-routine-creators so that this test checks that it's
|
||||||
|
# still accepted (this test also checks that the new name is
|
||||||
|
# accepted). The old name could be removed in 5.1 or 6.0.
|
||||||
|
|
||||||
source include/master-slave.inc;
|
source include/master-slave.inc;
|
||||||
|
|
||||||
# First let's test replication of current_user() (that's a related thing)
|
|
||||||
# we need a db != test, where we don't have automatic grants
|
# we need a db != test, where we don't have automatic grants
|
||||||
create database if not exists mysqltest1;
|
--disable_warnings
|
||||||
|
drop database if exists mysqltest1;
|
||||||
|
--enable_warnings
|
||||||
|
create database mysqltest1;
|
||||||
use mysqltest1;
|
use mysqltest1;
|
||||||
create table t1 (a varchar(100));
|
create table t1 (a varchar(100));
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
@ -16,18 +24,14 @@ use mysqltest1;
|
|||||||
# (same definer, same properties...)
|
# (same definer, same properties...)
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
# cleanup
|
|
||||||
--disable_warnings
|
|
||||||
drop procedure if exists foo;
|
|
||||||
drop procedure if exists foo2;
|
|
||||||
drop procedure if exists foo3;
|
|
||||||
drop procedure if exists foo4;
|
|
||||||
drop procedure if exists bar;
|
|
||||||
drop function if exists fn1;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
delimiter |;
|
delimiter |;
|
||||||
--error 1418 # not deterministic
|
|
||||||
|
# Stored procedures don't have the limitations that functions have
|
||||||
|
# regarding binlogging: it's ok to create a procedure as not
|
||||||
|
# deterministic and updating data, while it's not ok to create such a
|
||||||
|
# function. We test this.
|
||||||
|
|
||||||
create procedure foo()
|
create procedure foo()
|
||||||
begin
|
begin
|
||||||
declare b int;
|
declare b int;
|
||||||
@ -35,17 +39,6 @@ begin
|
|||||||
insert into t1 values (b);
|
insert into t1 values (b);
|
||||||
insert into t1 values (unix_timestamp());
|
insert into t1 values (unix_timestamp());
|
||||||
end|
|
end|
|
||||||
|
|
||||||
--replace_column 2 # 5 #
|
|
||||||
show binlog events from 98| # check that not there
|
|
||||||
|
|
||||||
create procedure foo() deterministic
|
|
||||||
begin
|
|
||||||
declare b int;
|
|
||||||
set b = 8;
|
|
||||||
insert into t1 values (b);
|
|
||||||
insert into t1 values (unix_timestamp());
|
|
||||||
end|
|
|
||||||
delimiter ;|
|
delimiter ;|
|
||||||
|
|
||||||
# we replace columns having times
|
# we replace columns having times
|
||||||
@ -54,38 +47,29 @@ delimiter ;|
|
|||||||
--replace_column 13 # 14 #
|
--replace_column 13 # 14 #
|
||||||
select * from mysql.proc where name='foo' and db='mysqltest1';
|
select * from mysql.proc where name='foo' and db='mysqltest1';
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
# You will notice in the result that the definer does not match what
|
||||||
|
# it is on master, it is a known bug on which Alik is working
|
||||||
--replace_result localhost.localdomain localhost 127.0.0.1 localhost
|
--replace_result localhost.localdomain localhost 127.0.0.1 localhost
|
||||||
--replace_column 13 # 14 #
|
--replace_column 13 # 14 #
|
||||||
select * from mysql.proc where name='foo' and db='mysqltest1';
|
select * from mysql.proc where name='foo' and db='mysqltest1';
|
||||||
|
|
||||||
# Now when we call it, does the CALL() get into binlog,
|
|
||||||
# or the substatements?
|
|
||||||
connection master;
|
connection master;
|
||||||
# see if timestamp used in SP on slave is same as on master
|
# see if timestamp used in SP on slave is same as on master
|
||||||
set timestamp=1000000000;
|
set timestamp=1000000000;
|
||||||
call foo();
|
call foo();
|
||||||
--replace_column 2 # 5 #
|
|
||||||
show binlog events from 308;
|
|
||||||
select * from t1;
|
select * from t1;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
# Now a SP which is supposed to not update tables (CALL should not be
|
# Now a SP which is not updating tables
|
||||||
# binlogged) as it's "read sql data", so should not give error even if
|
|
||||||
# non-deterministic.
|
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
delete from t1;
|
delete from t1;
|
||||||
create procedure foo2()
|
create procedure foo2()
|
||||||
not deterministic
|
|
||||||
reads sql data
|
|
||||||
select * from mysqltest1.t1;
|
select * from mysqltest1.t1;
|
||||||
call foo2();
|
call foo2();
|
||||||
# verify CALL is not in binlog
|
|
||||||
--replace_column 2 # 5 #
|
|
||||||
show binlog events from 518;
|
|
||||||
|
|
||||||
--error 1418
|
# check that this is allowed (it's not for functions):
|
||||||
alter procedure foo2 contains sql;
|
alter procedure foo2 contains sql;
|
||||||
|
|
||||||
# SP with definer's right
|
# SP with definer's right
|
||||||
@ -106,15 +90,7 @@ grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
|
|||||||
connect (con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,);
|
connect (con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,);
|
||||||
connection con1;
|
connection con1;
|
||||||
|
|
||||||
--error 1419 # only full-global-privs user can create a routine
|
# this routine will fail in the second INSERT because of privileges
|
||||||
create procedure foo4()
|
|
||||||
deterministic
|
|
||||||
insert into t1 values (10);
|
|
||||||
|
|
||||||
connection master;
|
|
||||||
set global log_bin_trust_routine_creators=1;
|
|
||||||
connection con1;
|
|
||||||
|
|
||||||
delimiter |;
|
delimiter |;
|
||||||
create procedure foo4()
|
create procedure foo4()
|
||||||
deterministic
|
deterministic
|
||||||
@ -128,29 +104,22 @@ delimiter ;|
|
|||||||
# I add ,0 so that it does not print the error in the test output,
|
# I add ,0 so that it does not print the error in the test output,
|
||||||
# because this error is hostname-dependent
|
# because this error is hostname-dependent
|
||||||
--error 1142,0
|
--error 1142,0
|
||||||
call foo4(); # invoker has no INSERT grant on table => failure
|
call foo4(); # invoker has no INSERT grant on table t1 => failure
|
||||||
show warnings;
|
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
call foo3(); # success (definer == root)
|
call foo3(); # success (definer == root)
|
||||||
show warnings;
|
show warnings;
|
||||||
|
|
||||||
--replace_result localhost.localdomain localhost 127.0.0.1 localhost
|
|
||||||
--error 1142,0
|
--error 1142,0
|
||||||
call foo4(); # definer's rights => failure
|
call foo4(); # definer's rights => failure
|
||||||
show warnings;
|
|
||||||
|
|
||||||
# we test replication of ALTER PROCEDURE
|
# we test replication of ALTER PROCEDURE
|
||||||
alter procedure foo4 sql security invoker;
|
alter procedure foo4 sql security invoker;
|
||||||
call foo4(); # invoker's rights => success
|
call foo4(); # invoker's rights => success
|
||||||
show warnings;
|
show warnings;
|
||||||
|
|
||||||
# Check that only successful CALLs are in binlog
|
# Note that half-failed procedure calls are ok with binlogging;
|
||||||
--replace_column 2 # 5 #
|
# if we compare t2 on master and slave we see they are identical:
|
||||||
show binlog events from 990;
|
|
||||||
|
|
||||||
# Note that half-failed CALLs are not in binlog, which is a known
|
|
||||||
# bug. If we compare t2 on master and slave we see they differ:
|
|
||||||
|
|
||||||
select * from t1;
|
select * from t1;
|
||||||
select * from t2;
|
select * from t2;
|
||||||
@ -158,6 +127,30 @@ sync_slave_with_master;
|
|||||||
select * from t1;
|
select * from t1;
|
||||||
select * from t2;
|
select * from t2;
|
||||||
|
|
||||||
|
# Let's check another failing-in-the-middle procedure
|
||||||
|
connection master;
|
||||||
|
delete from t2;
|
||||||
|
alter table t2 add unique (a);
|
||||||
|
|
||||||
|
drop procedure foo4;
|
||||||
|
delimiter |;
|
||||||
|
create procedure foo4()
|
||||||
|
deterministic
|
||||||
|
begin
|
||||||
|
insert into t2 values(20),(20);
|
||||||
|
end|
|
||||||
|
|
||||||
|
delimiter ;|
|
||||||
|
|
||||||
|
--error 1062
|
||||||
|
call foo4();
|
||||||
|
show warnings;
|
||||||
|
|
||||||
|
select * from t2;
|
||||||
|
sync_slave_with_master;
|
||||||
|
# check that this failed-in-the-middle replicated right:
|
||||||
|
select * from t2;
|
||||||
|
|
||||||
# Test of DROP PROCEDURE
|
# Test of DROP PROCEDURE
|
||||||
|
|
||||||
--replace_result localhost.localdomain localhost 127.0.0.1 localhost
|
--replace_result localhost.localdomain localhost 127.0.0.1 localhost
|
||||||
@ -177,6 +170,14 @@ drop procedure foo2;
|
|||||||
drop procedure foo3;
|
drop procedure foo3;
|
||||||
|
|
||||||
delimiter |;
|
delimiter |;
|
||||||
|
# check that needs "deterministic"
|
||||||
|
--error 1418
|
||||||
|
create function fn1(x int)
|
||||||
|
returns int
|
||||||
|
begin
|
||||||
|
insert into t1 values (x);
|
||||||
|
return x+2;
|
||||||
|
end|
|
||||||
create function fn1(x int)
|
create function fn1(x int)
|
||||||
returns int
|
returns int
|
||||||
deterministic
|
deterministic
|
||||||
@ -202,15 +203,69 @@ drop function fn1;
|
|||||||
|
|
||||||
create function fn1()
|
create function fn1()
|
||||||
returns int
|
returns int
|
||||||
deterministic
|
no sql
|
||||||
begin
|
begin
|
||||||
return unix_timestamp();
|
return unix_timestamp();
|
||||||
end|
|
end|
|
||||||
|
|
||||||
delimiter ;|
|
delimiter ;|
|
||||||
|
# check that needs "deterministic"
|
||||||
|
--error 1418
|
||||||
|
alter function fn1 contains sql;
|
||||||
|
|
||||||
delete from t1;
|
delete from t1;
|
||||||
set timestamp=1000000000;
|
set timestamp=1000000000;
|
||||||
insert into t1 values(fn1());
|
insert into t1 values(fn1());
|
||||||
|
|
||||||
|
connection con1;
|
||||||
|
|
||||||
|
delimiter |;
|
||||||
|
--error 1419 # only full-global-privs user can create a function
|
||||||
|
create function fn2()
|
||||||
|
returns int
|
||||||
|
no sql
|
||||||
|
begin
|
||||||
|
return unix_timestamp();
|
||||||
|
end|
|
||||||
|
delimiter ;|
|
||||||
|
connection master;
|
||||||
|
# test old variable name:
|
||||||
|
set global log_bin_trust_routine_creators=1;
|
||||||
|
# now use new name:
|
||||||
|
set global log_bin_trust_function_creators=0;
|
||||||
|
set global log_bin_trust_function_creators=1;
|
||||||
|
# slave needs it too otherwise will not execute what master allowed:
|
||||||
|
connection slave;
|
||||||
|
set global log_bin_trust_function_creators=1;
|
||||||
|
|
||||||
|
connection con1;
|
||||||
|
|
||||||
|
delimiter |;
|
||||||
|
create function fn2()
|
||||||
|
returns int
|
||||||
|
no sql
|
||||||
|
begin
|
||||||
|
return unix_timestamp();
|
||||||
|
end|
|
||||||
|
delimiter ;|
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
|
||||||
|
# Now a function which is supposed to not update tables
|
||||||
|
# as it's "reads sql data", so should not give error even if
|
||||||
|
# non-deterministic.
|
||||||
|
|
||||||
|
delimiter |;
|
||||||
|
create function fn3()
|
||||||
|
returns int
|
||||||
|
not deterministic
|
||||||
|
reads sql data
|
||||||
|
begin
|
||||||
|
return 0;
|
||||||
|
end|
|
||||||
|
delimiter ;|
|
||||||
|
|
||||||
|
select fn3();
|
||||||
--replace_result localhost.localdomain localhost 127.0.0.1 localhost
|
--replace_result localhost.localdomain localhost 127.0.0.1 localhost
|
||||||
--replace_column 13 # 14 #
|
--replace_column 13 # 14 #
|
||||||
select * from mysql.proc where db='mysqltest1';
|
select * from mysql.proc where db='mysqltest1';
|
||||||
@ -223,18 +278,43 @@ select * from t1;
|
|||||||
--replace_column 13 # 14 #
|
--replace_column 13 # 14 #
|
||||||
select * from mysql.proc where db='mysqltest1';
|
select * from mysql.proc where db='mysqltest1';
|
||||||
|
|
||||||
# And now triggers
|
# Let's check a failing-in-the-middle function
|
||||||
|
connection master;
|
||||||
|
delete from t2;
|
||||||
|
alter table t2 add unique (a);
|
||||||
|
|
||||||
|
drop function fn1;
|
||||||
|
|
||||||
|
delimiter |;
|
||||||
|
create function fn1()
|
||||||
|
returns int
|
||||||
|
begin
|
||||||
|
insert into t2 values(20),(20);
|
||||||
|
return 10;
|
||||||
|
end|
|
||||||
|
|
||||||
|
delimiter ;|
|
||||||
|
|
||||||
|
# Because of BUG#14769 the following statement requires that we start
|
||||||
|
# slave with --slave-skip-errors=1062. When that bug is fixed, that
|
||||||
|
# option can be removed.
|
||||||
|
|
||||||
|
--error 1062
|
||||||
|
select fn1();
|
||||||
|
|
||||||
|
select * from t2;
|
||||||
|
sync_slave_with_master;
|
||||||
|
|
||||||
|
# check that this failed-in-the-middle replicated right:
|
||||||
|
select * from t2;
|
||||||
|
|
||||||
|
# ********************** PART 3 : TRIGGERS ***************
|
||||||
|
|
||||||
connection con1;
|
connection con1;
|
||||||
--error 1227
|
--error 1227
|
||||||
create trigger trg before insert on t1 for each row set new.a= 10;
|
create trigger trg before insert on t1 for each row set new.a= 10;
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
# fn1() above uses timestamps, so in !ps-protocol, the timezone will be
|
|
||||||
# binlogged, but in --ps-protocol it will not be (BUG#9359) so
|
|
||||||
# the binlog offsets get shifted which spoils SHOW BINLOG EVENTS.
|
|
||||||
# To be immune, we take a new binlog.
|
|
||||||
flush logs;
|
|
||||||
delete from t1;
|
delete from t1;
|
||||||
# TODO: when triggers can contain an update, test that this update
|
# TODO: when triggers can contain an update, test that this update
|
||||||
# does not go into binlog.
|
# does not go into binlog.
|
||||||
@ -253,7 +333,7 @@ drop trigger trg;
|
|||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
select * from t1;
|
select * from t1;
|
||||||
--replace_column 2 # 5 #
|
--replace_column 2 # 5 #
|
||||||
show binlog events in 'master-bin.000002' from 98;
|
show binlog events in 'master-bin.000001' from 98;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|
||||||
@ -280,4 +360,40 @@ connection master;
|
|||||||
drop function fn1;
|
drop function fn1;
|
||||||
drop database mysqltest1;
|
drop database mysqltest1;
|
||||||
drop user "zedjzlcsjhd"@127.0.0.1;
|
drop user "zedjzlcsjhd"@127.0.0.1;
|
||||||
|
use test;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
use test;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#14077 "Failure to replicate a stored function with a cursor":
|
||||||
|
# verify that stored routines with cursors work on slave.
|
||||||
|
#
|
||||||
|
connection master;
|
||||||
|
--disable_warnings
|
||||||
|
drop function if exists f1;
|
||||||
|
--enable_warnings
|
||||||
|
delimiter |;
|
||||||
|
create function f1() returns int reads sql data
|
||||||
|
begin
|
||||||
|
declare var integer;
|
||||||
|
declare c cursor for select a from v1;
|
||||||
|
open c;
|
||||||
|
fetch c into var;
|
||||||
|
close c;
|
||||||
|
return var;
|
||||||
|
end|
|
||||||
|
delimiter ;|
|
||||||
|
create view v1 as select 1 as a;
|
||||||
|
create table t1 (a int);
|
||||||
|
insert into t1 (a) values (f1());
|
||||||
|
select * from t1;
|
||||||
|
drop view v1;
|
||||||
|
drop function f1;
|
||||||
|
sync_slave_with_master;
|
||||||
|
connection slave;
|
||||||
|
select * from t1;
|
||||||
|
|
||||||
|
# cleanup
|
||||||
|
connection master;
|
||||||
|
drop table t1;
|
||||||
|
reset master;
|
||||||
|
@ -87,12 +87,35 @@ insert into t1 set a = now();
|
|||||||
select a=b && a=c from t1;
|
select a=b && a=c from t1;
|
||||||
let $time=`select a from t1`;
|
let $time=`select a from t1`;
|
||||||
|
|
||||||
|
# Check that definer attribute is replicated properly:
|
||||||
|
# - dump definers on the master;
|
||||||
|
# - wait for the slave to synchronize with the master;
|
||||||
|
# - dump definers on the slave;
|
||||||
|
|
||||||
|
SELECT routine_name, definer
|
||||||
|
FROM information_schema.routines;
|
||||||
|
|
||||||
|
SELECT trigger_name, definer
|
||||||
|
FROM information_schema.triggers;
|
||||||
|
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
select "--- On slave --" as "";
|
select "--- On slave --" as "";
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
|
# XXX: Definers of stored procedures and functions are not replicated. WL#2897
|
||||||
|
# (Complete definer support in the stored routines) addresses this issue. So,
|
||||||
|
# the result file is expected to be changed after implementation of this WL
|
||||||
|
# item.
|
||||||
|
|
||||||
|
SELECT routine_name, definer
|
||||||
|
FROM information_schema.routines;
|
||||||
|
|
||||||
|
SELECT trigger_name, definer
|
||||||
|
FROM information_schema.triggers;
|
||||||
|
|
||||||
select a=b && a=c from t1;
|
select a=b && a=c from t1;
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
eval select a='$time' as 'test' from t1;
|
eval select a='$time' as 'test' from t1;
|
||||||
|
@ -2729,3 +2729,23 @@ select * from t1 where f2 >= '2005-09-3a';
|
|||||||
select * from t1 where f2 <= '2005-09-31';
|
select * from t1 where f2 <= '2005-09-31';
|
||||||
select * from t1 where f2 <= '2005-09-3a';
|
select * from t1 where f2 <= '2005-09-3a';
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug ##14662 ORDER BY on column of a view, with an alias of the same
|
||||||
|
# column causes ambiguous
|
||||||
|
#
|
||||||
|
|
||||||
|
create table t1 (f1 int, f2 int);
|
||||||
|
insert into t1 values (1, 30), (2, 20), (3, 10);
|
||||||
|
create algorithm=merge view v1 as select f1, f2 from t1;
|
||||||
|
create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1;
|
||||||
|
create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1;
|
||||||
|
select t1.f1 as x1, f1 from t1 order by t1.f1;
|
||||||
|
select v1.f1 as x1, f1 from v1 order by v1.f1;
|
||||||
|
select v2.f1 as x1, f1 from v2 order by v2.f1;
|
||||||
|
select v3.f1 as x1, f1 from v3 order by v3.f1;
|
||||||
|
select f1, f2, v1.f1 as x1 from v1 order by v1.f1;
|
||||||
|
select f1, f2, v2.f1 as x1 from v2 order by v2.f1;
|
||||||
|
select f1, f2, v3.f1 as x1 from v3 order by v3.f1;
|
||||||
|
drop table t1;
|
||||||
|
drop view v1, v2, v3;
|
||||||
|
@ -424,3 +424,7 @@ DROP TABLE urkunde;
|
|||||||
#
|
#
|
||||||
--error 1049
|
--error 1049
|
||||||
SHOW TABLES FROM non_existing_database;
|
SHOW TABLES FROM non_existing_database;
|
||||||
|
|
||||||
|
# End of 4.1 tests
|
||||||
|
#
|
||||||
|
SHOW AUTHORS;
|
||||||
|
@ -9,7 +9,7 @@ use test;
|
|||||||
# test that we can create VIEW if privileges check switched off
|
# test that we can create VIEW if privileges check switched off
|
||||||
#
|
#
|
||||||
create table t1 (field1 INT);
|
create table t1 (field1 INT);
|
||||||
-- error ER_NO_VIEW_USER
|
-- error ER_MALFORMED_DEFINER
|
||||||
CREATE VIEW v1 AS SELECT field1 FROM t1;
|
CREATE VIEW v1 AS SELECT field1 FROM t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
@ -1233,6 +1233,10 @@ begin
|
|||||||
select password;
|
select password;
|
||||||
end|
|
end|
|
||||||
|
|
||||||
|
# Check that an error message is sent
|
||||||
|
--error ER_PARSE_ERROR
|
||||||
|
set names='foo2'|
|
||||||
|
|
||||||
--error ER_SP_BAD_VAR_SHADOW
|
--error ER_SP_BAD_VAR_SHADOW
|
||||||
create procedure bug13510_2()
|
create procedure bug13510_2()
|
||||||
begin
|
begin
|
||||||
@ -1263,8 +1267,168 @@ call bug13510_4()|
|
|||||||
|
|
||||||
drop procedure bug13510_3|
|
drop procedure bug13510_3|
|
||||||
drop procedure bug13510_4|
|
drop procedure bug13510_4|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test that statements which implicitly commit transaction are prohibited
|
||||||
|
# in stored function and triggers. Attempt to create function or trigger
|
||||||
|
# containing such statement should produce error (includes test for
|
||||||
|
# bug #13627).
|
||||||
|
#
|
||||||
|
--disable_warnings
|
||||||
|
drop function if exists bug_13627_f|
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a int)|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DROP TRIGGER test1; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN DROP TRIGGER test1; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_SP_BADSTATEMENT
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN load table t1 from master; END |
|
||||||
|
-- error ER_SP_BADSTATEMENT
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN load table t1 from master; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create table t2 (a int); END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create table t2 (a int); return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create index t1_i on t1 (a); END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create index t1_i on t1 (a); return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN alter table t1 add column b int; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN alter table t1 add column b int; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN rename table t1 to t2; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN rename table t1 to t2; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN truncate table t1; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN truncate table t1; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop table t1; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop table t1; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop index t1_i on t1; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop index t1_i on t1; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_SP_BADSTATEMENT
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN unlock tables; END |
|
||||||
|
-- error ER_SP_BADSTATEMENT
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN unlock tables; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_SP_BADSTATEMENT
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN LOCK TABLE t1 READ; END |
|
||||||
|
-- error ER_SP_BADSTATEMENT
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN LOCK TABLE t1 READ; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create database mysqltest; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create database mysqltest; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop database mysqltest; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop database mysqltest; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create user 'mysqltest_1'; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create user 'mysqltest_1'; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop user 'mysqltest_1'; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop user 'mysqltest_1'; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN rename user 'mysqltest_2' to 'mysqltest_1'; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN rename user 'mysqltest_2' to 'mysqltest_1'; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create view v1 as select 1; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create view v1 as select 1; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN alter view v1 as select 1; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN alter view v1 as select 1; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop view v1; END |
|
||||||
|
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop view v1; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_SP_NO_RECURSIVE_CREATE
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create trigger tr2 before insert on t1 for each row do select 1; END |
|
||||||
|
-- error ER_SP_NO_RECURSIVE_CREATE
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create trigger tr2 before insert on t1 for each row do select 1; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_SP_NO_DROP_SP
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop function bug_13627_f; END |
|
||||||
|
-- error ER_SP_NO_DROP_SP
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN drop function bug_13627_f; return 1; END |
|
||||||
|
|
||||||
|
-- error ER_SP_NO_RECURSIVE_CREATE
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create function f2 () returns int return 1; END |
|
||||||
|
-- error ER_SP_NO_RECURSIVE_CREATE
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int BEGIN create function f2 () returns int return 1; return 1; END |
|
||||||
|
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
CREATE TEMPORARY TABLE t2 (a int);
|
||||||
|
DROP TEMPORARY TABLE t2;
|
||||||
|
END |
|
||||||
|
CREATE FUNCTION bug_13627_f() returns int
|
||||||
|
BEGIN
|
||||||
|
CREATE TEMPORARY TABLE t2 (a int);
|
||||||
|
DROP TEMPORARY TABLE t2;
|
||||||
|
return 1;
|
||||||
|
END |
|
||||||
|
|
||||||
|
drop table t1|
|
||||||
|
drop function bug_13627_f|
|
||||||
|
|
||||||
delimiter ;|
|
delimiter ;|
|
||||||
|
|
||||||
|
# BUG#12329: "Bogus error msg when executing PS with stored procedure after
|
||||||
|
# SP was re-created". See also test for related bug#13399 in trigger.test
|
||||||
|
--disable_warnings
|
||||||
|
drop function if exists bug12329;
|
||||||
|
--enable_warnings
|
||||||
|
create table t1 as select 1 a;
|
||||||
|
create table t2 as select 1 a;
|
||||||
|
create function bug12329() returns int return (select a from t1);
|
||||||
|
prepare stmt1 from 'select bug12329()';
|
||||||
|
execute stmt1;
|
||||||
|
drop function bug12329;
|
||||||
|
create function bug12329() returns int return (select a+100 from t2);
|
||||||
|
select bug12329();
|
||||||
|
# Until we implement proper mechanism for invalidation of PS/SP when table
|
||||||
|
# or SP's are changed the following statement will fail with 'Table ... was
|
||||||
|
# not locked' error (this mechanism should be based on the new TDC).
|
||||||
|
--error 1100
|
||||||
|
execute stmt1;
|
||||||
|
deallocate prepare stmt1;
|
||||||
|
drop function bug12329;
|
||||||
|
drop table t1, t2;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug#13514 "server crash when create a stored procedure before choose a
|
# Bug#13514 "server crash when create a stored procedure before choose a
|
||||||
# database" and
|
# database" and
|
||||||
@ -1337,6 +1501,22 @@ DROP PROCEDURE bug13037_p1;
|
|||||||
DROP PROCEDURE bug13037_p2;
|
DROP PROCEDURE bug13037_p2;
|
||||||
DROP PROCEDURE bug13037_p3;
|
DROP PROCEDURE bug13037_p3;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#14569 "editing a stored procedure kills mysqld-nt"
|
||||||
|
#
|
||||||
|
create database mysqltest1;
|
||||||
|
create database mysqltest2;
|
||||||
|
use mysqltest1;
|
||||||
|
drop database mysqltest1;
|
||||||
|
create procedure mysqltest2.p1() select version();
|
||||||
|
--error ER_NO_DB_ERROR
|
||||||
|
create procedure p2() select version();
|
||||||
|
use mysqltest2;
|
||||||
|
--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||||
|
show procedure status;
|
||||||
|
drop database mysqltest2;
|
||||||
|
use test;
|
||||||
|
|
||||||
|
|
||||||
# BUG#NNNN: New bug synopsis
|
# BUG#NNNN: New bug synopsis
|
||||||
#
|
#
|
||||||
|
@ -4541,6 +4541,59 @@ drop table t3, t4|
|
|||||||
drop procedure bug14210|
|
drop procedure bug14210|
|
||||||
set @@session.max_heap_table_size=default|
|
set @@session.max_heap_table_size=default|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#1473: Dumping of stored functions seems to cause corruption in
|
||||||
|
# the function body
|
||||||
|
#
|
||||||
|
--disable_warnings
|
||||||
|
drop function if exists bug14723|
|
||||||
|
drop procedure if exists bug14723|
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
delimiter ;;|
|
||||||
|
/*!50003 create function bug14723()
|
||||||
|
returns bigint(20)
|
||||||
|
main_loop: begin
|
||||||
|
return 42;
|
||||||
|
end */;;
|
||||||
|
show create function bug14723;;
|
||||||
|
select bug14723();;
|
||||||
|
|
||||||
|
/*!50003 create procedure bug14723()
|
||||||
|
main_loop: begin
|
||||||
|
select 42;
|
||||||
|
end */;;
|
||||||
|
show create procedure bug14723;;
|
||||||
|
call bug14723();;
|
||||||
|
|
||||||
|
delimiter |;;
|
||||||
|
|
||||||
|
drop function bug14723|
|
||||||
|
drop procedure bug14723|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#14845 "mysql_stmt_fetch returns MYSQL_NO_DATA when COUNT(*) is 0"
|
||||||
|
# Check that when fetching from a cursor, COUNT(*) works properly.
|
||||||
|
#
|
||||||
|
create procedure bug14845()
|
||||||
|
begin
|
||||||
|
declare a char(255);
|
||||||
|
declare done int default 0;
|
||||||
|
declare c cursor for select count(*) from t1 where 1 = 0;
|
||||||
|
declare continue handler for sqlstate '02000' set done = 1;
|
||||||
|
open c;
|
||||||
|
repeat
|
||||||
|
fetch c into a;
|
||||||
|
if not done then
|
||||||
|
select a;
|
||||||
|
end if;
|
||||||
|
until done end repeat;
|
||||||
|
close c;
|
||||||
|
end|
|
||||||
|
call bug14845()|
|
||||||
|
drop procedure bug14845|
|
||||||
|
|
||||||
#
|
#
|
||||||
# BUG#NNNN: New bug synopsis
|
# BUG#NNNN: New bug synopsis
|
||||||
#
|
#
|
||||||
|
@ -183,3 +183,57 @@ group by country;
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#14342: wrong placement of subquery internals in complex queries
|
||||||
|
#
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`t3_id` int NOT NULL,
|
||||||
|
`t1_id` int NOT NULL,
|
||||||
|
PRIMARY KEY (`t1_id`)
|
||||||
|
);
|
||||||
|
CREATE TABLE `t2` (
|
||||||
|
`t2_id` int NOT NULL,
|
||||||
|
`t1_id` int NOT NULL,
|
||||||
|
`b` int NOT NULL,
|
||||||
|
PRIMARY KEY (`t2_id`),
|
||||||
|
UNIQUE KEY `idx_t2_t1_b` (`t1_id`,`b`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
CREATE TABLE `t3` (
|
||||||
|
`t3_id` int NOT NULL
|
||||||
|
);
|
||||||
|
INSERT INTO `t3` VALUES (3);
|
||||||
|
select
|
||||||
|
(SELECT rs.t2_id
|
||||||
|
FROM t2 rs
|
||||||
|
WHERE rs.t1_id=
|
||||||
|
(SELECT lt.t1_id
|
||||||
|
FROM t1 lt
|
||||||
|
WHERE lt.t3_id=a.t3_id)
|
||||||
|
ORDER BY b DESC LIMIT 1)
|
||||||
|
from t3 AS a;
|
||||||
|
# repeat above query in SP
|
||||||
|
--disable_warnings
|
||||||
|
DROP PROCEDURE IF EXISTS p1;
|
||||||
|
--enable_warnings
|
||||||
|
delimiter //;
|
||||||
|
create procedure p1()
|
||||||
|
begin
|
||||||
|
declare done int default 3;
|
||||||
|
repeat
|
||||||
|
select
|
||||||
|
(SELECT rs.t2_id
|
||||||
|
FROM t2 rs
|
||||||
|
WHERE rs.t1_id=
|
||||||
|
(SELECT lt.t1_id
|
||||||
|
FROM t1 lt
|
||||||
|
WHERE lt.t3_id=a.t3_id)
|
||||||
|
ORDER BY b DESC LIMIT 1) as x
|
||||||
|
from t3 AS a;
|
||||||
|
set done= done-1;
|
||||||
|
until done <= 0 end repeat;
|
||||||
|
end//
|
||||||
|
delimiter ;//
|
||||||
|
call p1();
|
||||||
|
call p1();
|
||||||
|
call p1();
|
||||||
|
drop tables t1,t2,t3;
|
||||||
|
83
mysql-test/t/trigger-compat.test
Normal file
83
mysql-test/t/trigger-compat.test
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
# Test case(s) in this file contain(s) GRANT/REVOKE statements, which are not
|
||||||
|
# supported in embedded server. So, this test should not be run on embedded
|
||||||
|
# server.
|
||||||
|
|
||||||
|
-- source include/not_embedded.inc
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
#
|
||||||
|
# Tests for WL#2818:
|
||||||
|
# - Check that triggers created w/o DEFINER information work well:
|
||||||
|
# - create the first trigger;
|
||||||
|
# - manually remove definer information from corresponding TRG file;
|
||||||
|
# - create the second trigger (the first trigger will be reloaded; check
|
||||||
|
# that we receive a warning);
|
||||||
|
# - check that the triggers loaded correctly;
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# Prepare environment.
|
||||||
|
#
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
CREATE USER mysqltest_dfn@localhost;
|
||||||
|
CREATE USER mysqltest_inv@localhost;
|
||||||
|
|
||||||
|
GRANT SUPER ON *.* TO mysqltest_dfn@localhost;
|
||||||
|
GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Create a table and the first trigger.
|
||||||
|
#
|
||||||
|
|
||||||
|
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
|
||||||
|
--connection wl2818_definer_con
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: wl2818_definer_con
|
||||||
|
|
||||||
|
CREATE TABLE t1(num_value INT);
|
||||||
|
CREATE TABLE t2(user_str TEXT);
|
||||||
|
|
||||||
|
CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
INSERT INTO t2 VALUES(CURRENT_USER());
|
||||||
|
|
||||||
|
#
|
||||||
|
# Remove definers from TRG file.
|
||||||
|
#
|
||||||
|
|
||||||
|
--echo
|
||||||
|
--echo ---> patching t1.TRG...
|
||||||
|
|
||||||
|
--exec grep --text -v 'definers=' $MYSQL_TEST_DIR/var/master-data/mysqltest_db1/t1.TRG > $MYSQL_TEST_DIR/var/tmp/t1.TRG
|
||||||
|
--exec mv $MYSQL_TEST_DIR/var/tmp/t1.TRG $MYSQL_TEST_DIR/var/master-data/mysqltest_db1/t1.TRG
|
||||||
|
|
||||||
|
#
|
||||||
|
# Create a new trigger.
|
||||||
|
#
|
||||||
|
|
||||||
|
--echo
|
||||||
|
|
||||||
|
CREATE TRIGGER wl2818_trg2 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
INSERT INTO t2 VALUES(CURRENT_USER());
|
||||||
|
|
||||||
|
--echo
|
||||||
|
|
||||||
|
SELECT trigger_name, definer FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
|
||||||
|
|
||||||
|
--echo
|
||||||
|
|
||||||
|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
|
475
mysql-test/t/trigger-grant.test
Normal file
475
mysql-test/t/trigger-grant.test
Normal file
@ -0,0 +1,475 @@
|
|||||||
|
# Test case(s) in this file contain(s) GRANT/REVOKE statements, which are not
|
||||||
|
# supported in embedded server. So, this test should not be run on embedded
|
||||||
|
# server.
|
||||||
|
|
||||||
|
-- source include/not_embedded.inc
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
#
|
||||||
|
# Tests for WL#2818:
|
||||||
|
# - Check that triggers are executed under the authorization of the definer.
|
||||||
|
# - Check that if trigger contains NEW/OLD variables, the definer must have
|
||||||
|
# SELECT privilege on the subject table.
|
||||||
|
# - Check DEFINER clause of CREATE TRIGGER statement;
|
||||||
|
# - Check that SUPER privilege required to create a trigger with different
|
||||||
|
# definer.
|
||||||
|
# - Check that if the user specified as DEFINER does not exist, a warning
|
||||||
|
# is emitted.
|
||||||
|
# - Check that the definer of a trigger does not exist, the trigger will
|
||||||
|
# not be activated.
|
||||||
|
# - Check that SHOW TRIGGERS statement provides "Definer" column.
|
||||||
|
#
|
||||||
|
# Let's also check that user name part of definer can contain '@' symbol (to
|
||||||
|
# check that triggers are not affected by BUG#13310 "incorrect user parsing
|
||||||
|
# by SP").
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# Prepare environment.
|
||||||
|
#
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
CREATE USER mysqltest_dfn@localhost;
|
||||||
|
CREATE USER mysqltest_inv@localhost;
|
||||||
|
|
||||||
|
GRANT SUPER ON *.* TO mysqltest_dfn@localhost;
|
||||||
|
GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check that triggers are executed under the authorization of the definer:
|
||||||
|
# - create two tables under "definer";
|
||||||
|
# - grant all privileges on the test db to "definer";
|
||||||
|
# - grant all privileges on the first table to "invoker";
|
||||||
|
# - grant only select privilege on the second table to "invoker";
|
||||||
|
# - create a trigger, which inserts a row into the second table after
|
||||||
|
# inserting into the first table.
|
||||||
|
# - insert a row into the first table under "invoker". A row also should be
|
||||||
|
# inserted into the second table.
|
||||||
|
#
|
||||||
|
|
||||||
|
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
|
||||||
|
--connection wl2818_definer_con
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: wl2818_definer_con
|
||||||
|
|
||||||
|
CREATE TABLE t1(num_value INT);
|
||||||
|
CREATE TABLE t2(user_str TEXT);
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
INSERT INTO t2 VALUES(CURRENT_USER());
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: default
|
||||||
|
|
||||||
|
# Setup definer's privileges.
|
||||||
|
|
||||||
|
GRANT ALL PRIVILEGES ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
|
||||||
|
GRANT ALL PRIVILEGES ON mysqltest_db1.t2 TO mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
# Setup invoker's privileges.
|
||||||
|
|
||||||
|
GRANT ALL PRIVILEGES ON mysqltest_db1.t1
|
||||||
|
TO 'mysqltest_inv'@localhost;
|
||||||
|
|
||||||
|
GRANT SELECT ON mysqltest_db1.t2
|
||||||
|
TO 'mysqltest_inv'@localhost;
|
||||||
|
|
||||||
|
--connection wl2818_definer_con
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: wl2818_definer_con
|
||||||
|
|
||||||
|
use mysqltest_db1;
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES(1);
|
||||||
|
|
||||||
|
SELECT * FROM t1;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
|
||||||
|
--connect (wl2818_invoker_con,localhost,mysqltest_inv,,mysqltest_db1)
|
||||||
|
--connection wl2818_invoker_con
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: wl2818_invoker_con
|
||||||
|
|
||||||
|
use mysqltest_db1;
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES(2);
|
||||||
|
|
||||||
|
SELECT * FROM t1;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check that if definer lost some privilege required to execute (activate) a
|
||||||
|
# trigger, the trigger will not be activated:
|
||||||
|
# - create a trigger on insert into the first table, which will insert a row
|
||||||
|
# into the second table;
|
||||||
|
# - revoke INSERT privilege on the second table from the definer;
|
||||||
|
# - insert a row into the first table;
|
||||||
|
# - check that an error has been risen;
|
||||||
|
# - check that no row has been inserted into the second table;
|
||||||
|
#
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: default
|
||||||
|
|
||||||
|
use mysqltest_db1;
|
||||||
|
|
||||||
|
REVOKE INSERT ON mysqltest_db1.t2 FROM mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
--connection wl2818_invoker_con
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: wl2818_invoker_con
|
||||||
|
|
||||||
|
use mysqltest_db1;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
INSERT INTO t1 VALUES(3);
|
||||||
|
|
||||||
|
SELECT * FROM t1;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check that if trigger contains NEW/OLD variables, the definer must have
|
||||||
|
# SELECT/UPDATE privilege on the subject table:
|
||||||
|
# - drop the trigger;
|
||||||
|
# - create a new trigger, which will use NEW variable;
|
||||||
|
# - create another new trigger, which will use OLD variable;
|
||||||
|
# - revoke SELECT/UPDATE privilege on the first table from "definer";
|
||||||
|
# - insert a row into the first table;
|
||||||
|
# - analyze error code;
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# SELECT privilege.
|
||||||
|
#
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: default
|
||||||
|
|
||||||
|
use mysqltest_db1;
|
||||||
|
|
||||||
|
REVOKE SELECT ON mysqltest_db1.t1 FROM mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
--connection wl2818_definer_con
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: wl2818_definer_con
|
||||||
|
|
||||||
|
use mysqltest_db1;
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
SET @new_sum = 0;
|
||||||
|
SET @old_sum = 0;
|
||||||
|
|
||||||
|
# INSERT INTO statement; BEFORE timing
|
||||||
|
|
||||||
|
--echo ---> INSERT INTO statement; BEFORE timing
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 BEFORE INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
INSERT INTO t1 VALUES(4);
|
||||||
|
|
||||||
|
# INSERT INTO statement; AFTER timing
|
||||||
|
|
||||||
|
--echo ---> INSERT INTO statement; AFTER timing
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
INSERT INTO t1 VALUES(5);
|
||||||
|
|
||||||
|
# UPDATE statement; BEFORE timing
|
||||||
|
|
||||||
|
--echo ---> UPDATE statement; BEFORE timing
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 BEFORE UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
UPDATE t1 SET num_value = 10;
|
||||||
|
|
||||||
|
# UPDATE statement; AFTER timing
|
||||||
|
|
||||||
|
--echo ---> UPDATE statement; AFTER timing
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 AFTER UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
UPDATE t1 SET num_value = 20;
|
||||||
|
|
||||||
|
# DELETE statement; BEFORE timing
|
||||||
|
|
||||||
|
--echo ---> DELETE statement; BEFORE timing
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 BEFORE DELETE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
DELETE FROM t1;
|
||||||
|
|
||||||
|
# DELETE statement; AFTER timing
|
||||||
|
|
||||||
|
--echo ---> DELETE statement; AFTER timing
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 AFTER DELETE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
DELETE FROM t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# UPDATE privilege
|
||||||
|
#
|
||||||
|
# NOTE: At the moment, UPDATE privilege is required if the trigger contains
|
||||||
|
# NEW/OLD variables, whenever the trigger modifies them or not. Moreover,
|
||||||
|
# UPDATE privilege is checked for whole table, not for individual columns.
|
||||||
|
#
|
||||||
|
# The following test cases should be changed when full support of UPDATE
|
||||||
|
# privilege will be done.
|
||||||
|
#
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: default
|
||||||
|
|
||||||
|
use mysqltest_db1;
|
||||||
|
|
||||||
|
GRANT SELECT ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
|
||||||
|
REVOKE UPDATE ON mysqltest_db1.t1 FROM mysqltest_dfn@localhost;
|
||||||
|
|
||||||
|
--connection wl2818_definer_con
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: wl2818_definer_con
|
||||||
|
|
||||||
|
use mysqltest_db1;
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
SET @new_sum = 0;
|
||||||
|
SET @old_sum = 0;
|
||||||
|
|
||||||
|
# INSERT INTO statement; BEFORE timing
|
||||||
|
|
||||||
|
--echo ---> INSERT INTO statement; BEFORE timing
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 BEFORE INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
INSERT INTO t1 VALUES(4);
|
||||||
|
|
||||||
|
# INSERT INTO statement; AFTER timing
|
||||||
|
|
||||||
|
--echo ---> INSERT INTO statement; AFTER timing
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
INSERT INTO t1 VALUES(5);
|
||||||
|
|
||||||
|
# UPDATE statement; BEFORE timing
|
||||||
|
|
||||||
|
--echo ---> UPDATE statement; BEFORE timing
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 BEFORE UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
UPDATE t1 SET num_value = 10;
|
||||||
|
|
||||||
|
# UPDATE statement; AFTER timing
|
||||||
|
|
||||||
|
--echo ---> UPDATE statement; AFTER timing
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 AFTER UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = @new_sum + NEW.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
UPDATE t1 SET num_value = 20;
|
||||||
|
|
||||||
|
# DELETE statement; BEFORE timing
|
||||||
|
|
||||||
|
--echo ---> DELETE statement; BEFORE timing
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 BEFORE DELETE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
DELETE FROM t1;
|
||||||
|
|
||||||
|
# DELETE statement; AFTER timing
|
||||||
|
|
||||||
|
--echo ---> DELETE statement; AFTER timing
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 AFTER DELETE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @old_sum = @old_sum + OLD.num_value;
|
||||||
|
|
||||||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||||||
|
DELETE FROM t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check DEFINER clause of CREATE TRIGGER statement.
|
||||||
|
#
|
||||||
|
# NOTE: there is no dedicated TRIGGER privilege for CREATE TRIGGER statement.
|
||||||
|
# SUPER privilege is used instead. I.e., if one invokes CREATE TRIGGER, it should
|
||||||
|
# have SUPER privilege, so this test is meaningless right now.
|
||||||
|
#
|
||||||
|
# - Check that SUPER privilege required to create a trigger with different
|
||||||
|
# definer:
|
||||||
|
# - try to create a trigger with DEFINER="definer@localhost" under
|
||||||
|
# "invoker";
|
||||||
|
# - analyze error code;
|
||||||
|
# - Check that if the user specified as DEFINER does not exist, a warning is
|
||||||
|
# emitted:
|
||||||
|
# - create a trigger with DEFINER="non_existent_user@localhost" from
|
||||||
|
# "definer";
|
||||||
|
# - check that a warning emitted;
|
||||||
|
# - Check that the definer of a trigger does not exist, the trigger will not
|
||||||
|
# be activated:
|
||||||
|
# - activate just created trigger;
|
||||||
|
# - check error code;
|
||||||
|
#
|
||||||
|
|
||||||
|
--connection wl2818_definer_con
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: wl2818_definer_con
|
||||||
|
|
||||||
|
use mysqltest_db1;
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
|
||||||
|
# Check that SUPER is required to specify different DEFINER.
|
||||||
|
# NOTE: meaningless at the moment
|
||||||
|
|
||||||
|
CREATE DEFINER='mysqltest_inv'@'localhost'
|
||||||
|
TRIGGER trg1 BEFORE INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = 0;
|
||||||
|
|
||||||
|
# Create with non-existent user.
|
||||||
|
|
||||||
|
CREATE DEFINER='mysqltest_nonexs'@'localhost'
|
||||||
|
TRIGGER trg2 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @new_sum = 0;
|
||||||
|
|
||||||
|
# Check that trg2 will not be activated.
|
||||||
|
|
||||||
|
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||||
|
INSERT INTO t1 VALUES(6);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check that SHOW TRIGGERS statement provides "Definer" column.
|
||||||
|
#
|
||||||
|
|
||||||
|
SHOW TRIGGERS;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check that weird definer values do not break functionality. I.e. check the
|
||||||
|
# following definer values:
|
||||||
|
# - '';
|
||||||
|
# - '@';
|
||||||
|
# - '@abc@def@@';
|
||||||
|
# - '@hostname';
|
||||||
|
# - '@abc@def@@@hostname';
|
||||||
|
#
|
||||||
|
|
||||||
|
DROP TRIGGER trg1;
|
||||||
|
DROP TRIGGER trg2;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg1 BEFORE INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @a = 1;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg2 AFTER INSERT ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @a = 2;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg3 BEFORE UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @a = 3;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg4 AFTER UPDATE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @a = 4;
|
||||||
|
|
||||||
|
CREATE TRIGGER trg5 BEFORE DELETE ON t1
|
||||||
|
FOR EACH ROW
|
||||||
|
SET @a = 5;
|
||||||
|
|
||||||
|
--exec egrep --text -v '^definers=' $MYSQL_TEST_DIR/var/master-data/mysqltest_db1/t1.TRG > $MYSQL_TEST_DIR/var/tmp/t1.TRG
|
||||||
|
--exec echo "definers='' '@' '@abc@def@@' '@hostname' '@abcdef@@@hostname'" >> $MYSQL_TEST_DIR/var/tmp/t1.TRG
|
||||||
|
--exec mv $MYSQL_TEST_DIR/var/tmp/t1.TRG $MYSQL_TEST_DIR/var/master-data/mysqltest_db1/t1.TRG
|
||||||
|
|
||||||
|
--echo
|
||||||
|
|
||||||
|
SELECT trigger_name, definer FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
|
||||||
|
|
||||||
|
--echo
|
||||||
|
|
||||||
|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Cleanup
|
||||||
|
#
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
--echo
|
||||||
|
--echo ---> connection: default
|
||||||
|
|
||||||
|
DROP USER mysqltest_dfn@localhost;
|
||||||
|
DROP USER mysqltest_inv@localhost;
|
||||||
|
|
||||||
|
DROP DATABASE mysqltest_db1;
|
@ -875,3 +875,42 @@ drop function f1;
|
|||||||
drop view v1;
|
drop view v1;
|
||||||
drop table t1, t2, t3;
|
drop table t1, t2, t3;
|
||||||
--enable_parsing
|
--enable_parsing
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test for bug #13399 "Crash when executing PS/SP which should activate
|
||||||
|
# trigger which is now dropped". See also test for similar bug for stored
|
||||||
|
# routines in sp-error.test (#12329).
|
||||||
|
create table t1 (id int);
|
||||||
|
create table t2 (id int);
|
||||||
|
create trigger t1_bi before insert on t1 for each row insert into t2 values (new.id);
|
||||||
|
prepare stmt1 from "insert into t1 values (10)";
|
||||||
|
create procedure p1() insert into t1 values (10);
|
||||||
|
call p1();
|
||||||
|
# Actually it is enough to do FLUSH TABLES instead of DROP TRIGGER
|
||||||
|
drop trigger t1_bi;
|
||||||
|
# Server should not crash on these two statements
|
||||||
|
execute stmt1;
|
||||||
|
call p1();
|
||||||
|
deallocate prepare stmt1;
|
||||||
|
drop procedure p1;
|
||||||
|
|
||||||
|
# Let us test more complex situation when we alter trigger in such way that
|
||||||
|
# it uses different set of tables (or simply add new trigger).
|
||||||
|
create table t3 (id int);
|
||||||
|
create trigger t1_bi after insert on t1 for each row insert into t2 values (new.id);
|
||||||
|
prepare stmt1 from "insert into t1 values (10)";
|
||||||
|
create procedure p1() insert into t1 values (10);
|
||||||
|
call p1();
|
||||||
|
# Altering trigger forcing it use different set of tables
|
||||||
|
drop trigger t1_bi;
|
||||||
|
create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id);
|
||||||
|
# Until we implement proper mechanism for invalidation of PS/SP when table
|
||||||
|
# or SP's are changed these two statements will fail with 'Table ... was
|
||||||
|
# not locked' error (this mechanism should be based on the new TDC).
|
||||||
|
--error 1100
|
||||||
|
execute stmt1;
|
||||||
|
--error 1100
|
||||||
|
call p1();
|
||||||
|
deallocate prepare stmt1;
|
||||||
|
drop procedure p1;
|
||||||
|
drop table t1, t2, t3;
|
||||||
|
@ -1051,6 +1051,41 @@ select cast(@non_existing_user_var/2 as DECIMAL);
|
|||||||
--error 1427
|
--error 1427
|
||||||
create table t (d decimal(0,10));
|
create table t (d decimal(0,10));
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #14268 (bad FLOAT->DECIMAL conversion)
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
my_float FLOAT,
|
||||||
|
my_double DOUBLE,
|
||||||
|
my_varchar VARCHAR(50),
|
||||||
|
my_decimal DECIMAL(65,30)
|
||||||
|
);
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
|
||||||
|
let $max_power= 32;
|
||||||
|
while ($max_power)
|
||||||
|
{
|
||||||
|
eval INSERT INTO t1 SET my_float = 1.175494345e-$max_power,
|
||||||
|
my_double = 1.175494345e-$max_power,
|
||||||
|
my_varchar = '1.175494345e-$max_power';
|
||||||
|
dec $max_power;
|
||||||
|
}
|
||||||
|
SELECT my_float, my_double, my_varchar FROM t1;
|
||||||
|
|
||||||
|
SELECT CAST(my_float AS DECIMAL(65,30)), my_float FROM t1;
|
||||||
|
SELECT CAST(my_double AS DECIMAL(65,30)), my_double FROM t1;
|
||||||
|
SELECT CAST(my_varchar AS DECIMAL(65,30)), my_varchar FROM t1;
|
||||||
|
|
||||||
|
UPDATE t1 SET my_decimal = my_float;
|
||||||
|
SELECT my_decimal, my_float FROM t1;
|
||||||
|
UPDATE t1 SET my_decimal = my_double;
|
||||||
|
SELECT my_decimal, my_double FROM t1;
|
||||||
|
UPDATE t1 SET my_decimal = my_varchar;
|
||||||
|
SELECT my_decimal, my_varchar FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug #13573 (Wrong data inserted for too big values)
|
# Bug #13573 (Wrong data inserted for too big values)
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
--disable_warnings
|
--disable_warnings
|
||||||
drop table if exists t1,t2,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
drop table if exists t1,t2,t3,t4,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
||||||
drop view if exists t1,t2,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
drop view if exists t1,t2,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
||||||
drop database if exists mysqltest;
|
drop database if exists mysqltest;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
@ -147,11 +147,9 @@ insert into t1 values (1), (2), (3);
|
|||||||
create view v1 (a) as select a+1 from t1;
|
create view v1 (a) as select a+1 from t1;
|
||||||
create view v2 (a) as select a-1 from t1;
|
create view v2 (a) as select a-1 from t1;
|
||||||
|
|
||||||
--disable_parsing # WL #2486 should enable these tests
|
|
||||||
select * from t1 natural left join v1;
|
select * from t1 natural left join v1;
|
||||||
select * from v2 natural left join t1;
|
select * from v2 natural left join t1;
|
||||||
select * from v2 natural left join v1;
|
select * from v2 natural left join v1;
|
||||||
--enable_parsing
|
|
||||||
|
|
||||||
drop view v1, v2;
|
drop view v1, v2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
@ -2085,7 +2083,7 @@ drop table t1, t2;
|
|||||||
#
|
#
|
||||||
# DEFINER information check
|
# DEFINER information check
|
||||||
#
|
#
|
||||||
-- error ER_NO_VIEW_USER
|
-- error ER_MALFORMED_DEFINER
|
||||||
create definer=some_user@`` sql security invoker view v1 as select 1;
|
create definer=some_user@`` sql security invoker view v1 as select 1;
|
||||||
create definer=some_user@localhost sql security invoker view v1 as select 1;
|
create definer=some_user@localhost sql security invoker view v1 as select 1;
|
||||||
show create view v1;
|
show create view v1;
|
||||||
@ -2194,6 +2192,15 @@ DROP VIEW v1,v2;
|
|||||||
DROP TABLE t1,t2,t3;
|
DROP TABLE t1,t2,t3;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
# Bug #13622 Wrong view .frm created if some field's alias contain \n
|
||||||
|
#
|
||||||
|
create table t1 (f1 int);
|
||||||
|
create view v1 as select t1.f1 as '123
|
||||||
|
456' from t1;
|
||||||
|
select * from v1;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
# Bug #14466 lost sort order in GROUP_CONCAT() in a view
|
# Bug #14466 lost sort order in GROUP_CONCAT() in a view
|
||||||
#
|
#
|
||||||
create table t1 (f1 int, f2 int);
|
create table t1 (f1 int, f2 int);
|
||||||
@ -2204,3 +2211,76 @@ select * from v1;
|
|||||||
select * from v2;
|
select * from v2;
|
||||||
drop view v1,v2;
|
drop view v1,v2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#14026 Crash on second PS execution when using views
|
||||||
|
#
|
||||||
|
create table t1 (x int, y int);
|
||||||
|
create table t2 (x int, y int, z int);
|
||||||
|
create table t3 (x int, y int, z int);
|
||||||
|
create table t4 (x int, y int, z int);
|
||||||
|
|
||||||
|
create view v1 as
|
||||||
|
select t1.x
|
||||||
|
from (
|
||||||
|
(t1 join t2 on ((t1.y = t2.y)))
|
||||||
|
join
|
||||||
|
(t3 left join t4 on (t3.y = t4.y) and (t3.z = t4.z))
|
||||||
|
);
|
||||||
|
|
||||||
|
prepare stmt1 from "select count(*) from v1 where x = ?";
|
||||||
|
set @parm1=1;
|
||||||
|
|
||||||
|
execute stmt1 using @parm1;
|
||||||
|
execute stmt1 using @parm1;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1,t2,t3,t4;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #14540: OPTIMIZE, ANALYZE, REPAIR applied to not a view
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1(id INT);
|
||||||
|
CREATE VIEW v1 AS SELECT id FROM t1;
|
||||||
|
|
||||||
|
OPTIMIZE TABLE v1;
|
||||||
|
ANALYZE TABLE v1;
|
||||||
|
REPAIR TABLE v1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
OPTIMIZE TABLE v1;
|
||||||
|
|
||||||
|
DROP VIEW v1;
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#14719: Views DEFINER grammar is incorrect
|
||||||
|
#
|
||||||
|
|
||||||
|
create definer = current_user() sql security invoker view v1 as select 1;
|
||||||
|
show create view v1;
|
||||||
|
drop view v1;
|
||||||
|
|
||||||
|
create definer = current_user sql security invoker view v1 as select 1;
|
||||||
|
show create view v1;
|
||||||
|
drop view v1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #14816 test_if_order_by_key() expected only Item_fields.
|
||||||
|
#
|
||||||
|
create table t1 (id INT, primary key(id));
|
||||||
|
insert into t1 values (1),(2);
|
||||||
|
create view v1 as select * from t1;
|
||||||
|
explain select id from v1 order by id;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #14850 Item_ref's values wasn't updated
|
||||||
|
#
|
||||||
|
create table t1(f1 int, f2 int);
|
||||||
|
insert into t1 values (null, 10), (null,2);
|
||||||
|
create view v1 as select * from t1;
|
||||||
|
select f1, sum(f2) from v1 group by f1;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
@ -24,7 +24,7 @@ grant create view,select on test.* to mysqltest_1@localhost;
|
|||||||
connect (user1,localhost,mysqltest_1,,test);
|
connect (user1,localhost,mysqltest_1,,test);
|
||||||
connection user1;
|
connection user1;
|
||||||
|
|
||||||
-- error ER_VIEW_OTHER_USER
|
-- error ER_SPECIFIC_ACCESS_DENIED
|
||||||
create definer=root@localhost view v1 as select * from mysqltest.t1;
|
create definer=root@localhost view v1 as select * from mysqltest.t1;
|
||||||
create view v1 as select * from mysqltest.t1;
|
create view v1 as select * from mysqltest.t1;
|
||||||
# try to modify view without DROP privilege on it
|
# try to modify view without DROP privilege on it
|
||||||
|
@ -47,13 +47,16 @@ File my_create(const char *FileName, int CreateFlags, int access_flags,
|
|||||||
#elif defined(VMS)
|
#elif defined(VMS)
|
||||||
fd = open((my_string) FileName, access_flags | O_CREAT, 0,
|
fd = open((my_string) FileName, access_flags | O_CREAT, 0,
|
||||||
"ctx=stm","ctx=bin");
|
"ctx=stm","ctx=bin");
|
||||||
#elif defined(MSDOS) || defined(__WIN__) || defined(__EMX__) || defined(OS2)
|
#elif defined(MSDOS) || defined(__EMX__) || defined(OS2)
|
||||||
if (access_flags & O_SHARE)
|
if (access_flags & O_SHARE)
|
||||||
fd = sopen((my_string) FileName, access_flags | O_CREAT | O_BINARY,
|
fd = sopen((my_string) FileName, access_flags | O_CREAT | O_BINARY,
|
||||||
SH_DENYNO, MY_S_IREAD | MY_S_IWRITE);
|
SH_DENYNO, MY_S_IREAD | MY_S_IWRITE);
|
||||||
else
|
else
|
||||||
fd = open((my_string) FileName, access_flags | O_CREAT | O_BINARY,
|
fd = open((my_string) FileName, access_flags | O_CREAT | O_BINARY,
|
||||||
MY_S_IREAD | MY_S_IWRITE);
|
MY_S_IREAD | MY_S_IWRITE);
|
||||||
|
#elif defined(__WIN__)
|
||||||
|
fd= my_sopen((my_string) FileName, access_flags | O_CREAT | O_BINARY,
|
||||||
|
SH_DENYNO, MY_S_IREAD | MY_S_IWRITE);
|
||||||
#else
|
#else
|
||||||
fd = open(FileName, access_flags);
|
fd = open(FileName, access_flags);
|
||||||
#endif
|
#endif
|
||||||
|
184
mysys/my_open.c
184
mysys/my_open.c
@ -56,12 +56,18 @@ File my_open(const char *FileName, int Flags, myf MyFlags)
|
|||||||
DBUG_RETURN(my_register_filename(-1, FileName, FILE_BY_OPEN,
|
DBUG_RETURN(my_register_filename(-1, FileName, FILE_BY_OPEN,
|
||||||
EE_FILENOTFOUND, MyFlags));
|
EE_FILENOTFOUND, MyFlags));
|
||||||
}
|
}
|
||||||
|
#ifndef __WIN__
|
||||||
if (Flags & O_SHARE)
|
if (Flags & O_SHARE)
|
||||||
fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
|
fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
|
||||||
MY_S_IREAD | MY_S_IWRITE);
|
MY_S_IREAD | MY_S_IWRITE);
|
||||||
else
|
else
|
||||||
fd = open((my_string) FileName, Flags | O_BINARY,
|
fd = open((my_string) FileName, Flags | O_BINARY,
|
||||||
MY_S_IREAD | MY_S_IWRITE);
|
MY_S_IREAD | MY_S_IWRITE);
|
||||||
|
#else
|
||||||
|
fd= my_sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
|
||||||
|
MY_S_IREAD | MY_S_IWRITE);
|
||||||
|
#endif
|
||||||
|
|
||||||
#elif !defined(NO_OPEN_3)
|
#elif !defined(NO_OPEN_3)
|
||||||
fd = open(FileName, Flags, my_umask); /* Normal unix */
|
fd = open(FileName, Flags, my_umask); /* Normal unix */
|
||||||
#else
|
#else
|
||||||
@ -167,3 +173,181 @@ File my_register_filename(File fd, const char *FileName, enum file_type
|
|||||||
FileName, my_errno);
|
FileName, my_errno);
|
||||||
return(fd);
|
return(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WIN__
|
||||||
|
|
||||||
|
extern void __cdecl _dosmaperr(unsigned long);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Open a file with sharing. Similar to _sopen() from libc, but allows managing
|
||||||
|
share delete on win32
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
my_sopen()
|
||||||
|
path fully qualified file name
|
||||||
|
oflag operation flags
|
||||||
|
shflag share flag
|
||||||
|
pmode permission flags
|
||||||
|
|
||||||
|
RETURN VALUE
|
||||||
|
File descriptor of opened file if success
|
||||||
|
-1 and sets errno if fails.
|
||||||
|
*/
|
||||||
|
|
||||||
|
File my_sopen(const char *path, int oflag, int shflag, int pmode)
|
||||||
|
{
|
||||||
|
int fh; /* handle of opened file */
|
||||||
|
int mask;
|
||||||
|
HANDLE osfh; /* OS handle of opened file */
|
||||||
|
DWORD fileaccess; /* OS file access (requested) */
|
||||||
|
DWORD fileshare; /* OS file sharing mode */
|
||||||
|
DWORD filecreate; /* OS method of opening/creating */
|
||||||
|
DWORD fileattrib; /* OS file attribute flags */
|
||||||
|
SECURITY_ATTRIBUTES SecurityAttributes;
|
||||||
|
|
||||||
|
SecurityAttributes.nLength= sizeof(SecurityAttributes);
|
||||||
|
SecurityAttributes.lpSecurityDescriptor= NULL;
|
||||||
|
SecurityAttributes.bInheritHandle= !(oflag & _O_NOINHERIT);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* decode the access flags
|
||||||
|
*/
|
||||||
|
switch (oflag & (_O_RDONLY | _O_WRONLY | _O_RDWR)) {
|
||||||
|
case _O_RDONLY: /* read access */
|
||||||
|
fileaccess= GENERIC_READ;
|
||||||
|
break;
|
||||||
|
case _O_WRONLY: /* write access */
|
||||||
|
fileaccess= GENERIC_WRITE;
|
||||||
|
break;
|
||||||
|
case _O_RDWR: /* read and write access */
|
||||||
|
fileaccess= GENERIC_READ | GENERIC_WRITE;
|
||||||
|
break;
|
||||||
|
default: /* error, bad oflag */
|
||||||
|
errno= EINVAL;
|
||||||
|
_doserrno= 0L; /* not an OS error */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* decode sharing flags
|
||||||
|
*/
|
||||||
|
switch (shflag) {
|
||||||
|
case _SH_DENYRW: /* exclusive access except delete */
|
||||||
|
fileshare= FILE_SHARE_DELETE;
|
||||||
|
break;
|
||||||
|
case _SH_DENYWR: /* share read and delete access */
|
||||||
|
fileshare= FILE_SHARE_READ | FILE_SHARE_DELETE;
|
||||||
|
break;
|
||||||
|
case _SH_DENYRD: /* share write and delete access */
|
||||||
|
fileshare= FILE_SHARE_WRITE | FILE_SHARE_DELETE;
|
||||||
|
break;
|
||||||
|
case _SH_DENYNO: /* share read, write and delete access */
|
||||||
|
fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
|
||||||
|
break;
|
||||||
|
case _SH_DENYRWD: /* exclusive access */
|
||||||
|
fileshare= 0L;
|
||||||
|
break;
|
||||||
|
case _SH_DENYWRD: /* share read access */
|
||||||
|
fileshare= FILE_SHARE_READ;
|
||||||
|
break;
|
||||||
|
case _SH_DENYRDD: /* share write access */
|
||||||
|
fileshare= FILE_SHARE_WRITE;
|
||||||
|
break;
|
||||||
|
case _SH_DENYDEL: /* share read and write access */
|
||||||
|
fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE;
|
||||||
|
break;
|
||||||
|
default: /* error, bad shflag */
|
||||||
|
errno= EINVAL;
|
||||||
|
_doserrno= 0L; /* not an OS error */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* decode open/create method flags
|
||||||
|
*/
|
||||||
|
switch (oflag & (_O_CREAT | _O_EXCL | _O_TRUNC)) {
|
||||||
|
case 0:
|
||||||
|
case _O_EXCL: // ignore EXCL w/o CREAT
|
||||||
|
filecreate= OPEN_EXISTING;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case _O_CREAT:
|
||||||
|
filecreate= OPEN_ALWAYS;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case _O_CREAT | _O_EXCL:
|
||||||
|
case _O_CREAT | _O_TRUNC | _O_EXCL:
|
||||||
|
filecreate= CREATE_NEW;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case _O_TRUNC:
|
||||||
|
case _O_TRUNC | _O_EXCL: // ignore EXCL w/o CREAT
|
||||||
|
filecreate= TRUNCATE_EXISTING;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case _O_CREAT | _O_TRUNC:
|
||||||
|
filecreate= CREATE_ALWAYS;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// this can't happen ... all cases are covered
|
||||||
|
errno= EINVAL;
|
||||||
|
_doserrno= 0L;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* decode file attribute flags if _O_CREAT was specified
|
||||||
|
*/
|
||||||
|
fileattrib= FILE_ATTRIBUTE_NORMAL; /* default */
|
||||||
|
if (oflag & _O_CREAT)
|
||||||
|
{
|
||||||
|
_umask((mask= _umask(0)));
|
||||||
|
|
||||||
|
if (!((pmode & ~mask) & _S_IWRITE))
|
||||||
|
fileattrib= FILE_ATTRIBUTE_READONLY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set temporary file (delete-on-close) attribute if requested.
|
||||||
|
*/
|
||||||
|
if (oflag & _O_TEMPORARY)
|
||||||
|
{
|
||||||
|
fileattrib|= FILE_FLAG_DELETE_ON_CLOSE;
|
||||||
|
fileaccess|= DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set temporary file (delay-flush-to-disk) attribute if requested.
|
||||||
|
*/
|
||||||
|
if (oflag & _O_SHORT_LIVED)
|
||||||
|
fileattrib|= FILE_ATTRIBUTE_TEMPORARY;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set sequential or random access attribute if requested.
|
||||||
|
*/
|
||||||
|
if (oflag & _O_SEQUENTIAL)
|
||||||
|
fileattrib|= FILE_FLAG_SEQUENTIAL_SCAN;
|
||||||
|
else if (oflag & _O_RANDOM)
|
||||||
|
fileattrib|= FILE_FLAG_RANDOM_ACCESS;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* try to open/create the file
|
||||||
|
*/
|
||||||
|
if ((osfh= CreateFile(path, fileaccess, fileshare, &SecurityAttributes,
|
||||||
|
filecreate, fileattrib, NULL)) == (HANDLE)0xffffffff)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* OS call to open/create file failed! map the error, release
|
||||||
|
* the lock, and return -1. note that it's not necessary to
|
||||||
|
* call _free_osfhnd (it hasn't been used yet).
|
||||||
|
*/
|
||||||
|
_dosmaperr(GetLastError()); /* map error */
|
||||||
|
return -1; /* return error to caller */
|
||||||
|
}
|
||||||
|
|
||||||
|
fh= _open_osfhandle((long)osfh, oflag & (_O_APPEND | _O_RDONLY | _O_TEXT));
|
||||||
|
|
||||||
|
return fh; /* return handle */
|
||||||
|
}
|
||||||
|
#endif /* __WIN__ */
|
||||||
|
@ -35,7 +35,7 @@ ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,a
|
|||||||
ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
|
ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
|
||||||
ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
|
ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
|
||||||
|
|
||||||
--- Fix privileges for old tables
|
-- Fix privileges for old tables
|
||||||
UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
|
UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
|
||||||
UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
|
UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
|
||||||
UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
|
UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
|
||||||
|
@ -76,6 +76,9 @@ int set_stacksize_n_create_thread(pthread_t *thread, pthread_attr_t *attr,
|
|||||||
int rc= 0;
|
int rc= 0;
|
||||||
|
|
||||||
#ifndef __WIN__
|
#ifndef __WIN__
|
||||||
|
#ifndef PTHREAD_STACK_MIN
|
||||||
|
#define PTHREAD_STACK_MIN 32768
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
Set stack size to be safe on the platforms with too small
|
Set stack size to be safe on the platforms with too small
|
||||||
default thread stack.
|
default thread stack.
|
||||||
|
33
sql/authors.h
Normal file
33
sql/authors.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
** Output from "SHOW AUTHORS"
|
||||||
|
** If you can update it, you get to be in it :)
|
||||||
|
** Dont be offended if your name is not in here, just add it!
|
||||||
|
** IMPORTANT: Names should be added in alphabetical order
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
struct show_table_authors_st {
|
||||||
|
const char *name;
|
||||||
|
const char *location;
|
||||||
|
const char *comment;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct show_table_authors_st show_table_authors[]= {
|
||||||
|
{ "Brian \"Krow\" Aker", "Seattle, WA. USA",
|
||||||
|
"Architecture, archive, federated, buncha of little stuff :)" },
|
||||||
|
{ "David Axmark", "Uppsala, Sweden", "Small stuff long time ago, Monty ripped it out!"},
|
||||||
|
{ "Omer BarNir", "Sunnyvale, CA. USA", "Testing (sometimes) and general QA stuff"},
|
||||||
|
{ "Nikolay Grishakin", "Austin, TX. USA", "Testing - Server"},
|
||||||
|
{ "Serge Kozlov", "Velikie Luki, Russia", "Testing - Cluster"},
|
||||||
|
{ "Matthias Leich", "Berlin, Germany", "Testing - Server"},
|
||||||
|
{ "Jonathan (Jeb) Miller", "Kyle, TX. USA", "Testing - Cluster, Replication"},
|
||||||
|
{ "Carsten Segieth (Pino)", "Fredersdorf, Germany", "Testing - Server"},
|
||||||
|
{ "Punita Srivastava", "Austin, TX. USA", "Testing - Merlin"},
|
||||||
|
{ "Alexey Stroganov (Ranger)", "Lugansk, Ukraine", "Testing - Benchmarks"},
|
||||||
|
{ "Oleksandr Byelkin", "Lugansk, Ukraine", "Query Cache (4.0), Subqueries (4.1), Views (5.0)"},
|
||||||
|
{ "Dmitri Lenev", "Moscow, Russia", "Time zones support (4.1), Triggers (5.0)"},
|
||||||
|
{ "Konstantin Osipov", "Moscow, Russia", "Prepared statements (4.1), Cursors (5.0)"},
|
||||||
|
{ "Petr Chardin", "Moscow, Russia", "Instance Manager (5.0)" },
|
||||||
|
{ "Sergey Vojtovich", "Izhevsk, Russia", "Plugins infrastructure (5.1)" },
|
||||||
|
{ "Alexander Nozdrin", "Moscow, Russia", "Bugfixing (Stored Procedures, 5.0)" },
|
||||||
|
{NULL, NULL, NULL}
|
||||||
|
};
|
@ -95,11 +95,15 @@ handlerton tina_hton= {
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Used for sorting chains.
|
Used for sorting chains with qsort().
|
||||||
*/
|
*/
|
||||||
int sort_set (tina_set *a, tina_set *b)
|
int sort_set (tina_set *a, tina_set *b)
|
||||||
{
|
{
|
||||||
return ( a->begin > b->begin ? 1 : ( a->begin < b->begin ? -1 : 0 ) );
|
/*
|
||||||
|
We assume that intervals do not intersect. So, it is enought to compare
|
||||||
|
any two points. Here we take start of intervals for comparison.
|
||||||
|
*/
|
||||||
|
return ( a->begin > b->begin ? -1 : ( a->begin < b->begin ? 1 : 0 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static byte* tina_get_key(TINA_SHARE *share,uint *length,
|
static byte* tina_get_key(TINA_SHARE *share,uint *length,
|
||||||
@ -200,7 +204,8 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
|
|||||||
thr_lock_init(&share->lock);
|
thr_lock_init(&share->lock);
|
||||||
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
|
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
|
||||||
|
|
||||||
if ((share->data_file= my_open(data_file_name, O_RDWR, MYF(0))) == -1)
|
if ((share->data_file= my_open(data_file_name, O_RDWR|O_APPEND,
|
||||||
|
MYF(0))) == -1)
|
||||||
goto error2;
|
goto error2;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -836,14 +841,8 @@ int ha_tina::rnd_end()
|
|||||||
(qsort_cmp)sort_set);
|
(qsort_cmp)sort_set);
|
||||||
for (ptr= chain; ptr < chain_ptr; ptr++)
|
for (ptr= chain; ptr < chain_ptr; ptr++)
|
||||||
{
|
{
|
||||||
/* We peek a head to see if this is the last chain */
|
memmove(share->mapped_file + ptr->begin, share->mapped_file + ptr->end,
|
||||||
if (ptr+1 == chain_ptr)
|
length - (size_t)ptr->end);
|
||||||
memmove(share->mapped_file + ptr->begin, share->mapped_file + ptr->end,
|
|
||||||
length - (size_t)ptr->end);
|
|
||||||
else
|
|
||||||
memmove((caddr_t)share->mapped_file + ptr->begin,
|
|
||||||
(caddr_t)share->mapped_file + ptr->end,
|
|
||||||
(size_t)((ptr++)->begin - ptr->end));
|
|
||||||
length= length - (size_t)(ptr->end - ptr->begin);
|
length= length - (size_t)(ptr->end - ptr->begin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
sql/field.cc
17
sql/field.cc
@ -6224,9 +6224,16 @@ Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table)
|
|||||||
This is done to ensure that ALTER TABLE will convert old VARCHAR fields
|
This is done to ensure that ALTER TABLE will convert old VARCHAR fields
|
||||||
to now VARCHAR fields.
|
to now VARCHAR fields.
|
||||||
*/
|
*/
|
||||||
return new Field_varstring(field_length, maybe_null(),
|
Field *new_field= new Field_varstring(field_length, maybe_null(),
|
||||||
field_name, new_table,
|
field_name, new_table,
|
||||||
charset());
|
charset());
|
||||||
|
/*
|
||||||
|
delayed_insert::get_local_table() needs a ptr copied from old table.
|
||||||
|
This is what other new_field() methods do too. The above method of
|
||||||
|
Field_varstring sets ptr to NULL.
|
||||||
|
*/
|
||||||
|
new_field->ptr= ptr;
|
||||||
|
return new_field;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -7986,7 +7993,7 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs)
|
|||||||
{
|
{
|
||||||
int delta;
|
int delta;
|
||||||
|
|
||||||
for (; !*from && length; from++, length--); // skip left 0's
|
for (; length && !*from; from++, length--); // skip left 0's
|
||||||
delta= field_length - length;
|
delta= field_length - length;
|
||||||
|
|
||||||
if (delta < -1 ||
|
if (delta < -1 ||
|
||||||
@ -8235,7 +8242,7 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs)
|
|||||||
int delta;
|
int delta;
|
||||||
uchar bits= create_length & 7;
|
uchar bits= create_length & 7;
|
||||||
|
|
||||||
for (; !*from && length; from++, length--); // skip left 0's
|
for (; length && !*from; from++, length--); // skip left 0's
|
||||||
delta= field_length - length;
|
delta= field_length - length;
|
||||||
|
|
||||||
if (delta < 0 ||
|
if (delta < 0 ||
|
||||||
|
@ -1081,7 +1081,7 @@ public:
|
|||||||
int cmp_max(const char *, const char *, uint max_length);
|
int cmp_max(const char *, const char *, uint max_length);
|
||||||
int cmp(const char *a,const char*b)
|
int cmp(const char *a,const char*b)
|
||||||
{
|
{
|
||||||
return cmp_max(a, b, ~0);
|
return cmp_max(a, b, ~0L);
|
||||||
}
|
}
|
||||||
void sort_string(char *buff,uint length);
|
void sort_string(char *buff,uint length);
|
||||||
void get_key_image(char *buff,uint length, imagetype type);
|
void get_key_image(char *buff,uint length, imagetype type);
|
||||||
@ -1141,7 +1141,7 @@ public:
|
|||||||
my_decimal *val_decimal(my_decimal *);
|
my_decimal *val_decimal(my_decimal *);
|
||||||
int cmp_max(const char *, const char *, uint max_length);
|
int cmp_max(const char *, const char *, uint max_length);
|
||||||
int cmp(const char *a,const char*b)
|
int cmp(const char *a,const char*b)
|
||||||
{ return cmp_max(a, b, ~0); }
|
{ return cmp_max(a, b, ~0L); }
|
||||||
int cmp(const char *a, uint32 a_length, const char *b, uint32 b_length);
|
int cmp(const char *a, uint32 a_length, const char *b, uint32 b_length);
|
||||||
int cmp_binary(const char *a,const char *b, uint32 max_length=~0L);
|
int cmp_binary(const char *a,const char *b, uint32 max_length=~0L);
|
||||||
int key_cmp(const byte *,const byte*);
|
int key_cmp(const byte *,const byte*);
|
||||||
|
@ -249,7 +249,8 @@ ha_archive::ha_archive(TABLE *table_arg)
|
|||||||
buffer.set((char *)byte_buffer, IO_SIZE, system_charset_info);
|
buffer.set((char *)byte_buffer, IO_SIZE, system_charset_info);
|
||||||
|
|
||||||
/* The size of the offset value we will use for position() */
|
/* The size of the offset value we will use for position() */
|
||||||
ref_length = sizeof(z_off_t);
|
ref_length = 2 << ((zlibCompileFlags() >> 6) & 3);
|
||||||
|
DBUG_ASSERT(ref_length <= sizeof(z_off_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -78,9 +78,11 @@ const char *ha_berkeley_ext=".db";
|
|||||||
bool berkeley_shared_data=0;
|
bool berkeley_shared_data=0;
|
||||||
u_int32_t berkeley_init_flags= DB_PRIVATE | DB_RECOVER, berkeley_env_flags=0,
|
u_int32_t berkeley_init_flags= DB_PRIVATE | DB_RECOVER, berkeley_env_flags=0,
|
||||||
berkeley_lock_type=DB_LOCK_DEFAULT;
|
berkeley_lock_type=DB_LOCK_DEFAULT;
|
||||||
ulong berkeley_cache_size, berkeley_log_buffer_size, berkeley_log_file_size=0;
|
ulong berkeley_log_buffer_size=0 , berkeley_log_file_size=0;
|
||||||
|
ulonglong berkeley_cache_size= 0;
|
||||||
char *berkeley_home, *berkeley_tmpdir, *berkeley_logdir;
|
char *berkeley_home, *berkeley_tmpdir, *berkeley_logdir;
|
||||||
long berkeley_lock_scan_time=0;
|
long berkeley_lock_scan_time=0;
|
||||||
|
ulong berkeley_region_size=0, berkeley_cache_parts=1;
|
||||||
ulong berkeley_trans_retry=1;
|
ulong berkeley_trans_retry=1;
|
||||||
ulong berkeley_max_lock;
|
ulong berkeley_max_lock;
|
||||||
pthread_mutex_t bdb_mutex;
|
pthread_mutex_t bdb_mutex;
|
||||||
@ -89,9 +91,12 @@ static DB_ENV *db_env;
|
|||||||
static HASH bdb_open_tables;
|
static HASH bdb_open_tables;
|
||||||
|
|
||||||
const char *berkeley_lock_names[] =
|
const char *berkeley_lock_names[] =
|
||||||
{ "DEFAULT", "OLDEST","RANDOM","YOUNGEST",0 };
|
{ "DEFAULT", "OLDEST", "RANDOM", "YOUNGEST", "EXPIRE", "MAXLOCKS",
|
||||||
|
"MAXWRITE", "MINLOCKS", "MINWRITE", 0 };
|
||||||
u_int32_t berkeley_lock_types[]=
|
u_int32_t berkeley_lock_types[]=
|
||||||
{ DB_LOCK_DEFAULT, DB_LOCK_OLDEST, DB_LOCK_RANDOM };
|
{ DB_LOCK_DEFAULT, DB_LOCK_OLDEST, DB_LOCK_RANDOM, DB_LOCK_YOUNGEST,
|
||||||
|
DB_LOCK_EXPIRE, DB_LOCK_MAXLOCKS, DB_LOCK_MAXWRITE, DB_LOCK_MINLOCKS,
|
||||||
|
DB_LOCK_MINWRITE };
|
||||||
TYPELIB berkeley_lock_typelib= {array_elements(berkeley_lock_names)-1,"",
|
TYPELIB berkeley_lock_typelib= {array_elements(berkeley_lock_names)-1,"",
|
||||||
berkeley_lock_names, NULL};
|
berkeley_lock_names, NULL};
|
||||||
|
|
||||||
@ -204,10 +209,17 @@ bool berkeley_init(void)
|
|||||||
DB_VERB_DEADLOCK | DB_VERB_RECOVERY,
|
DB_VERB_DEADLOCK | DB_VERB_RECOVERY,
|
||||||
1);
|
1);
|
||||||
|
|
||||||
db_env->set_cachesize(db_env, 0, berkeley_cache_size, 0);
|
if (berkeley_cache_size > (uint) ~0)
|
||||||
|
db_env->set_cachesize(db_env, berkeley_cache_size / (1024*1024L*1024L),
|
||||||
|
berkeley_cache_size % (1024L*1024L*1024L),
|
||||||
|
berkeley_cache_parts);
|
||||||
|
else
|
||||||
|
db_env->set_cachesize(db_env, 0, berkeley_cache_size, berkeley_cache_parts);
|
||||||
|
|
||||||
db_env->set_lg_max(db_env, berkeley_log_file_size);
|
db_env->set_lg_max(db_env, berkeley_log_file_size);
|
||||||
db_env->set_lg_bsize(db_env, berkeley_log_buffer_size);
|
db_env->set_lg_bsize(db_env, berkeley_log_buffer_size);
|
||||||
db_env->set_lk_detect(db_env, berkeley_lock_type);
|
db_env->set_lk_detect(db_env, berkeley_lock_type);
|
||||||
|
db_env->set_lg_regionmax(db_env, berkeley_region_size);
|
||||||
if (berkeley_max_lock)
|
if (berkeley_max_lock)
|
||||||
db_env->set_lk_max(db_env, berkeley_max_lock);
|
db_env->set_lk_max(db_env, berkeley_max_lock);
|
||||||
|
|
||||||
|
@ -163,7 +163,9 @@ extern const u_int32_t bdb_DB_PRIVATE;
|
|||||||
extern bool berkeley_shared_data;
|
extern bool berkeley_shared_data;
|
||||||
extern u_int32_t berkeley_init_flags,berkeley_env_flags, berkeley_lock_type,
|
extern u_int32_t berkeley_init_flags,berkeley_env_flags, berkeley_lock_type,
|
||||||
berkeley_lock_types[];
|
berkeley_lock_types[];
|
||||||
extern ulong berkeley_cache_size, berkeley_max_lock, berkeley_log_buffer_size;
|
extern ulong berkeley_max_lock, berkeley_log_buffer_size;
|
||||||
|
extern ulonglong berkeley_cache_size;
|
||||||
|
extern ulong berkeley_region_size, berkeley_cache_parts;
|
||||||
extern char *berkeley_home, *berkeley_tmpdir, *berkeley_logdir;
|
extern char *berkeley_home, *berkeley_tmpdir, *berkeley_logdir;
|
||||||
extern long berkeley_lock_scan_time;
|
extern long berkeley_lock_scan_time;
|
||||||
extern TYPELIB berkeley_lock_typelib;
|
extern TYPELIB berkeley_lock_typelib;
|
||||||
|
@ -141,15 +141,16 @@ uint innobase_init_flags = 0;
|
|||||||
ulong innobase_cache_size = 0;
|
ulong innobase_cache_size = 0;
|
||||||
ulong innobase_large_page_size = 0;
|
ulong innobase_large_page_size = 0;
|
||||||
|
|
||||||
/* The default values for the following, type long, start-up parameters
|
/* The default values for the following, type long or longlong, start-up
|
||||||
are declared in mysqld.cc: */
|
parameters are declared in mysqld.cc: */
|
||||||
|
|
||||||
long innobase_mirrored_log_groups, innobase_log_files_in_group,
|
long innobase_mirrored_log_groups, innobase_log_files_in_group,
|
||||||
innobase_log_file_size, innobase_log_buffer_size,
|
innobase_log_buffer_size, innobase_buffer_pool_awe_mem_mb,
|
||||||
innobase_buffer_pool_awe_mem_mb,
|
innobase_additional_mem_pool_size, innobase_file_io_threads,
|
||||||
innobase_buffer_pool_size, innobase_additional_mem_pool_size,
|
innobase_lock_wait_timeout, innobase_force_recovery,
|
||||||
innobase_file_io_threads, innobase_lock_wait_timeout,
|
innobase_open_files;
|
||||||
innobase_force_recovery, innobase_open_files;
|
|
||||||
|
longlong innobase_buffer_pool_size, innobase_log_file_size;
|
||||||
|
|
||||||
/* The default values for the following char* start-up parameters
|
/* The default values for the following char* start-up parameters
|
||||||
are determined in innobase_init below: */
|
are determined in innobase_init below: */
|
||||||
@ -1231,6 +1232,25 @@ innobase_init(void)
|
|||||||
|
|
||||||
ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
|
ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
|
||||||
|
|
||||||
|
/* Check that values don't overflow on 32-bit systems. */
|
||||||
|
if (sizeof(ulint) == 4) {
|
||||||
|
if (innobase_buffer_pool_size > UINT_MAX32) {
|
||||||
|
sql_print_error(
|
||||||
|
"innobase_buffer_pool_size can't be over 4GB"
|
||||||
|
" on 32-bit systems");
|
||||||
|
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (innobase_log_file_size > UINT_MAX32) {
|
||||||
|
sql_print_error(
|
||||||
|
"innobase_log_file_size can't be over 4GB"
|
||||||
|
" on 32-bit systems");
|
||||||
|
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
os_innodb_umask = (ulint)my_umask;
|
os_innodb_umask = (ulint)my_umask;
|
||||||
|
|
||||||
/* First calculate the default path for innodb_data_home_dir etc.,
|
/* First calculate the default path for innodb_data_home_dir etc.,
|
||||||
@ -3030,8 +3050,8 @@ ha_innobase::store_key_val_for_row(
|
|||||||
|
|
||||||
if (key_part->length > 0 && cs->mbmaxlen > 1) {
|
if (key_part->length > 0 && cs->mbmaxlen > 1) {
|
||||||
len = (ulint) cs->cset->well_formed_len(cs,
|
len = (ulint) cs->cset->well_formed_len(cs,
|
||||||
(const char*)src_start,
|
(const char *) src_start,
|
||||||
(const char*)(src_start + key_part->length),
|
(const char *) src_start + key_part->length,
|
||||||
key_part->length / cs->mbmaxlen,
|
key_part->length / cs->mbmaxlen,
|
||||||
&error);
|
&error);
|
||||||
} else {
|
} else {
|
||||||
|
@ -218,8 +218,9 @@ extern ulong innobase_large_page_size;
|
|||||||
extern char *innobase_home, *innobase_tmpdir, *innobase_logdir;
|
extern char *innobase_home, *innobase_tmpdir, *innobase_logdir;
|
||||||
extern long innobase_lock_scan_time;
|
extern long innobase_lock_scan_time;
|
||||||
extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
|
extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
|
||||||
extern long innobase_log_file_size, innobase_log_buffer_size;
|
extern longlong innobase_buffer_pool_size, innobase_log_file_size;
|
||||||
extern long innobase_buffer_pool_size, innobase_additional_mem_pool_size;
|
extern long innobase_log_buffer_size;
|
||||||
|
extern long innobase_additional_mem_pool_size;
|
||||||
extern long innobase_buffer_pool_awe_mem_mb;
|
extern long innobase_buffer_pool_awe_mem_mb;
|
||||||
extern long innobase_file_io_threads, innobase_lock_wait_timeout;
|
extern long innobase_file_io_threads, innobase_lock_wait_timeout;
|
||||||
extern long innobase_force_recovery;
|
extern long innobase_force_recovery;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This handler was developed by Mikael Ronström for version 5.1 of MySQL.
|
This handler was developed by Mikael Ronstrom for version 5.1 of MySQL.
|
||||||
It is an abstraction layer on top of other handlers such as MyISAM,
|
It is an abstraction layer on top of other handlers such as MyISAM,
|
||||||
InnoDB, Federated, Berkeley DB and so forth. Partitioned tables can also
|
InnoDB, Federated, Berkeley DB and so forth. Partitioned tables can also
|
||||||
be handled by a storage engine. The current example of this is NDB
|
be handled by a storage engine. The current example of this is NDB
|
||||||
@ -167,6 +167,10 @@ void ha_partition::init_handler_variables()
|
|||||||
m_last_part= 0;
|
m_last_part= 0;
|
||||||
m_rec0= 0;
|
m_rec0= 0;
|
||||||
m_curr_key_info= 0;
|
m_curr_key_info= 0;
|
||||||
|
/*
|
||||||
|
this allows blackhole to work properly
|
||||||
|
*/
|
||||||
|
m_no_locks= 0;
|
||||||
|
|
||||||
#ifdef DONT_HAVE_TO_BE_INITALIZED
|
#ifdef DONT_HAVE_TO_BE_INITALIZED
|
||||||
m_start_key.flag= 0;
|
m_start_key.flag= 0;
|
||||||
@ -912,6 +916,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
|
|||||||
if ((error= (*file)->ha_open((const char*) name_buff, mode,
|
if ((error= (*file)->ha_open((const char*) name_buff, mode,
|
||||||
test_if_locked)))
|
test_if_locked)))
|
||||||
goto err_handler;
|
goto err_handler;
|
||||||
|
m_no_locks+= (*file)->lock_count();
|
||||||
name_buffer_ptr+= strlen(name_buffer_ptr) + 1;
|
name_buffer_ptr+= strlen(name_buffer_ptr) + 1;
|
||||||
set_if_bigger(ref_length, ((*file)->ref_length));
|
set_if_bigger(ref_length, ((*file)->ref_length));
|
||||||
} while (*(++file));
|
} while (*(++file));
|
||||||
@ -1098,7 +1103,7 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type)
|
|||||||
uint ha_partition::lock_count() const
|
uint ha_partition::lock_count() const
|
||||||
{
|
{
|
||||||
DBUG_ENTER("ha_partition::lock_count");
|
DBUG_ENTER("ha_partition::lock_count");
|
||||||
DBUG_RETURN(m_tot_parts);
|
DBUG_RETURN(m_no_locks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1143,7 +1148,7 @@ void ha_partition::unlock_row()
|
|||||||
ADDITIONAL INFO:
|
ADDITIONAL INFO:
|
||||||
|
|
||||||
Most handlers set timestamp when calling write row if any such fields
|
Most handlers set timestamp when calling write row if any such fields
|
||||||
exists. Since we are calling an underlying handler we assume the´
|
exists. Since we are calling an underlying handler we assume the
|
||||||
underlying handler will assume this responsibility.
|
underlying handler will assume this responsibility.
|
||||||
|
|
||||||
Underlying handlers will also call update_auto_increment to calculate
|
Underlying handlers will also call update_auto_increment to calculate
|
||||||
|
@ -67,6 +67,7 @@ private:
|
|||||||
u_long m_low_byte_first;
|
u_long m_low_byte_first;
|
||||||
|
|
||||||
uint m_tot_parts; // Total number of partitions;
|
uint m_tot_parts; // Total number of partitions;
|
||||||
|
uint m_no_locks; // For engines like ha_blackhole, which needs no locks
|
||||||
uint m_last_part; // Last file that we update,write
|
uint m_last_part; // Last file that we update,write
|
||||||
int m_lock_type; // Remembers type of last
|
int m_lock_type; // Remembers type of last
|
||||||
// external_lock
|
// external_lock
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#define HA_ADMIN_REJECT -6
|
#define HA_ADMIN_REJECT -6
|
||||||
#define HA_ADMIN_TRY_ALTER -7
|
#define HA_ADMIN_TRY_ALTER -7
|
||||||
#define HA_ADMIN_WRONG_CHECKSUM -8
|
#define HA_ADMIN_WRONG_CHECKSUM -8
|
||||||
|
#define HA_ADMIN_NOT_BASE_TABLE -9
|
||||||
|
|
||||||
/* Bits in table_flags() to show what database can do */
|
/* Bits in table_flags() to show what database can do */
|
||||||
|
|
||||||
@ -431,10 +432,11 @@ struct show_table_alias_st {
|
|||||||
/* Possible flags of a handlerton */
|
/* Possible flags of a handlerton */
|
||||||
#define HTON_NO_FLAGS 0
|
#define HTON_NO_FLAGS 0
|
||||||
#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
|
#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
|
||||||
#define HTON_ALTER_NOT_SUPPORTED (1 << 1)
|
#define HTON_ALTER_NOT_SUPPORTED (1 << 1) //Engine does not support alter
|
||||||
#define HTON_CAN_RECREATE (1 << 2)
|
#define HTON_CAN_RECREATE (1 << 2) //Delete all is used fro truncate
|
||||||
#define HTON_FLUSH_AFTER_RENAME (1 << 3)
|
#define HTON_HIDDEN (1 << 3) //Engine does not appear in lists
|
||||||
#define HTON_NOT_USER_SELECTABLE (1 << 4)
|
#define HTON_FLUSH_AFTER_RENAME (1 << 4)
|
||||||
|
#define HTON_NOT_USER_SELECTABLE (1 << 5)
|
||||||
|
|
||||||
typedef struct st_thd_trans
|
typedef struct st_thd_trans
|
||||||
{
|
{
|
||||||
|
31
sql/item.cc
31
sql/item.cc
@ -4943,8 +4943,7 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Compare view field's name with item's name before call to referenced
|
Compare two view column references for equality.
|
||||||
item's eq()
|
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
Item_direct_view_ref::eq()
|
Item_direct_view_ref::eq()
|
||||||
@ -4952,12 +4951,13 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
|
|||||||
binary_cmp make binary comparison
|
binary_cmp make binary comparison
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
Consider queries:
|
A view column reference is considered equal to another column
|
||||||
create view v1 as select t1.f1 as f2, t1.f2 as f1 from t1;
|
reference if the second one is a view column and if both column
|
||||||
select * from v1 order by f1;
|
references point to the same field. For views 'same field' means
|
||||||
In order to choose right field for sorting we need to compare
|
the same Item_field object in the view translation table, where
|
||||||
given item's name (f1) to view field's name prior to calling
|
the view translation table contains all result columns of the
|
||||||
referenced item's eq().
|
view. This definition ensures that view columns are resolved
|
||||||
|
in the same manner as table columns.
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
TRUE Referenced item is equal to given item
|
TRUE Referenced item is equal to given item
|
||||||
@ -4967,9 +4967,18 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
|
|||||||
|
|
||||||
bool Item_direct_view_ref::eq(const Item *item, bool binary_cmp) const
|
bool Item_direct_view_ref::eq(const Item *item, bool binary_cmp) const
|
||||||
{
|
{
|
||||||
Item *it= ((Item *) item)->real_item();
|
if (item->type() == REF_ITEM)
|
||||||
return (!it->name || !my_strcasecmp(system_charset_info, it->name,
|
{
|
||||||
field_name)) && ref && (*ref)->real_item()->eq(it, binary_cmp);
|
Item_ref *item_ref= (Item_ref*) item;
|
||||||
|
if (item_ref->ref_type() == VIEW_REF)
|
||||||
|
{
|
||||||
|
Item *item_ref_ref= *(item_ref->ref);
|
||||||
|
DBUG_ASSERT((*ref)->type() == FIELD_ITEM &&
|
||||||
|
(item_ref_ref->type() == FIELD_ITEM));
|
||||||
|
return (*ref == item_ref_ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item_null_helper::print(String *str)
|
void Item_null_helper::print(String *str)
|
||||||
|
@ -1603,7 +1603,11 @@ public:
|
|||||||
void make_field(Send_field *field);
|
void make_field(Send_field *field);
|
||||||
bool fix_fields(THD *, Item **);
|
bool fix_fields(THD *, Item **);
|
||||||
int save_in_field(Field *field, bool no_conversions);
|
int save_in_field(Field *field, bool no_conversions);
|
||||||
void save_org_in_field(Field *field) { (*ref)->save_org_in_field(field); }
|
void save_org_in_field(Field *field)
|
||||||
|
{
|
||||||
|
(*ref)->save_org_in_field(field);
|
||||||
|
null_value= (*ref)->null_value;
|
||||||
|
}
|
||||||
enum Item_result result_type () const { return (*ref)->result_type(); }
|
enum Item_result result_type () const { return (*ref)->result_type(); }
|
||||||
enum_field_types field_type() const { return (*ref)->field_type(); }
|
enum_field_types field_type() const { return (*ref)->field_type(); }
|
||||||
Field *get_tmp_table_field()
|
Field *get_tmp_table_field()
|
||||||
|
@ -4775,12 +4775,6 @@ Item_func_sp::execute(Item **itp)
|
|||||||
res= m_sp->execute_function(thd, args, arg_count, itp);
|
res= m_sp->execute_function(thd, args, arg_count, itp);
|
||||||
thd->restore_sub_statement_state(&statement_state);
|
thd->restore_sub_statement_state(&statement_state);
|
||||||
|
|
||||||
if (res && mysql_bin_log.is_open() &&
|
|
||||||
(m_sp->m_chistics->daccess == SP_CONTAINS_SQL ||
|
|
||||||
m_sp->m_chistics->daccess == SP_MODIFIES_SQL_DATA))
|
|
||||||
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
||||||
ER_FAILED_ROUTINE_BREAK_BINLOG,
|
|
||||||
ER(ER_FAILED_ROUTINE_BREAK_BINLOG));
|
|
||||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||||
sp_restore_security_context(thd, save_ctx_func);
|
sp_restore_security_context(thd, save_ctx_func);
|
||||||
error:
|
error:
|
||||||
@ -4894,7 +4888,7 @@ Item_func_sp::tmp_table_field(TABLE *t_arg)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Find the function and chack access rigths to the function
|
Find the function and check access rights to the function
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
find_and_check_access()
|
find_and_check_access()
|
||||||
|
@ -1129,7 +1129,6 @@ class user_var_entry;
|
|||||||
class Item_func_set_user_var :public Item_func
|
class Item_func_set_user_var :public Item_func
|
||||||
{
|
{
|
||||||
enum Item_result cached_result_type;
|
enum Item_result cached_result_type;
|
||||||
LEX_STRING name;
|
|
||||||
user_var_entry *entry;
|
user_var_entry *entry;
|
||||||
char buffer[MAX_FIELD_WIDTH];
|
char buffer[MAX_FIELD_WIDTH];
|
||||||
String value;
|
String value;
|
||||||
@ -1146,6 +1145,7 @@ class Item_func_set_user_var :public Item_func
|
|||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
LEX_STRING name; // keep it public
|
||||||
Item_func_set_user_var(LEX_STRING a,Item *b)
|
Item_func_set_user_var(LEX_STRING a,Item *b)
|
||||||
:Item_func(b), cached_result_type(INT_RESULT), name(a)
|
:Item_func(b), cached_result_type(INT_RESULT), name(a)
|
||||||
{}
|
{}
|
||||||
@ -1168,10 +1168,10 @@ public:
|
|||||||
|
|
||||||
class Item_func_get_user_var :public Item_func
|
class Item_func_get_user_var :public Item_func
|
||||||
{
|
{
|
||||||
LEX_STRING name;
|
|
||||||
user_var_entry *var_entry;
|
user_var_entry *var_entry;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
LEX_STRING name; // keep it public
|
||||||
Item_func_get_user_var(LEX_STRING a):
|
Item_func_get_user_var(LEX_STRING a):
|
||||||
Item_func(), name(a) {}
|
Item_func(), name(a) {}
|
||||||
enum Functype functype() const { return GUSERVAR_FUNC; }
|
enum Functype functype() const { return GUSERVAR_FUNC; }
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user