summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmake/install_layout.cmake2
-rw-r--r--cmake/install_macros.cmake15
-rw-r--r--dbug/dbug.c2
-rwxr-xr-xlibmysql/CMakeLists.txt29
-rw-r--r--libmysqld/CMakeLists.txt5
-rw-r--r--libservices/CMakeLists.txt1
-rw-r--r--mysql-test/CMakeLists.txt3
-rw-r--r--mysql-test/collections/default.experimental3
-rw-r--r--mysql-test/include/default_my.cnf8
-rw-r--r--mysql-test/include/not_var_link.inc13
-rw-r--r--mysql-test/lib/My/SafeProcess/CMakeLists.txt4
-rwxr-xr-xmysql-test/mysql-test-run.pl29
-rw-r--r--mysql-test/r/func_math.result136
-rw-r--r--mysql-test/r/func_misc.result6
-rw-r--r--mysql-test/r/func_test.result4
-rw-r--r--mysql-test/r/mdl_sync.result16
-rw-r--r--mysql-test/r/partition_column.result50
-rw-r--r--mysql-test/r/select.result15
-rw-r--r--mysql-test/r/sp.result32
-rw-r--r--mysql-test/r/strict.result5
-rw-r--r--mysql-test/r/type_newdecimal.result7
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result493
-rw-r--r--mysql-test/suite/perfschema/t/misc.test1
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_basic.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_user_variables.result16
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_basic.test27
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_user_variables.test33
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync-slave.opt2
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test2
-rw-r--r--mysql-test/t/func_math.test141
-rw-r--r--mysql-test/t/func_misc.test2
-rw-r--r--mysql-test/t/func_test.test2
-rw-r--r--mysql-test/t/mdl_sync.test38
-rw-r--r--mysql-test/t/partition_column.test65
-rw-r--r--mysql-test/t/select.test4
-rw-r--r--mysql-test/t/sp.test9
-rw-r--r--mysql-test/t/strict.test1
-rw-r--r--mysql-test/t/system_mysql_db_fix30020.test108
-rw-r--r--mysql-test/t/type_newdecimal.test1
-rwxr-xr-xscripts/CMakeLists.txt5
-rw-r--r--scripts/Makefile.am3
-rwxr-xr-xscripts/make_win_bin_dist2
-rw-r--r--scripts/mysql_fix_privilege_tables.sh223
-rw-r--r--scripts/mysql_system_tables_fix.sql4
-rw-r--r--scripts/mysqld_safe.sh2
-rw-r--r--sql/events.cc27
-rw-r--r--sql/events.h8
-rw-r--r--sql/ha_ndbcluster_binlog.cc2
-rw-r--r--sql/item_create.cc4
-rw-r--r--sql/item_func.cc329
-rw-r--r--sql/item_func.h59
-rw-r--r--sql/lock.cc148
-rw-r--r--sql/log.cc2
-rw-r--r--sql/log_event_old.cc91
-rw-r--r--sql/mysql_priv.h16
-rw-r--r--sql/share/errmsg-utf8.txt6
-rw-r--r--sql/sql_base.cc147
-rw-r--r--sql/sql_class.h6
-rw-r--r--sql/sql_db.cc2
-rw-r--r--sql/sql_handler.cc61
-rw-r--r--sql/sql_insert.cc34
-rw-r--r--sql/sql_partition.cc4
-rw-r--r--sql/sql_show.cc4
-rw-r--r--sql/sql_table.cc6
-rw-r--r--sql/sql_update.cc89
-rw-r--r--sql/sys_vars.cc24
-rw-r--r--sql/tztime.cc2
-rw-r--r--sql/udf_example.c2
-rw-r--r--storage/innobase/CMakeLists.txt2
-rw-r--r--support-files/mysql.spec.sh5
72 files changed, 1260 insertions, 1399 deletions
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
index 92eebebd4e2..2d8c218a293 100755
--- a/cmake/install_layout.cmake
+++ b/cmake/install_layout.cmake
@@ -111,7 +111,7 @@ ENDIF()
# Clear cached variables if install layout was changed
IF(OLD_INSTALL_LAYOUT)
- IF(NOT OLD_INSTALL_LAYOUT STREQUAL INSTALL_LAYOUR)
+ IF(NOT OLD_INSTALL_LAYOUT STREQUAL INSTALL_LAYOUT)
SET(FORCE FORCE)
ENDIF()
ENDIF()
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index 1dcf8b5ca21..73da532ecf6 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -43,27 +43,26 @@ ENDMACRO()
# Install symbolic link to CMake target.
# the link is created in the same directory as target
# and extension will be the same as for target file.
-MACRO(INSTALL_SYMLINK linkbasename target destination)
+MACRO(INSTALL_SYMLINK linkname target destination)
IF(UNIX)
GET_TARGET_PROPERTY(location ${target} LOCATION)
GET_FILENAME_COMPONENT(path ${location} PATH)
- GET_FILENAME_COMPONENT(name_we ${location} NAME_WE)
- GET_FILENAME_COMPONENT(ext ${location} EXT)
- SET(output ${path}/${linkbasename}${ext})
+ GET_FILENAME_COMPONENT(name ${location} NAME)
+ SET(output ${path}/${linkname})
ADD_CUSTOM_COMMAND(
OUTPUT ${output}
COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${output}
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink
- ${name_we}${ext}
- ${linkbasename}${ext}
+ ${name}
+ ${linkname}
WORKING_DIRECTORY ${path}
DEPENDS ${target}
)
- ADD_CUSTOM_TARGET(symlink_${linkbasename}${ext}
+ ADD_CUSTOM_TARGET(symlink_${linkname}
ALL
DEPENDS ${output})
- SET_TARGET_PROPERTIES(symlink_${linkbasename}${ext} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+ SET_TARGET_PROPERTIES(symlink_${linkname} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
IF(CMAKE_GENERATOR MATCHES "Xcode")
# For Xcode, replace project config with install config
STRING(REPLACE "${CMAKE_CFG_INTDIR}"
diff --git a/dbug/dbug.c b/dbug/dbug.c
index 9bcea988b33..d75a5ae269e 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -384,7 +384,7 @@ static CODE_STATE *code_state(void)
if (!init_done)
{
init_done=TRUE;
- pthread_mutex_init(&THR_LOCK_dbug,MY_MUTEX_INIT_FAST);
+ pthread_mutex_init(&THR_LOCK_dbug, NULL);
bzero(&init_settings, sizeof(init_settings));
init_settings.out_file=stderr;
init_settings.flags=OPEN_APPEND;
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index f9fc5355641..26af9c80a2b 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -153,15 +153,26 @@ SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES})
# Merge several convenience libraries into one big mysqlclient
# and link them together into shared library.
MERGE_LIBRARIES(mysqlclient STATIC ${LIBS})
-IF(UNIX)
- INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient ${INSTALL_LIBDIR})
-ENDIF()
# Visual Studio users need debug static library for debug projects
IF(MSVC)
INSTALL_DEBUG_TARGET(mysqlclient DESTINATION ${INSTALL_LIBDIR}/debug)
ENDIF()
+IF(UNIX)
+ MACRO(GET_VERSIONED_LIBNAME LIBNAME EXTENSION VERSION OUTNAME)
+ SET(DOT_VERSION ".${VERSION}")
+ IF(DOT_VERSION STREQUAL ".")
+ SET(DOT_VERSION "")
+ ENDIF()
+ IF(APPLE)
+ SET(${OUTNAME} ${LIBNAME}${DOT_VERSION}${EXTENSION})
+ ELSE()
+ SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION})
+ ENDIF()
+ ENDMACRO()
+ENDIF()
+
IF(NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
IF(UNIX)
@@ -182,6 +193,16 @@ IF(NOT DISABLE_SHARED)
#(mysqlclient in this case)
SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(libmysql PROPERTIES CLEAN_DIRECT_OUTPUT 1)
- INSTALL_SYMLINK(${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r libmysql ${INSTALL_LIBDIR})
+
+ # Install 3 links to libmysqlclient.so (client_r)
+ FOREACH(ver "" "${SHARED_LIB_MAJOR_VERSION}"
+ "${SHARED_LIB_MAJOR_VERSION}.0.0")
+ GET_VERSIONED_LIBNAME(
+ "${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r"
+ "${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ "${ver}"
+ linkname)
+ INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR})
+ ENDFOREACH()
ENDIF()
ENDIF()
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index e5f2a8b56f9..26332cab61b 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -131,6 +131,11 @@ IF(MSVC)
INSTALL_DEBUG_TARGET(mysqlserver DESTINATION ${INSTALL_LIBDIR}/debug)
ENDIF()
+IF(UNIX)
+ INSTALL_DEBUG_TARGET(mysqlserver DESTINATION ${INSTALL_LIBDIR} RENAME
+ ${CMAKE_STATIC_LIBRARY_PREFIX}/mysqld-debug)
+ENDIF()
+
IF(MSVC AND NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
ENDIF()
diff --git a/libservices/CMakeLists.txt b/libservices/CMakeLists.txt
index ddfa2495ade..da84368b46c 100644
--- a/libservices/CMakeLists.txt
+++ b/libservices/CMakeLists.txt
@@ -18,3 +18,4 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
SET(MYSQLSERVICES_SOURCES my_snprintf_service.c thd_alloc_service.c)
ADD_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
+INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR})
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index 2cc65a9c82f..b8b7d08135f 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -46,7 +46,8 @@ IF(UNIX)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr
- ${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run DESTINATION mysql-test)
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run
+ DESTINATION ${INSTALL_MYSQLTESTDIR})
ENDIF()
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental
index 4e8df10132a..46b9691ee65 100644
--- a/mysql-test/collections/default.experimental
+++ b/mysql-test/collections/default.experimental
@@ -10,6 +10,9 @@ main.information_schema # Bug#47449 2009-09-19 alik main.inform
main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10
main.log_tables # Bug#47924 2009-10-08 alik main.log_tables times out sporadically
+main.mysqlbinlog_row @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
+main.mysqlbinlog_row_innodb @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
+main.mysqlbinlog_row_myisam @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
main.plugin # Bug#47146 Linking problem with example plugin when dtrace enabled
main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf
index 6888a69b0a4..83c67638d4e 100644
--- a/mysql-test/include/default_my.cnf
+++ b/mysql-test/include/default_my.cnf
@@ -30,14 +30,6 @@ loose-enable-performance-schema
[mysqlbinlog]
disable-force-if-open
-# mysql_fix_privilege_tables.sh does not read from [client] so it
-# need its own section
-[mysql_fix_privilege_tables]
-socket= @client.socket
-port= @client.port
-user= @client.user
-password= @client.password
-
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
diff --git a/mysql-test/include/not_var_link.inc b/mysql-test/include/not_var_link.inc
new file mode 100644
index 00000000000..96db4f1dfd5
--- /dev/null
+++ b/mysql-test/include/not_var_link.inc
@@ -0,0 +1,13 @@
+perl;
+ open (ISLINK, ">" . $ENV{'MYSQL_TMP_DIR'} . "/mtr_var_link");
+ my $mvr= -l $ENV{'MYSQLTEST_VARDIR'} ? 1 : 0;
+ print ISLINK "let \$mtr_var_link= $mvr;\n";
+ close ISLINK;
+EOF
+
+--source $MYSQL_TMP_DIR/mtr_var_link
+--remove_file $MYSQL_TMP_DIR/mtr_var_link
+
+if ($mtr_var_link) {
+ --skip Test does not work with var being softlink
+}
diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt
index ec2a13b910c..893e6d896be 100644
--- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt
+++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt
@@ -20,8 +20,8 @@ ELSE()
ADD_EXECUTABLE(my_safe_process safe_process.cc)
ENDIF()
-INSTALL(TARGETS my_safe_process DESTINATION "mysql-test/lib/My/SafeProcess")
+INSTALL(TARGETS my_safe_process DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess")
IF(WIN32)
- INSTALL(TARGETS my_safe_kill DESTINATION "mysql-test/lib/My/SafeProcess")
+ INSTALL(TARGETS my_safe_kill DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess")
ENDIF()
INSTALL(FILES safe_process.pl Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess")
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 2fbbdf0b819..58a289422f4 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1723,26 +1723,8 @@ sub client_debug_arg($$) {
}
-sub mysql_fix_arguments () {
-
- return "" ;
-
- my $exe=
- mtr_script_exists("$basedir/scripts/mysql_fix_privilege_tables",
- "$path_client_bindir/mysql_fix_privilege_tables");
- my $args;
- mtr_init_args(\$args);
- mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
-
- mtr_add_arg($args, "--basedir=%s", $basedir);
- mtr_add_arg($args, "--bindir=%s", $path_client_bindir);
- mtr_add_arg($args, "--verbose");
- return mtr_args2str($exe, @$args);
-}
-
-
sub client_arguments ($;$) {
- my $client_name= shift;
+ my $client_name= shift;
my $group_suffix= shift;
my $client_exe= mtr_exe_exists("$path_client_bindir/$client_name");
@@ -2083,7 +2065,6 @@ sub environment_setup {
$ENV{'MYSQL_UPGRADE'}= client_arguments("mysql_upgrade");
$ENV{'MYSQLADMIN'}= native_path($exe_mysqladmin);
$ENV{'MYSQL_CLIENT_TEST'}= mysql_client_test_arguments();
- $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= mysql_fix_arguments();
$ENV{'EXE_MYSQL'}= $exe_mysql;
# ----------------------------------------------------
@@ -2647,14 +2628,6 @@ sub create_config_file_for_extern {
character-sets-dir= $path_charsetsdir
local-load= $opt_tmpdir
-# mysql_fix_privilege_tables.sh don't read from [client]
-[mysql_fix_privilege_tables]
-socket = $opts{'socket'}
-port = $opts{'port'}
-user = $opts{'user'}
-password = $opts{'password'}
-
-
EOF
;
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 537b1db9781..307f1714132 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -98,7 +98,7 @@ explain extended select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
+Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format(cot(1),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
select degrees(pi()),radians(360);
degrees(pi()) radians(360)
180 6.283185307179586
@@ -451,23 +451,17 @@ SELECT 1 FROM (SELECT ROUND(f1, f1) AS a FROM t1) AS s WHERE a LIKE 'a';
DROP TABLE t1;
End of 5.0 tests
SELECT 1e308 + 1e308;
-1e308 + 1e308
-NULL
+ERROR 22003: DOUBLE value is out of range in '(1e308 + 1e308)'
SELECT -1e308 - 1e308;
--1e308 - 1e308
-NULL
+ERROR 22003: DOUBLE value is out of range in '(-(1e308) - 1e308)'
SELECT 1e300 * 1e300;
-1e300 * 1e300
-NULL
+ERROR 22003: DOUBLE value is out of range in '(1e300 * 1e300)'
SELECT 1e300 / 1e-300;
-1e300 / 1e-300
-NULL
+ERROR 22003: DOUBLE value is out of range in '(1e300 / 1e-300)'
SELECT EXP(750);
-EXP(750)
-NULL
+ERROR 22003: DOUBLE value is out of range in 'exp(750)'
SELECT POW(10, 309);
-POW(10, 309)
-NULL
+ERROR 22003: DOUBLE value is out of range in 'pow(10,309)'
#
# Bug #44768: SIGFPE crash when selecting rand from a view
# containing null
@@ -488,11 +482,121 @@ RAND(i)
DROP TABLE t1;
#
select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x;
-ERROR 22003: Out of range value for column 'x' at row 1
+ERROR 22003: BIGINT value is out of range in '(123456789012345678901234567890.123456789012345678901234567890 DIV 1)'
select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x;
-ERROR 22003: Out of range value for column 'x' at row 1
+ERROR 22003: BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)'
SHOW WARNINGS;
Level Code Message
Warning 1292 Truncated incorrect DECIMAL value: ''
-Error 1264 Out of range value for column 'x' at row 1
+Error 1690 BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)'
End of 5.1 tests
+#
+# Bug #8433: Overflow must be an error
+#
+SELECT 1e308 + 1e308;
+ERROR 22003: DOUBLE value is out of range in '(1e308 + 1e308)'
+SELECT -1e308 - 1e308;
+ERROR 22003: DOUBLE value is out of range in '(-(1e308) - 1e308)'
+SELECT 1e300 * 1e300;
+ERROR 22003: DOUBLE value is out of range in '(1e300 * 1e300)'
+SELECT 1e300 / 1e-300;
+ERROR 22003: DOUBLE value is out of range in '(1e300 / 1e-300)'
+SELECT EXP(750);
+ERROR 22003: DOUBLE value is out of range in 'exp(750)'
+SELECT POW(10, 309);
+ERROR 22003: DOUBLE value is out of range in 'pow(10,309)'
+SELECT COT(0);
+ERROR 22003: DOUBLE value is out of range in 'cot(0)'
+SELECT DEGREES(1e307);
+ERROR 22003: DOUBLE value is out of range in 'degrees(1e307)'
+SELECT 9223372036854775808 + 9223372036854775808;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(9223372036854775808 + 9223372036854775808)'
+SELECT 18446744073709551615 + 1;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1)'
+SELECT 1 + 18446744073709551615;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(1 + 18446744073709551615)'
+SELECT -2 + CAST(1 AS UNSIGNED);
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(-(2) + cast(1 as unsigned))'
+SELECT CAST(1 AS UNSIGNED) + -2;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) + -(2))'
+SELECT -9223372036854775808 + -9223372036854775808;
+ERROR 22003: BIGINT value is out of range in '(-(9223372036854775808) + -(9223372036854775808))'
+SELECT 9223372036854775807 + 9223372036854775807;
+ERROR 22003: BIGINT value is out of range in '(9223372036854775807 + 9223372036854775807)'
+SELECT CAST(0 AS UNSIGNED) - 9223372036854775809;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(0 as unsigned) - 9223372036854775809)'
+SELECT 9223372036854775808 - 9223372036854775809;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(9223372036854775808 - 9223372036854775809)'
+SELECT CAST(1 AS UNSIGNED) - 2;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) - 2)'
+SELECT 18446744073709551615 - (-1);
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 - -(1))'
+SELECT -1 - 9223372036854775808;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(-(1) - 9223372036854775808)'
+SELECT -1 - CAST(1 AS UNSIGNED);
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(-(1) - cast(1 as unsigned))'
+SELECT -9223372036854775808 - 1;
+ERROR 22003: BIGINT value is out of range in '(-(9223372036854775808) - 1)'
+SELECT 9223372036854775807 - -9223372036854775808;
+ERROR 22003: BIGINT value is out of range in '(9223372036854775807 - -(9223372036854775808))'
+set SQL_MODE='NO_UNSIGNED_SUBTRACTION';
+SELECT 18446744073709551615 - 1;
+ERROR 22003: BIGINT value is out of range in '(18446744073709551615 - 1)'
+SELECT 18446744073709551615 - CAST(1 AS UNSIGNED);
+ERROR 22003: BIGINT value is out of range in '(18446744073709551615 - cast(1 as unsigned))'
+SELECT 18446744073709551614 - (-1);
+ERROR 22003: BIGINT value is out of range in '(18446744073709551614 - -(1))'
+SELECT 9223372036854775807 - -1;
+ERROR 22003: BIGINT value is out of range in '(9223372036854775807 - -(1))'
+set SQL_MODE=default;
+SELECT 4294967296 * 4294967296;
+ERROR 22003: BIGINT value is out of range in '(4294967296 * 4294967296)'
+SELECT 9223372036854775808 * 2;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(9223372036854775808 * 2)'
+SELECT 9223372036854775808 * 2;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(9223372036854775808 * 2)'
+SELECT 7158278827 * 3221225472;
+ERROR 22003: BIGINT value is out of range in '(7158278827 * 3221225472)'
+SELECT 9223372036854775807 * (-2);
+ERROR 22003: BIGINT value is out of range in '(9223372036854775807 * -(2))'
+SELECT CAST(1 as UNSIGNED) * (-1);
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(cast(1 as unsigned) * -(1))'
+SELECT 9223372036854775807 * 2;
+ERROR 22003: BIGINT value is out of range in '(9223372036854775807 * 2)'
+SELECT ABS(-9223372036854775808);
+ERROR 22003: BIGINT value is out of range in 'abs(-(9223372036854775808))'
+SELECT -9223372036854775808 DIV -1;
+ERROR 22003: BIGINT value is out of range in '(-(9223372036854775808) DIV -(1))'
+SELECT 18446744073709551615 DIV -1;
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 DIV -(1))'
+CREATE TABLE t1(a BIGINT, b BIGINT UNSIGNED);
+INSERT INTO t1 VALUES(-9223372036854775808, 9223372036854775809);
+SELECT -a FROM t1;
+ERROR 22003: BIGINT value is out of range in '-('-9223372036854775808')'
+SELECT -b FROM t1;
+ERROR 22003: BIGINT value is out of range in '-('9223372036854775809')'
+DROP TABLE t1;
+SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+SELECT @a + @a;
+ERROR 22003: DECIMAL value is out of range in '((@a) + (@a))'
+SELECT @a * @a;
+ERROR 22003: DECIMAL value is out of range in '((@a) * (@a))'
+SELECT -@a - @a;
+ERROR 22003: DECIMAL value is out of range in '(-((@a)) - (@a))'
+SELECT @a / 0.5;
+ERROR 22003: DECIMAL value is out of range in '((@a) / 0.5)'
+SELECT COT(1/0);
+COT(1/0)
+NULL
+SELECT -1 + 9223372036854775808;
+-1 + 9223372036854775808
+9223372036854775807
+SELECT 2 DIV -2;
+2 DIV -2
+-1
+SELECT -(1 DIV 0);
+-(1 DIV 0)
+NULL
+SELECT -9223372036854775808 MOD -1;
+-9223372036854775808 MOD -1
+0
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 81dddd0f648..d4c1aef4054 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -25,9 +25,9 @@ length(uuid()) charset(uuid()) length(unhex(replace(uuid(),_utf8'-',_utf8'')))
36 utf8 16
set @a= uuid_short();
set @b= uuid_short();
-select cast(@a - @b as signed);
-cast(@a - @b as signed)
--1
+select @b - @a;
+@b - @a
+1
select length(format('nan', 2)) > 0;
length(format('nan', 2)) > 0
1
diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result
index 96a7bafccfc..bd111a3c310 100644
--- a/mysql-test/r/func_test.result
+++ b/mysql-test/r/func_test.result
@@ -63,8 +63,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3`
-select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
-(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2
+select 18446744073709551615, 18446744073709551615 DIV 1, 18446744073709551615 DIV 2;
+18446744073709551615 18446744073709551615 DIV 1 18446744073709551615 DIV 2
18446744073709551615 18446744073709551615 9223372036854775807
explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result
index ff6daf6443e..984f0df3d0e 100644
--- a/mysql-test/r/mdl_sync.result
+++ b/mysql-test/r/mdl_sync.result
@@ -1678,14 +1678,21 @@ insert into t2 values (1);;
#
# Switching to connection 'handler_con1'.
# Wait until INSERT is blocked on table-level lock.
-# The below statement should not cause deadlock.
+# Sending 'alter table t1 drop column j'. It should not cause
+# deadlock.
alter table t1 drop column j;
-unlock tables;
+# Switching to connection 'handler_con2'.
+# Wait until ALTER is blocked during upgrade.
#
# Switching to connection 'default'.
# Reap INSERT.
+ERROR HY000: Wait on a lock was aborted due to a pending exclusive lock
handler t1 close;
#
+# Switching to connection 'handler_con1'.
+# Reaping 'alter table t1 drop column j'
+unlock tables;
+# Switching to connection 'default'.
# Then, check the scenario in which upgrade of SNRW lock to X
# lock is blocked by HANDLER which is open in connection currently
# waiting to get SW lock on the same table.
@@ -2248,6 +2255,8 @@ SET DEBUG_SYNC= 'RESET';
# Bug#50786 Assertion `thd->mdl_context.trans_sentinel() == __null'
# failed in open_ltable()
#
+# Supress warnings written to the log file
+call mtr.add_suppression("Wait on a lock was aborted due to a pending exclusive lock");
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (i INT);
CREATE TABLE t2 (i INT);
@@ -2271,7 +2280,6 @@ SET DEBUG_SYNC= 'now WAIT_FOR parked';
# Sending:
SELECT 1;
# connection: con3
-# Sending:
ALTER TABLE t1 ADD COLUMN j INT;
# connection: default
SET DEBUG_SYNC= 'now SIGNAL go';
@@ -2284,8 +2292,6 @@ HANDLER t1 CLOSE;
# Reaping SELECT 1
1
1
-# connection: con3
-# Reaping ALTER TABLE t1 ADD COLUMN j INT
# connection: default
DROP TABLE t1, t2;
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/r/partition_column.result b/mysql-test/r/partition_column.result
index ddc48b635cf..458343a6b92 100644
--- a/mysql-test/r/partition_column.result
+++ b/mysql-test/r/partition_column.result
@@ -1,4 +1,44 @@
drop table if exists t1;
+CREATE TABLE t1 (a DECIMAL)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN (0));
+ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning
+CREATE TABLE t1 (a BLOB)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN ("X"));
+ERROR HY000: A BLOB field is not allowed in partition function
+CREATE TABLE t1 (a TEXT)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN ("X"));
+ERROR HY000: A BLOB field is not allowed in partition function
+CREATE TABLE t1 (a FLOAT)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN (0.0));
+ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning
+CREATE TABLE t1 (a DOUBLE)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN (0.0));
+ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning
+CREATE TABLE t1 (d TIMESTAMP)
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN ('2000-01-01'),
+PARTITION p1 VALUES LESS THAN ('2040-01-01'));
+ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
+CREATE TABLE t1 (d BIT(1))
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN (0),
+PARTITION p1 VALUES LESS THAN (1));
+ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
+CREATE TABLE t1 (d ENUM("YES","NO"))
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN ("NO"),
+PARTITION p1 VALUES LESS THAN (MAXVALUE));
+ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
+CREATE TABLE t1 (d SET("Car","MC"))
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN ("MC"),
+PARTITION p1 VALUES LESS THAN (MAXVALUE));
+ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
create table t1 (a int, b int)
partition by range columns (a,b)
( partition p0 values less than (maxvalue, 10),
@@ -430,16 +470,6 @@ partition by range columns(d)
( partition p0 values less than ('2000-01-01'),
partition p1 values less than ('2040-01-01'));
ERROR HY000: Partition column values of incorrect type
-create table t1 (d timestamp)
-partition by range columns(d)
-( partition p0 values less than ('2000-01-01'),
-partition p1 values less than ('2040-01-01'));
-ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
-create table t1 (d bit(1))
-partition by range columns(d)
-( partition p0 values less than (0),
-partition p1 values less than (1));
-ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
create table t1 (a int, b int)
partition by range columns(a,b)
(partition p0 values less than (maxvalue, 10));
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index cc752c03a36..305a74ee086 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2426,27 +2426,28 @@ city
London
DROP TABLE t1;
create table t1 (a int(11) unsigned, b int(11) unsigned);
-insert into t1 values (1,0), (1,1), (1,2);
+insert into t1 values (1,0), (1,1), (18446744073709551615,0);
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 3
select a-b from t1 order by 1;
a-b
0
1
-18446744073709551615
+4294967295
select a-b , (a-b < 0) from t1 order by 1;
a-b (a-b < 0)
0 0
1 0
-18446744073709551615 0
+4294967295 0
select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0;
d (a-b >= 0) b
1 1 0
0 1 1
-18446744073709551615 1 2
select cast((a - b) as unsigned) from t1 order by 1;
cast((a - b) as unsigned)
0
1
-18446744073709551615
+4294967295
drop table t1;
create table t1 (a int(11));
select all all * from t1;
@@ -3419,6 +3420,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where
DROP TABLE t1,t2;
+SET SQL_MODE='NO_UNSIGNED_SUBTRACTION';
CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL);
INSERT t1 SET i = 0;
UPDATE t1 SET i = -1;
@@ -3438,8 +3440,9 @@ Warnings:
Warning 1264 Out of range value for column 'i' at row 1
SELECT * FROM t1;
i
-255
+0
DROP TABLE t1;
+SET SQL_MODE=default;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, c int, e int, primary key(a,b,c));
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index cd7874be414..5a746b330bc 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -6022,16 +6022,12 @@ select bug20777(9223372036854775810) as '9223372036854775810 2**63+2';
9223372036854775810 2**63+2
9223372036854775810
select bug20777(-9223372036854775808) as 'lower bounds signed bigint';
-lower bounds signed bigint
-0
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
select bug20777(9223372036854775807) as 'upper bounds signed bigint';
upper bounds signed bigint
9223372036854775807
select bug20777(0) as 'lower bounds unsigned bigint';
-lower bounds unsigned bigint
-0
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
select bug20777(18446744073709551615) as 'upper bounds unsigned bigint';
upper bounds unsigned bigint
18446744073709551615
@@ -6041,10 +6037,7 @@ upper bounds unsigned bigint + 1
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
select bug20777(-1) as 'lower bounds unsigned bigint - 1';
-lower bounds unsigned bigint - 1
-0
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
create table examplebug20777 as select
0 as 'i',
bug20777(9223372036854775806) as '2**63-2',
@@ -6053,15 +6046,10 @@ bug20777(9223372036854775808) as '2**63',
bug20777(9223372036854775809) as '2**63+1',
bug20777(18446744073709551614) as '2**64-2',
bug20777(18446744073709551615) as '2**64-1',
-bug20777(18446744073709551616) as '2**64',
-bug20777(0) as '0',
-bug20777(-1) as '-1';
+bug20777(18446744073709551616) as '2**64';
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
-insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1);
-Warnings:
-Warning 1264 Out of range value for column '-1' at row 1
+insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616);
show create table examplebug20777;
Table Create Table
examplebug20777 CREATE TABLE `examplebug20777` (
@@ -6072,14 +6060,12 @@ examplebug20777 CREATE TABLE `examplebug20777` (
`2**63+1` bigint(20) unsigned DEFAULT NULL,
`2**64-2` bigint(20) unsigned DEFAULT NULL,
`2**64-1` bigint(20) unsigned DEFAULT NULL,
- `2**64` bigint(20) unsigned DEFAULT NULL,
- `0` bigint(20) unsigned DEFAULT NULL,
- `-1` bigint(20) unsigned DEFAULT NULL
+ `2**64` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from examplebug20777 order by i;
-i 2**63-2 2**63-1 2**63 2**63+1 2**64-2 2**64-1 2**64 0 -1
-0 9223372036854775806 9223372036854775807 9223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 18446744073709551615 0 0
-1 9223372036854775806 9223372036854775807 223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 8446744073709551616 0 0
+i 2**63-2 2**63-1 2**63 2**63+1 2**64-2 2**64-1 2**64
+0 9223372036854775806 9223372036854775807 9223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 18446744073709551615
+1 9223372036854775806 9223372036854775807 223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 8446744073709551616
drop table examplebug20777;
select bug20777(18446744073709551613)+1;
bug20777(18446744073709551613)+1
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index a835f021d3a..4f259fc4d7d 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -895,6 +895,7 @@ ERROR 22003: Out of range value for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
ERROR 22003: Out of range value for column 'col2' at row 1
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
+ERROR 22003: DOUBLE value is out of range in '("test"."t1"."col1" * 5000)'
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
ERROR 22012: Division by 0
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
@@ -922,10 +923,10 @@ SELECT * FROM t1;
col1 col2
-2.2e-307 0
1e-303 0
-NULL 1.7e308
+1.7e308 1.7e308
-2.2e-307 0
-2e-307 0
-NULL 1.7e308
+1.7e308 1.7e308
0 NULL
2 NULL
NULL NULL
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 00526597a32..e5fbf158a8b 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -1385,11 +1385,7 @@ Warning 1264 Out of range value for column 'c1' at row 1
insert into t1 values(
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 *
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
-Warnings:
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1264 Out of range value for column 'c1' at row 1
+ERROR 22003: DECIMAL value is out of range in '(99999999999999999999999999999999999999999999999999999999999999999 * 99999999999999999999999999999999999999999999999999999999999999999)'
insert into t1 values(1e100);
Warnings:
Warning 1264 Out of range value for column 'c1' at row 1
@@ -1397,7 +1393,6 @@ select * from t1;
c1
9999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999
-9999999999999999999999999999999999999999999999999999999999999999
drop table t1;
create table t1(a decimal(7,2));
insert into t1 values(123.12);
diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index 1b18298d2f3..082da9938f7 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -16315,10 +16315,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
return f1;
END//
SELECT fn4(-9.22e+15);
-fn4(-9.22e+15)
-0
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP FUNCTION IF EXISTS fn5;
CREATE FUNCTION fn5( f1 decimal) returns decimal
BEGIN
@@ -16854,11 +16851,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
return f1;
END//
SELECT fn56(-8388601);
-fn56(-8388601)
-16777215
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP FUNCTION IF EXISTS fn57;
CREATE FUNCTION fn57( f1 numeric) returns numeric
BEGIN
@@ -17157,11 +17150,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
return f1;
END//
SELECT fn84(-32601);
-fn84(-32601)
-65535
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP FUNCTION IF EXISTS fn85;
CREATE FUNCTION fn85( f1 tinyint) returns tinyint
BEGIN
@@ -17196,11 +17185,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
return f1;
END//
SELECT fn88(-101);
-fn88(-101)
-255
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP FUNCTION IF EXISTS fn89;
CREATE FUNCTION fn89( f1 enum('1enum', '2enum')) returns enum('1enum', '2enum')
BEGIN
@@ -17425,10 +17410,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
SELECT f1;
END//
CALL sp4(-9.22e+15);
-f1
-00000000000000000000
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP PROCEDURE IF EXISTS sp5;
CREATE PROCEDURE sp5( f1 decimal)
BEGIN
@@ -17985,11 +17967,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
SELECT f1;
END//
CALL sp56(-8388601);
-f1
-16777215
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP PROCEDURE IF EXISTS sp57;
CREATE PROCEDURE sp57( f1 numeric)
BEGIN
@@ -18321,11 +18299,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
SELECT f1;
END//
CALL sp84(-32601);
-f1
-65535
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP PROCEDURE IF EXISTS sp85;
CREATE PROCEDURE sp85( f1 tinyint)
BEGIN
@@ -18360,11 +18334,7 @@ set f1 = (f1 / 2); set f1 = (f1 * 2); set f1 = (f1 - 10); set f1 = (f1 + 10);
SELECT f1;
END//
CALL sp88(-101);
-f1
-255
-Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP PROCEDURE IF EXISTS sp89;
CREATE PROCEDURE sp89( f1 enum('1enum', '2enum'))
BEGIN
@@ -18691,10 +18661,7 @@ CALL sp4(-9.22e+18, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute04();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-6744073709551616 6744073709551616 -9220000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f1@0 * 2)'
DROP PROCEDURE spexecute04;
DROP PROCEDURE sp4;
DROP PROCEDURE IF EXISTS sp6;
@@ -18807,22 +18774,7 @@ f7 f8 f9
-9220000000000000000 -9220000000000000000 NULL
f10 f11 f12
-9220000000000000000 -9220000000000000000 NULL
-f1 f2 f3
-18353255926290448384 18353255926290448384 18353255926290448384
-f4 f5 f6
--9220000000000000000 6744073709551616 6744073709551616
-f7 f8 f9
--9220000000000000000 6744073709551616 6744073709551616
-f10 f11 f12
--9220000000000000000 6744073709551616 6744073709551616
-var1 var2
-18353255926290448384 18353255926290448384
-var3 var4
-6744073709551616 6744073709551616
-var5 var6
-6744073709551616 6744073709551616
-var7 var8
-6744073709551616 6744073709551616
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 * 2)'
DROP PROCEDURE spexecute07;
DROP PROCEDURE sp07;
DROP PROCEDURE IF EXISTS sp8;
@@ -18873,10 +18825,7 @@ CALL sp8(1.84e+17, var1, var2, -9.22e+18, var3, var4,
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute08();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-00368000000000000000 00368000000000000000 00368000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-00368000000000000000 00368000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute08;
DROP PROCEDURE sp8;
DROP PROCEDURE IF EXISTS sp9;
@@ -18927,10 +18876,7 @@ CALL sp9(-9.22e+15, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute09();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-00000000000000000000 00000000000000000000 00000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-00000000000000000000 00000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP PROCEDURE spexecute09;
DROP PROCEDURE sp9;
DROP PROCEDURE IF EXISTS sp10;
@@ -18973,10 +18919,7 @@ CALL sp10(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute10();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute10;
DROP PROCEDURE sp10;
DROP PROCEDURE IF EXISTS sp11;
@@ -19008,10 +18951,7 @@ CALL sp11(--1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6,
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute11();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute11;
DROP PROCEDURE sp11;
DROP PROCEDURE IF EXISTS sp12;
@@ -19043,10 +18983,7 @@ CALL sp12(99999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6,
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute12();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute12;
DROP PROCEDURE sp12;
DROP PROCEDURE IF EXISTS sp13;
@@ -19078,10 +19015,7 @@ CALL sp13(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute13();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute13;
DROP PROCEDURE sp13;
DROP PROCEDURE IF EXISTS sp14;
@@ -19113,10 +19047,7 @@ CALL sp14(-1.00e+21, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute14();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000000000000000.000000000000000000000000000000 -1000000000000000000000.000000000000000000000000000000 -999999999999999999990.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000000000000000.000000000000000000000000000000 -999999999999999999990.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute14;
DROP PROCEDURE sp14;
DROP PROCEDURE IF EXISTS sp15;
@@ -19147,10 +19078,7 @@ CALL sp15(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute15();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute15;
DROP PROCEDURE sp15;
DROP PROCEDURE IF EXISTS sp16;
@@ -19181,10 +19109,7 @@ CALL sp16(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute16();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute16;
DROP PROCEDURE sp16;
DROP PROCEDURE IF EXISTS sp17;
@@ -19215,10 +19140,7 @@ CALL sp17(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute17();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute17;
DROP PROCEDURE sp17;
DROP PROCEDURE IF EXISTS sp18;
@@ -19249,10 +19171,7 @@ CALL sp18(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute18();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute18;
DROP PROCEDURE sp18;
DROP PROCEDURE IF EXISTS sp19;
@@ -19283,10 +19202,7 @@ CALL sp19(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute19();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute19;
DROP PROCEDURE sp19;
DROP PROCEDURE IF EXISTS sp20;
@@ -19317,10 +19233,7 @@ CALL sp20(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute20();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute20;
DROP PROCEDURE sp20;
DROP PROCEDURE IF EXISTS sp21;
@@ -19351,10 +19264,7 @@ CALL sp21(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute21();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute21;
DROP PROCEDURE sp21;
DROP PROCEDURE IF EXISTS sp22;
@@ -19385,10 +19295,7 @@ CALL sp22(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute22();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute22;
DROP PROCEDURE sp22;
DROP PROCEDURE IF EXISTS sp23;
@@ -19419,10 +19326,7 @@ CALL sp23(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6,
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute23();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute23;
DROP PROCEDURE sp23;
DROP PROCEDURE IF EXISTS sp24;
@@ -19453,10 +19357,7 @@ CALL sp24(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute24();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1.0999999999999996 1.0999999999999996 11.1 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1.0999999999999996 11.1 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute24;
DROP PROCEDURE sp24;
DROP PROCEDURE IF EXISTS sp25;
@@ -19487,10 +19388,7 @@ CALL sp25(-32701, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.2
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute25();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--32758 -32758 -32748 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--32758 -32748 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute25;
DROP PROCEDURE sp25;
DROP PROCEDURE IF EXISTS sp26;
@@ -19521,10 +19419,7 @@ CALL sp26( '1997-12-31', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute26();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1998-01-31 1998-01-31 1998-03-03 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1998-01-31 1998-03-03 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute26;
DROP PROCEDURE sp26;
DROP PROCEDURE IF EXISTS sp27;
@@ -19555,10 +19450,7 @@ CALL sp27( '23:59:59.999999', var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute27();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-25:59:59 25:59:59 27:59:59 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-25:59:59 27:59:59 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute27;
DROP PROCEDURE sp27;
DROP PROCEDURE IF EXISTS sp28;
@@ -19589,10 +19481,7 @@ CALL sp28('1997-12-31 23:59:59.999999', var1, var2, -9.22e+18, var3, var4, -9.22
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute28();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1998-01-02 01:01:00 1998-01-02 01:01:00 1998-01-03 02:02:01 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1998-01-02 01:01:00 1998-01-03 02:02:01 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute28;
DROP PROCEDURE sp28;
DROP PROCEDURE IF EXISTS sp29;
@@ -19623,10 +19512,7 @@ CALL sp29(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute29();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute29;
DROP PROCEDURE sp29;
DROP PROCEDURE IF EXISTS sp30;
@@ -19657,10 +19543,7 @@ CALL sp30(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute30();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute30;
DROP PROCEDURE sp30;
DROP PROCEDURE IF EXISTS sp31;
@@ -19691,10 +19574,7 @@ CALL sp31(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute31();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute31;
DROP PROCEDURE sp31;
DROP PROCEDURE IF EXISTS sp32;
@@ -19725,10 +19605,7 @@ CALL sp32(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute32();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute32;
DROP PROCEDURE sp32;
DROP PROCEDURE IF EXISTS sp33;
@@ -19759,10 +19636,7 @@ CALL sp33(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute33();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute33;
DROP PROCEDURE sp33;
DROP PROCEDURE IF EXISTS sp34;
@@ -19793,10 +19667,7 @@ CALL sp34(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute34();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute34;
DROP PROCEDURE sp34;
DROP PROCEDURE IF EXISTS sp35;
@@ -19827,10 +19698,7 @@ CALL sp35(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute35();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute35;
DROP PROCEDURE sp35;
DROP PROCEDURE IF EXISTS sp36;
@@ -19861,10 +19729,7 @@ CALL sp36(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute36();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute36;
DROP PROCEDURE sp36;
DROP PROCEDURE IF EXISTS sp37;
@@ -19895,10 +19760,7 @@ CALL sp37(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute37();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1 1 11 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1 11 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute37;
DROP PROCEDURE sp37;
DROP PROCEDURE IF EXISTS sp38;
@@ -19929,10 +19791,7 @@ CALL sp38(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute38();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute38;
DROP PROCEDURE sp38;
DROP PROCEDURE IF EXISTS sp39;
@@ -19963,10 +19822,7 @@ CALL sp39(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute39();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute39;
DROP PROCEDURE sp39;
DROP PROCEDURE IF EXISTS sp40;
@@ -19997,10 +19853,7 @@ CALL sp40(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute40();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute40;
DROP PROCEDURE sp40;
DROP PROCEDURE IF EXISTS sp41;
@@ -20031,10 +19884,7 @@ CALL sp41(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute41();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute41;
DROP PROCEDURE sp41;
DROP PROCEDURE IF EXISTS sp42;
@@ -20065,10 +19915,7 @@ CALL sp42(1.1, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute42();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute42;
DROP PROCEDURE sp42;
DROP PROCEDURE IF EXISTS sp43;
@@ -20099,10 +19946,7 @@ CALL sp43(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6,
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute43();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute43;
DROP PROCEDURE sp43;
DROP PROCEDURE IF EXISTS sp44;
@@ -20133,10 +19977,7 @@ CALL sp44(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6,
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute44();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute44;
DROP PROCEDURE sp44;
DROP PROCEDURE IF EXISTS sp45;
@@ -20167,10 +20008,7 @@ CALL sp45(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute45();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute45;
DROP PROCEDURE sp45;
DROP PROCEDURE IF EXISTS sp46;
@@ -20201,10 +20039,7 @@ CALL sp46(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6,
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute46();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--1000000000 -1000000000 -999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--1000000000 -999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute46;
DROP PROCEDURE sp46;
DROP PROCEDURE IF EXISTS sp47;
@@ -20235,10 +20070,7 @@ CALL sp47(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6,
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute47();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute47;
DROP PROCEDURE sp47;
DROP PROCEDURE IF EXISTS sp48;
@@ -20269,10 +20101,7 @@ CALL sp48(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute48();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute48;
DROP PROCEDURE sp48;
DROP PROCEDURE IF EXISTS sp49;
@@ -20303,10 +20132,7 @@ CALL sp49(-999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6,
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute49();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute49;
DROP PROCEDURE sp49;
DROP PROCEDURE IF EXISTS sp50;
@@ -20337,10 +20163,7 @@ CALL sp50(9999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6,
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute50();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-9999999999 9999999999 9999999999 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-9999999999 9999999999 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute50;
DROP PROCEDURE sp50;
DROP PROCEDURE IF EXISTS sp51;
@@ -20371,10 +20194,7 @@ CALL sp51(-99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute51();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute51;
DROP PROCEDURE sp51;
DROP PROCEDURE IF EXISTS sp52;
@@ -20405,10 +20225,7 @@ CALL sp52(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute52();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000.000000000000000000000000000000 -10000000000000000000000.000000000000000000000000000000 -99999999999999999990.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000.000000000000000000000000000000 -99999999999999999990.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute52;
DROP PROCEDURE sp52;
DROP PROCEDURE IF EXISTS sp53;
@@ -20439,10 +20256,7 @@ CALL sp53(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute53();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000 -10000000000000000000000 -99999999999999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000 -99999999999999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute53;
DROP PROCEDURE sp53;
DROP PROCEDURE IF EXISTS sp54;
@@ -20473,10 +20287,7 @@ CALL sp54(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute54();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000 10000000000000000000000 100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000 100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute54;
DROP PROCEDURE sp54;
DROP PROCEDURE IF EXISTS sp55;
@@ -20507,10 +20318,7 @@ CALL sp55(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute55();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute55;
DROP PROCEDURE sp55;
DROP PROCEDURE IF EXISTS sp56;
@@ -20847,10 +20655,7 @@ CALL sp65(999999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute65();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-1000000000 1000000000 1000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-1000000000 1000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute65;
DROP PROCEDURE sp65;
DROP PROCEDURE IF EXISTS sp66;
@@ -20881,10 +20686,7 @@ CALL sp66(1.00e+16, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute66();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10000000000000000.000000000000000000000000000000 10000000000000000.000000000000000000000000000000 10000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000.000000000000000000000000000000 10000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute66;
DROP PROCEDURE sp66;
DROP PROCEDURE IF EXISTS sp67;
@@ -20915,10 +20717,7 @@ CALL sp67(1.00e+16, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute67();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000010000000000000000.000000000000000000000000000000 000000000000000010000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute67;
DROP PROCEDURE sp67;
DROP PROCEDURE IF EXISTS sp68;
@@ -20949,10 +20748,7 @@ CALL sp68(-1.00e+21, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute68();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute68;
DROP PROCEDURE sp68;
DROP PROCEDURE IF EXISTS sp69;
@@ -20983,10 +20779,7 @@ CALL sp69(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute69();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--100000000000000000000 -10000000000000000000000 -99999999999999999990 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--10000000000000000000000 -99999999999999999990 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute69;
DROP PROCEDURE sp69;
DROP PROCEDURE IF EXISTS sp70;
@@ -21017,10 +20810,7 @@ CALL sp70(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute70();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000 10000000000000000000000 100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000 100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute70;
DROP PROCEDURE sp70;
DROP PROCEDURE IF EXISTS sp71;
@@ -21051,10 +20841,7 @@ CALL sp71(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute71();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000100000000000000000000 0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute71;
DROP PROCEDURE sp71;
DROP PROCEDURE IF EXISTS sp72;
@@ -21085,10 +20872,7 @@ CALL sp72(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute72();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute72;
DROP PROCEDURE sp72;
DROP PROCEDURE IF EXISTS sp73;
@@ -21119,10 +20903,7 @@ CALL sp73(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute73();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-10 10 20 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10 20 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute73;
DROP PROCEDURE sp73;
DROP PROCEDURE IF EXISTS sp74;
@@ -21153,10 +20934,7 @@ CALL sp74(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute74();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute74;
DROP PROCEDURE sp74;
DROP PROCEDURE IF EXISTS sp75;
@@ -21187,10 +20965,7 @@ CALL sp75(-1.00e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute75();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000010 0000000010 0000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000010 0000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute75;
DROP PROCEDURE sp75;
DROP PROCEDURE IF EXISTS sp76;
@@ -21221,10 +20996,7 @@ CALL sp76(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute76();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute76;
DROP PROCEDURE sp76;
DROP PROCEDURE IF EXISTS sp77;
@@ -21255,10 +21027,7 @@ CALL sp77(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute77();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute77;
DROP PROCEDURE sp77;
DROP PROCEDURE IF EXISTS sp78;
@@ -21289,10 +21058,7 @@ CALL sp78(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute78();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000010 000000000010 000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010 000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute78;
DROP PROCEDURE sp78;
DROP PROCEDURE IF EXISTS sp79;
@@ -21323,10 +21089,7 @@ CALL sp79(1.00e+00, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute79();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000010 0000000000000000000010 0000000000000000000020 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000010 0000000000000000000020 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute79;
DROP PROCEDURE sp79;
DROP PROCEDURE IF EXISTS sp80;
@@ -21357,10 +21120,7 @@ CALL sp80(-2.15e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute80();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--2147483638 -2147483638 -2147483628 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--2147483638 -2147483628 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute80;
DROP PROCEDURE sp80;
DROP PROCEDURE IF EXISTS sp81;
@@ -21391,10 +21151,7 @@ CALL sp81(4.29e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute81();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-4290000000 4290000000 4290000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-4290000000 4290000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute81;
DROP PROCEDURE sp81;
DROP PROCEDURE IF EXISTS sp82;
@@ -21425,10 +21182,7 @@ CALL sp82(4.29e+09, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute82();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-4290000000 4290000000 4290000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-4290000000 4290000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute82;
DROP PROCEDURE sp82;
DROP PROCEDURE IF EXISTS sp83;
@@ -21459,10 +21213,7 @@ CALL sp83(2.15e+08, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute83();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0215000000 0215000000 0215000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0215000000 0215000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute83;
DROP PROCEDURE sp83;
DROP PROCEDURE IF EXISTS sp84;
@@ -21493,10 +21244,7 @@ CALL sp84(-8388600, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute84();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--8388598 -8388598 -8388588 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--8388598 -8388588 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute84;
DROP PROCEDURE sp84;
DROP PROCEDURE IF EXISTS sp85;
@@ -21527,10 +21275,7 @@ CALL sp85(16777201, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute85();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777202 16777202 16777212 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777202 16777212 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute85;
DROP PROCEDURE sp85;
DROP PROCEDURE IF EXISTS sp86;
@@ -21561,10 +21306,7 @@ CALL sp86(16777210, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute86();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777210 16777210 16777215 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777210 16777215 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute86;
DROP PROCEDURE sp86;
DROP PROCEDURE IF EXISTS sp87;
@@ -21595,10 +21337,7 @@ CALL sp87(-8388601, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute87();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-16777215 16777215 16777215 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-16777215 16777215 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP PROCEDURE spexecute87;
DROP PROCEDURE sp87;
DROP PROCEDURE IF EXISTS sp88;
@@ -21629,10 +21368,7 @@ CALL sp88(99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute88();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0100000000 0100000000 0100000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0100000000 0100000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute88;
DROP PROCEDURE sp88;
DROP PROCEDURE IF EXISTS sp89;
@@ -21663,10 +21399,7 @@ CALL sp89(99999999, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute89();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0100000000 0100000000 0100000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0100000000 0100000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute89;
DROP PROCEDURE sp89;
DROP PROCEDURE IF EXISTS sp90;
@@ -21697,10 +21430,7 @@ CALL sp90(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute90();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-100000000000000000000.000000000000000000000000000000 10000000000000000000000.000000000000000000000000000000 100000000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-10000000000000000000000.000000000000000000000000000000 100000000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute90;
DROP PROCEDURE sp90;
DROP PROCEDURE IF EXISTS sp91;
@@ -21731,10 +21461,7 @@ CALL sp91(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute91();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000100000000000000000000.000000000000000000000000000000 000000000010000000000000000000000.000000000000000000000000000000 000000000000100000000000000000010.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000010000000000000000000000.000000000000000000000000000000 000000000000100000000000000000010.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute91;
DROP PROCEDURE sp91;
DROP PROCEDURE IF EXISTS sp92;
@@ -21765,10 +21492,7 @@ CALL sp92(-1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute92();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-000000000000000000000000000000010.000000000000000000000000000000 000000000000000000000000000000020.000000000000000000000000000000 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute92;
DROP PROCEDURE sp92;
DROP PROCEDURE IF EXISTS sp93;
@@ -21799,10 +21523,7 @@ CALL sp93(1.00e+20, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute93();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-0000000000000000000000000000000000000000000100000000000000000000 0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-0000000000000000000000000000000000000000010000000000000000000000 0000000000000000000000000000000000000000000100000000000000000010 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute93;
DROP PROCEDURE sp93;
DROP PROCEDURE IF EXISTS sp94;
@@ -21833,10 +21554,7 @@ CALL sp94(-32701, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.2
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute94();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--32702 -32702 -32692 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--32702 -32692 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute94;
DROP PROCEDURE sp94;
DROP PROCEDURE IF EXISTS sp95;
@@ -21867,10 +21585,7 @@ CALL sp95(65531, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute95();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65532 65532 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65532 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute95;
DROP PROCEDURE sp95;
DROP PROCEDURE IF EXISTS sp96;
@@ -21901,10 +21616,7 @@ CALL sp96(65531, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute96();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65532 65532 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65532 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute96;
DROP PROCEDURE sp96;
DROP PROCEDURE IF EXISTS sp97;
@@ -21935,10 +21647,7 @@ CALL sp97(-32601, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.2
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute97();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-65535 65535 65535 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-65535 65535 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP PROCEDURE spexecute97;
DROP PROCEDURE sp97;
DROP PROCEDURE IF EXISTS sp98;
@@ -21969,10 +21678,7 @@ CALL sp98(-115, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute98();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
--116 -116 -106 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
--116 -106 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute98;
DROP PROCEDURE sp98;
DROP PROCEDURE IF EXISTS sp99;
@@ -22003,10 +21709,7 @@ CALL sp99(251, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e+
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute99();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-252 252 255 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-252 255 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute99;
DROP PROCEDURE sp99;
DROP PROCEDURE IF EXISTS sp100;
@@ -22037,10 +21740,7 @@ CALL sp100(201, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22e
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute100();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-202 202 212 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-202 212 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT value is out of range in '(f5@4 * 2)'
DROP PROCEDURE spexecute100;
DROP PROCEDURE sp100;
DROP PROCEDURE IF EXISTS sp101;
@@ -22071,10 +21771,7 @@ CALL sp101(-101, var1, var2, -9.22e+18, var3, var4, -9.22e+18, var5, var6, -9.22
SELECT var1, var2, var3, var4, var5, var6, var7, var8;
END//
CALL spexecute101();
-f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
-255 255 255 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616 -9220000000000000000 6744073709551616 6744073709551616
-var1 var2 var3 var4 var5 var6 var7 var8
-255 255 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616 6744073709551616
+ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)'
DROP PROCEDURE spexecute101;
DROP PROCEDURE sp101;
USE db_storedproc;
diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test
index 749eccca793..755648036ac 100644
--- a/mysql-test/suite/perfschema/t/misc.test
+++ b/mysql-test/suite/perfschema/t/misc.test
@@ -18,6 +18,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
+--source include/not_var_link.inc
#
# Bug#45496 Performance schema: assertion fails in
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
index b4c4e538ea7..b54602663d8 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
@@ -290,12 +290,10 @@ a b
2 on slave
Heartbeat event received on master
Heartbeat event received on slave
-Slave has received more events than master (1 means 'yes'): 1
-
*** Clean up ***
include/stop_slave.inc
DROP TABLE t1;
include/stop_slave.inc
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
-End of 6.0 test
+End of tests
diff --git a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
index 5e758fc02f3..8f43425b201 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
@@ -206,3 +206,19 @@ Comparing tables master:test.t1 and slave:test.t1
TRUNCATE t1;
## check: contents of both tables master's and slave's
DROP TABLE t1;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE t1 ( c INT, PRIMARY KEY (c)) Engine=MyISAM;
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW SET @aux = -1 ;
+SET @aux = 10294947273192243200;
+SET @aux1= @aux;
+INSERT INTO t1 VALUES (@aux) , (@aux1);
+ERROR 23000: Duplicate entry '2147483647' for key 'PRIMARY'
+## assertion: master and slave tables are in sync
+Comparing tables master:test.t1 and slave:test.t1
+DROP TRIGGER tr1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
index 838938388db..1f8ce4c1d78 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
@@ -10,6 +10,12 @@
# * Circular replication
#############################################################
--source include/master-slave.inc
+#
+# The test runs long and does not have any specifics to
+# binlog_format. It is choosen therefore to run with MIXED mode
+# in order to not slow down much `make test'.
+#
+--source include/have_binlog_format_mixed.inc
--echo
--echo *** Preparing ***
@@ -462,6 +468,9 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
--connection slave
+# make sure IO thread has re-connected
+# due to slow valgrind env the following wait_for_status may time out
+--source include/wait_for_slave_io_to_start.inc
# Wait until slave_received_heartbeats will be incremented
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var= slave_received_heartbeats;
@@ -470,7 +479,7 @@ let $status_var_comparsion= >;
--echo Heartbeat event received
--echo
-# Circular replication
+# Circular replication: demonstrating bidirectional hearbeat flow
--echo *** Circular replication ***
# Configure circular replication
--source include/master-slave-reset.inc
@@ -499,15 +508,16 @@ SELECT * FROM t1 ORDER BY a;
let $master_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
--connection slave
SELECT * FROM t1 ORDER BY a;
-# Wait heartbeat event on master
+
+# Wait for heartbeat event on master
--connection master
let $status_var= slave_received_heartbeats;
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
--echo Heartbeat event received on master
-let $master_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
-# Wait heartbeat event on slave
+
+# Wait heartbeat events on slave
--connection slave
let $status_var= slave_received_heartbeats;
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -515,11 +525,6 @@ let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
--echo Heartbeat event received on slave
let $slave_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
-# Heartbeat period on slave less than on master therefore number of received events on slave
-# should be greater than on master
-let $result= query_get_value(SELECT ($slave_rcvd_heartbeats DIV $master_rcvd_heartbeats) > 1 AS Result, Result, 1);
---echo Slave has received more events than master (1 means 'yes'): $result
---echo
#
# Clean up and restore system variables
@@ -533,5 +538,5 @@ DROP TABLE t1;
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
--echo
-# End of 6.0 test
---echo End of 6.0 test
+# End of tests
+--echo End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
index c58acdcb084..05adc597776 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
@@ -139,3 +139,36 @@ TRUNCATE t1;
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
+
+#####################################################################
+#
+# BUG#51426
+#
+#####################################################################
+-- source include/master-slave-reset.inc
+-- connection master
+
+CREATE TABLE t1 ( c INT, PRIMARY KEY (c)) Engine=MyISAM;
+
+# offending trigger that would reset the unsigned flag for aux before
+# binlogging of User_var_log_event would take place.
+CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW SET @aux = -1 ;
+
+SET @aux = 10294947273192243200;
+SET @aux1= @aux;
+-- error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (@aux) , (@aux1);
+
+-- sync_slave_with_master
+
+-- echo ## assertion: master and slave tables are in sync
+-- let $diff_table_1=master:test.t1
+-- let $diff_table_2=slave:test.t1
+-- source include/diff_tables.inc
+
+--connection master
+DROP TRIGGER tr1;
+DROP TABLE t1;
+
+-- sync_slave_with_master
+
diff --git a/mysql-test/suite/rpl/t/rpl_sync-slave.opt b/mysql-test/suite/rpl/t/rpl_sync-slave.opt
index 77809a42c43..972f9ef8af9 100644
--- a/mysql-test/suite/rpl/t/rpl_sync-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_sync-slave.opt
@@ -1 +1 @@
---sync-relay-log-info=1 --relay-log-recovery=1
+--sync-relay-log-info=1 --relay-log-recovery=1 --innodb_file_format_check='ON'
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt
index 84d2a52b639..711ec42bd8a 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt
@@ -1 +1 @@
---default-collation=ucs2_unicode_ci --default-character-set=ucs2,latin1
+--collation-server=ucs2_unicode_ci --character-set-server=ucs2,latin1
diff --git a/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result b/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result
index 2d709c486dd..e6d9aff7141 100644
--- a/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result
+++ b/mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result
@@ -14,9 +14,9 @@ SET @@global.sql_slave_skip_counter = 2147483648*2;
Warnings:
Warning 1292 Truncated incorrect sql_slave_skip_counter value: '4294967296'
SET @@global.sql_slave_skip_counter = 2147483648*2-1;
-SET @@global.sql_slave_skip_counter = 4294967295*4294967295;
+SET @@global.sql_slave_skip_counter = 18446744065119617025;
Warnings:
-Warning 1292 Truncated incorrect sql_slave_skip_counter value: '-8589934591'
+Warning 1292 Truncated incorrect sql_slave_skip_counter value: '18446744065119617025'
'#--------------------FN_DYNVARS_165_03-------------------------#'
SET @@global.sql_slave_skip_counter = '5';
ERROR 42000: Incorrect argument type to variable 'sql_slave_skip_counter'
diff --git a/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test b/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test
index 86cb3824d07..10ca47133b7 100644
--- a/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test
+++ b/mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test
@@ -56,7 +56,7 @@ SET @@global.sql_slave_skip_counter = 1024;
SET @@global.sql_slave_skip_counter = 2147483648;
SET @@global.sql_slave_skip_counter = 2147483648*2;
SET @@global.sql_slave_skip_counter = 2147483648*2-1;
-SET @@global.sql_slave_skip_counter = 4294967295*4294967295;
+SET @@global.sql_slave_skip_counter = 18446744065119617025;
--echo '#--------------------FN_DYNVARS_165_03-------------------------#'
###################################################################
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index b999b1e8c1b..44af2f5ad3f 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -283,12 +283,20 @@ DROP TABLE t1;
#
# Bug #31236: Inconsistent division by zero behavior for floating point numbers
#
+# After the fix for bug #8433 we throw an error in the below test cases
+# rather than just return a NULL value.
+--error ER_DATA_OUT_OF_RANGE
SELECT 1e308 + 1e308;
+--error ER_DATA_OUT_OF_RANGE
SELECT -1e308 - 1e308;
+--error ER_DATA_OUT_OF_RANGE
SELECT 1e300 * 1e300;
+--error ER_DATA_OUT_OF_RANGE
SELECT 1e300 / 1e-300;
+--error ER_DATA_OUT_OF_RANGE
SELECT EXP(750);
+--error ER_DATA_OUT_OF_RANGE
SELECT POW(10, 309);
--echo #
@@ -314,10 +322,139 @@ DROP TABLE t1;
# DIV returns incorrect result with large decimal value
# Bug #46606:Casting error for large numbers in 5.4 when 'div' is used
---error ER_WARN_DATA_OUT_OF_RANGE
+--error ER_DATA_OUT_OF_RANGE
select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x;
---error ER_WARN_DATA_OUT_OF_RANGE
+--error ER_DATA_OUT_OF_RANGE
select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x;
SHOW WARNINGS;
--echo End of 5.1 tests
+
+--echo #
+--echo # Bug #8433: Overflow must be an error
+--echo #
+
+# Floating point overflows
+# ========================
+--error ER_DATA_OUT_OF_RANGE
+SELECT 1e308 + 1e308;
+--error ER_DATA_OUT_OF_RANGE
+SELECT -1e308 - 1e308;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 1e300 * 1e300;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 1e300 / 1e-300;
+--error ER_DATA_OUT_OF_RANGE
+SELECT EXP(750);
+--error ER_DATA_OUT_OF_RANGE
+SELECT POW(10, 309);
+--error ER_DATA_OUT_OF_RANGE
+SELECT COT(0);
+--error ER_DATA_OUT_OF_RANGE
+SELECT DEGREES(1e307);
+
+# Integer overflows
+# =================
+
+--error ER_DATA_OUT_OF_RANGE
+SELECT 9223372036854775808 + 9223372036854775808;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 18446744073709551615 + 1;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 1 + 18446744073709551615;
+--error ER_DATA_OUT_OF_RANGE
+SELECT -2 + CAST(1 AS UNSIGNED);
+--error ER_DATA_OUT_OF_RANGE
+SELECT CAST(1 AS UNSIGNED) + -2;
+--error ER_DATA_OUT_OF_RANGE
+SELECT -9223372036854775808 + -9223372036854775808;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 9223372036854775807 + 9223372036854775807;
+
+--error ER_DATA_OUT_OF_RANGE
+SELECT CAST(0 AS UNSIGNED) - 9223372036854775809;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 9223372036854775808 - 9223372036854775809;
+--error ER_DATA_OUT_OF_RANGE
+SELECT CAST(1 AS UNSIGNED) - 2;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 18446744073709551615 - (-1);
+--error ER_DATA_OUT_OF_RANGE
+SELECT -1 - 9223372036854775808;
+--error ER_DATA_OUT_OF_RANGE
+SELECT -1 - CAST(1 AS UNSIGNED);
+--error ER_DATA_OUT_OF_RANGE
+SELECT -9223372036854775808 - 1;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 9223372036854775807 - -9223372036854775808;
+
+# To test SIGNED overflow when subtraction arguments are both UNSIGNED
+set SQL_MODE='NO_UNSIGNED_SUBTRACTION';
+--error ER_DATA_OUT_OF_RANGE
+SELECT 18446744073709551615 - 1;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 18446744073709551615 - CAST(1 AS UNSIGNED);
+--error ER_DATA_OUT_OF_RANGE
+SELECT 18446744073709551614 - (-1);
+--error ER_DATA_OUT_OF_RANGE
+SELECT 9223372036854775807 - -1;
+set SQL_MODE=default;
+
+--error ER_DATA_OUT_OF_RANGE
+SELECT 4294967296 * 4294967296;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 9223372036854775808 * 2;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 9223372036854775808 * 2;
+# The following one triggers condition #3 from the comments in
+# Item_func_mul::int_op()
+--error ER_DATA_OUT_OF_RANGE
+SELECT 7158278827 * 3221225472;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 9223372036854775807 * (-2);
+--error ER_DATA_OUT_OF_RANGE
+SELECT CAST(1 as UNSIGNED) * (-1);
+--error ER_DATA_OUT_OF_RANGE
+SELECT 9223372036854775807 * 2;
+
+--error ER_DATA_OUT_OF_RANGE
+SELECT ABS(-9223372036854775808);
+
+--error ER_DATA_OUT_OF_RANGE
+SELECT -9223372036854775808 DIV -1;
+--error ER_DATA_OUT_OF_RANGE
+SELECT 18446744073709551615 DIV -1;
+
+
+# Have to create a table because the negation op may convert literals to DECIMAL
+CREATE TABLE t1(a BIGINT, b BIGINT UNSIGNED);
+INSERT INTO t1 VALUES(-9223372036854775808, 9223372036854775809);
+
+--error ER_DATA_OUT_OF_RANGE
+SELECT -a FROM t1;
+--error ER_DATA_OUT_OF_RANGE
+SELECT -b FROM t1;
+
+DROP TABLE t1;
+
+# Decimal overflows
+# =================
+
+SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+--error ER_DATA_OUT_OF_RANGE
+SELECT @a + @a;
+--error ER_DATA_OUT_OF_RANGE
+SELECT @a * @a;
+--error ER_DATA_OUT_OF_RANGE
+SELECT -@a - @a;
+--error ER_DATA_OUT_OF_RANGE
+SELECT @a / 0.5;
+
+# Non-overflow tests to improve code coverage
+# ===========================================
+SELECT COT(1/0);
+SELECT -1 + 9223372036854775808;
+SELECT 2 DIV -2;
+SELECT -(1 DIV 0);
+# Crashed the server with SIGFPE before the bugfix
+SELECT -9223372036854775808 MOD -1;
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 6590b43f2dc..43cc6de6649 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -22,7 +22,7 @@ select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_ut
# between two calls should be -1
set @a= uuid_short();
set @b= uuid_short();
-select cast(@a - @b as signed);
+select @b - @a;
#
# Test for core dump with nan
diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test
index 77bf3be5e72..f697e0b477a 100644
--- a/mysql-test/t/func_test.test
+++ b/mysql-test/t/func_test.test
@@ -24,7 +24,7 @@ select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
select 1 like 2 xor 2 like 1;
select 10 % 7, 10 mod 7, 10 div 3;
explain extended select 10 % 7, 10 mod 7, 10 div 3;
-select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
+select 18446744073709551615, 18446744073709551615 DIV 1, 18446744073709551615 DIV 2;
explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
create table t1 (a int);
diff --git a/mysql-test/t/mdl_sync.test b/mysql-test/t/mdl_sync.test
index b9a9241ce32..ef434e33cfa 100644
--- a/mysql-test/t/mdl_sync.test
+++ b/mysql-test/t/mdl_sync.test
@@ -2277,17 +2277,32 @@ let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Table lock" and info = "insert into t2 values (1)";
--source include/wait_condition.inc
---echo # The below statement should not cause deadlock.
-alter table t1 drop column j;
-unlock tables;
+--echo # Sending 'alter table t1 drop column j'. It should not cause
+--echo # deadlock.
+send alter table t1 drop column j;
+--echo # Switching to connection 'handler_con2'.
+connection handler_con2;
+--echo # Wait until ALTER is blocked during upgrade.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table" and info = "alter table t1 drop column j";
+--source include/wait_condition.inc
--echo #
--echo # Switching to connection 'default'.
connection default;
--echo # Reap INSERT.
+--error ER_LOCK_ABORTED
--reap
handler t1 close;
-
--echo #
+--echo # Switching to connection 'handler_con1'.
+connection handler_con1;
+--echo # Reaping 'alter table t1 drop column j'
+--reap
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+
--echo # Then, check the scenario in which upgrade of SNRW lock to X
--echo # lock is blocked by HANDLER which is open in connection currently
--echo # waiting to get SW lock on the same table.
@@ -3220,6 +3235,8 @@ disconnect con2;
--echo # failed in open_ltable()
--echo #
+--echo # Supress warnings written to the log file
+call mtr.add_suppression("Wait on a lock was aborted due to a pending exclusive lock");
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
@@ -3279,16 +3296,10 @@ let $wait_condition=
# since the latter waits on a table-level lock while having a HANDLER
# open. This will cause mysql_lock_tables() in con1 fail which before
# triggered the assert.
---echo # Sending:
---send ALTER TABLE t1 ADD COLUMN j INT
+ALTER TABLE t1 ADD COLUMN j INT;
--echo # connection: default
connection default;
-let $wait_condition=
- SELECT COUNT(*) = 1 FROM information_schema.processlist
- WHERE state = "Waiting for table"
- AND info = "ALTER TABLE t1 ADD COLUMN j INT";
---source include/wait_condition.inc
SET DEBUG_SYNC= 'now SIGNAL go';
--echo # connection: con1
@@ -3302,11 +3313,6 @@ connection con2;
--echo # Reaping SELECT 1
--reap
---echo # connection: con3
-connection con3;
---echo # Reaping ALTER TABLE t1 ADD COLUMN j INT
---reap
-
--echo # connection: default
connection default;
DROP TABLE t1, t2;
diff --git a/mysql-test/t/partition_column.test b/mysql-test/t/partition_column.test
index a0e944ceb09..d1d2d666a39 100644
--- a/mysql-test/t/partition_column.test
+++ b/mysql-test/t/partition_column.test
@@ -9,6 +9,59 @@ drop table if exists t1;
--enable_warnings
#
+# Bug#51347: assertion with show create table + partition by columns
+# on decimal column
+#
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (a DECIMAL)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN (0));
+
+--error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
+CREATE TABLE t1 (a BLOB)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN ("X"));
+
+--error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
+CREATE TABLE t1 (a TEXT)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN ("X"));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (a FLOAT)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN (0.0));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (a DOUBLE)
+PARTITION BY RANGE COLUMNS (a)
+(PARTITION p0 VALUES LESS THAN (0.0));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (d TIMESTAMP)
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN ('2000-01-01'),
+ PARTITION p1 VALUES LESS THAN ('2040-01-01'));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (d BIT(1))
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN (0),
+ PARTITION p1 VALUES LESS THAN (1));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (d ENUM("YES","NO"))
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN ("NO"),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (d SET("Car","MC"))
+PARTITION BY RANGE COLUMNS(d)
+(PARTITION p0 VALUES LESS THAN ("MC"),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+
+#
# BUG#49180, Possible to define empty intervals for column list partitioning
#
--error ER_RANGE_NOT_INCREASING_ERROR
@@ -285,18 +338,6 @@ partition by range columns(d)
( partition p0 values less than ('2000-01-01'),
partition p1 values less than ('2040-01-01'));
---error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
-create table t1 (d timestamp)
-partition by range columns(d)
-( partition p0 values less than ('2000-01-01'),
- partition p1 values less than ('2040-01-01'));
-
---error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
-create table t1 (d bit(1))
-partition by range columns(d)
-( partition p0 values less than (0),
- partition p1 values less than (1));
-
create table t1 (a int, b int)
partition by range columns(a,b)
(partition p0 values less than (maxvalue, 10));
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 80a714882be..1e53461f665 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1989,7 +1989,7 @@ DROP TABLE t1;
#
create table t1 (a int(11) unsigned, b int(11) unsigned);
-insert into t1 values (1,0), (1,1), (1,2);
+insert into t1 values (1,0), (1,1), (18446744073709551615,0);
select a-b from t1 order by 1;
select a-b , (a-b < 0) from t1 order by 1;
select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0;
@@ -2910,6 +2910,7 @@ DROP TABLE t1,t2;
# cases to prevent fixing this accidently. It is intended behaviour)
#
+SET SQL_MODE='NO_UNSIGNED_SUBTRACTION';
CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL);
INSERT t1 SET i = 0;
UPDATE t1 SET i = -1;
@@ -2919,6 +2920,7 @@ SELECT * FROM t1;
UPDATE t1 SET i = i - 1;
SELECT * FROM t1;
DROP TABLE t1;
+SET SQL_MODE=default;
# BUG#17379
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index b4727ad3df7..310803531d9 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -7076,11 +7076,14 @@ select bug20777(9223372036854775807) as '9223372036854775807 2**63-1';
select bug20777(9223372036854775808) as '9223372036854775808 2**63+0';
select bug20777(9223372036854775809) as '9223372036854775809 2**63+1';
select bug20777(9223372036854775810) as '9223372036854775810 2**63+2';
+--error ER_DATA_OUT_OF_RANGE
select bug20777(-9223372036854775808) as 'lower bounds signed bigint';
select bug20777(9223372036854775807) as 'upper bounds signed bigint';
+--error ER_DATA_OUT_OF_RANGE
select bug20777(0) as 'lower bounds unsigned bigint';
select bug20777(18446744073709551615) as 'upper bounds unsigned bigint';
select bug20777(18446744073709551616) as 'upper bounds unsigned bigint + 1';
+--error ER_DATA_OUT_OF_RANGE
select bug20777(-1) as 'lower bounds unsigned bigint - 1';
create table examplebug20777 as select
@@ -7091,10 +7094,8 @@ create table examplebug20777 as select
bug20777(9223372036854775809) as '2**63+1',
bug20777(18446744073709551614) as '2**64-2',
bug20777(18446744073709551615) as '2**64-1',
- bug20777(18446744073709551616) as '2**64',
- bug20777(0) as '0',
- bug20777(-1) as '-1';
-insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1);
+ bug20777(18446744073709551616) as '2**64';
+insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616);
show create table examplebug20777;
select * from examplebug20777 order by i;
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index d1e136bf5fa..0dd324d5df2 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -822,6 +822,7 @@ INSERT INTO t1 (col2) VALUES (-1.1E-3);
INSERT INTO t1 (col1) VALUES ('+1.8E+309');
--error 1264
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
+--error ER_DATA_OUT_OF_RANGE
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
--error 1365
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
diff --git a/mysql-test/t/system_mysql_db_fix30020.test b/mysql-test/t/system_mysql_db_fix30020.test
deleted file mode 100644
index 0a7d9dad7c9..00000000000
--- a/mysql-test/t/system_mysql_db_fix30020.test
+++ /dev/null
@@ -1,108 +0,0 @@
-# Embedded server doesn't support external clients
---source include/not_embedded.inc
-
-# Don't run this test if $MYSQL_FIX_SYSTEM_TABLES isn't set
-# to the location of mysql_fix_privilege_tables.sql
-if (`SELECT LENGTH("$MYSQL_FIX_SYSTEM_TABLES") <= 0`)
-{
- skip Test need MYSQL_FIX_SYSTEM_TABLES;
-}
-# check that CSV engine was compiled in, as the test relies on the presence
-# of the log tables (which are CSV-based)
---source include/have_csv.inc
-
-#
-# This is the test for mysql_fix_privilege_tables
-# It checks that a system tables from mysql 3.20
-# can be upgraded to current system table format
-#
-# Note: If this test fails, don't be confused about the errors reported
-# by mysql-test-run This shows warnings generated by
-# mysql_fix_system_tables which should be ignored.
-# Instead, concentrate on the errors in r/system_mysql_db.reject
-
--- disable_result_log
--- disable_query_log
-
-use test;
-
-# create system tables as in mysql-3.20
-
---disable_warnings
-CREATE TABLE db (
- Host char(60) binary DEFAULT '' NOT NULL,
- Db char(32) binary DEFAULT '' NOT NULL,
- User char(16) binary DEFAULT '' NOT NULL,
- Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- PRIMARY KEY Host (Host,Db,User),
- KEY User (User)
-)
-engine=MyISAM;
---enable_warnings
-
-INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
-INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
-
---disable_warnings
-CREATE TABLE host (
- Host char(60) binary DEFAULT '' NOT NULL,
- Db char(32) binary DEFAULT '' NOT NULL,
- Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- PRIMARY KEY Host (Host,Db)
-)
-engine=MyISAM;
---enable_warnings
-
---disable_warnings
-CREATE TABLE user (
- Host char(60) binary DEFAULT '' NOT NULL,
- User char(16) binary DEFAULT '' NOT NULL,
- Password char(16),
- Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- PRIMARY KEY Host (Host,User)
-)
-engine=MyISAM;
---enable_warnings
-
-INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
-INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
-
-# Call the "shell script" $MYSQL_FIX_SYSTEM_TABLES using system
--- system $MYSQL_FIX_SYSTEM_TABLES --database=test > $MYSQLTEST_VARDIR/log/system_mysql_db_fix30020.log 2>&1
--- enable_query_log
--- enable_result_log
-
--- source include/system_db_struct.inc
-
--- disable_query_log
-
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv,
-procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc,
-time_zone, time_zone_leap_second, time_zone_name, time_zone_transition,
-time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index;
-
--- enable_query_log
-
-# check that we dropped all system tables
-show tables;
-
-exit;
-# End of 4.1 tests
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 8af9d4c263e..3f418a339cc 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1090,6 +1090,7 @@ create table t1 (c1 decimal(64));
--disable_ps_protocol
insert into t1 values(
89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
+--error ER_DATA_OUT_OF_RANGE
insert into t1 values(
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 *
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index 26dfb243897..ad0f5652b1c 100755
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -65,7 +65,7 @@ ADD_CUSTOM_TARGET(GenFixPrivs
IF(UNIX)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
- "cd ${CMAKE_BINARY_DIR} && ${CMAKE_CPACK_COMMAND} -G TGZ --config CPackConfig.cmake" )
+ "cd ${CMAKE_BINARY_DIR} && '${CMAKE_CPACK_COMMAND}' -G TGZ --config CPackConfig.cmake" )
EXECUTE_PROCESS(
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
)
@@ -261,7 +261,8 @@ IF(WIN32)
SET(PLIN_FILES mysql_config mysql_secure_installation)
# Input files with .sh extension
- SET(SH_FILES mysql_convert_table_format mysqld_multi)
+ SET(SH_FILES mysql_convert_table_format mysqld_multi mysqldumpslow
+ mysqlhotcopy)
FOREACH(file ${PLIN_FILES})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 118c312d218..9179995e814 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -23,7 +23,6 @@ EXTRA_PROGRAMS = comp_sql
bin_SCRIPTS = @server_scripts@ \
msql2mysql \
mysql_config \
- mysql_fix_privilege_tables \
mysql_fix_extensions \
mysql_setpermission \
mysql_secure_installation \
@@ -45,7 +44,6 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \
msql2mysql.sh \
mysql_config.sh \
mysql_config.pl.in \
- mysql_fix_privilege_tables.sh \
mysql_fix_extensions.sh \
mysql_install_db.sh \
mysql_install_db.pl.in \
@@ -82,7 +80,6 @@ CLEANFILES = @server_scripts@ \
make_sharedlib_distribution \
msql2mysql \
mysql_config \
- mysql_fix_privilege_tables \
mysql_fix_extensions \
mysql_setpermission \
mysql_secure_installation \
diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist
index 51271a3dad0..e54a14cc66e 100755
--- a/scripts/make_win_bin_dist
+++ b/scripts/make_win_bin_dist
@@ -158,7 +158,6 @@ cp tests/$TARGET/*.exe $DESTDIR/bin/
cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/
cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe
-cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map
if [ x"$TARGET" != x"release" ] ; then
cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb
fi
@@ -167,7 +166,6 @@ if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/mysqld.exe" -o \
x"$PACK_DEBUG" = x"yes" ] ; then
cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe
cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb
- cp sql/debug/mysqld.map $DESTDIR/bin/mysqld-debug.map
fi
# ----------------------------------------------------------------------
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
deleted file mode 100644
index dd5edb699a0..00000000000
--- a/scripts/mysql_fix_privilege_tables.sh
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2000-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# This script is a wrapper to pipe the mysql_fix_privilege_tables.sql
-# through the mysql client program to the mysqld server
-
-# Default values (Can be changed in my.cnf)
-password=""
-host="localhost"
-user="root"
-sql_only=0
-basedir="@prefix@"
-verbose=0
-args=""
-# no elaborate fallback here; with no argument, it will happen in "mysql"
-port=""
-socket=""
-database="mysql"
-bindir=""
-pkgdatadir="@pkgdatadir@"
-print_defaults_bindir="."
-
-file=mysql_fix_privilege_tables.sql
-
-# The following test is to make this script compatible with the 4.0 where
-# the single argument could be a password
-if test "$#" = 1
-then
- case "$1" in
- --*) ;;
- *) old_style_password="$1" ; shift ;;
- esac
-fi
-
-# The following code is almost identical to the code in mysql_install_db.sh
-
-case "$1" in
- --no-defaults|--defaults-file=*|--defaults-extra-file=*)
- defaults="$1"; shift
- ;;
-esac
-
-parse_arguments() {
- # We only need to pass arguments through to the server if we don't
- # handle them here. So, we collect unrecognized options (passed on
- # the command line) into the args variable.
- pick_args=
- if test "$1" = PICK-ARGS-FROM-ARGV
- then
- pick_args=1
- shift
- fi
-
- for arg do
- case "$arg" in
- --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --password=*) password=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --host=*) host=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --sql|--sql-only) sql_only=1 ;;
- --verbose) verbose=1 ;;
- --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
- --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
- --database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;;
- --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"`
- print_defaults_bindir=$bindir
- ;;
- *)
- if test -n "$pick_args"
- then
- # This sed command makes sure that any special chars are quoted,
- # so the arg gets passed exactly to the server.
- args="$args "`echo "$arg" | sed -e 's,\([^=a-zA-Z0-9_.-]\),\\\\\1,g'`
- fi
- ;;
- esac
- done
-}
-
-# Get first arguments from the my.cfg file, groups [mysqld] and
-# [mysql_install_db], and then merge with the command line arguments
-
-print_defaults=my_print_defaults
-for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra
-do
- if test -x $dir/my_print_defaults
- then
- print_defaults="$dir/my_print_defaults"
- break
- fi
-done
-
-parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables`
-parse_arguments PICK-ARGS-FROM-ARGV "$@"
-
-if test -z "$password"
-then
- password=$old_style_password
-fi
-
-# Find where 'mysql' command is located
-
-dirname=`dirname "$0"`
-
-if test -z "$bindir"
-then
- for i in @bindir@ $basedir/bin "$dirname/../client"
- do
- if test -f $i/mysql
- then
- bindir=$i
- break
- fi
- done
-fi
-
-if test -z "$bindir"
-then
- echo "Could not find MySQL command-line client (mysql)."
- echo "Please use --basedir to specify the directory where MySQL is installed."
- exit 1
-fi
-
-cmd="$bindir/mysql --no-defaults --default-character-set=latin1 --force --user=$user --host=$host"
-if test ! -z "$port"; then
- cmd="$cmd --port=$port"
-fi
-if test ! -z "$socket"; then
- cmd="$cmd --socket=$socket"
-fi
-cmd="$cmd --database=$database"
-
-if test $sql_only = 1
-then
- cmd="cat"
-fi
-
-# Find where first mysql_fix_privilege_tables.sql is located
-for i in $basedir/support-files $basedir/share $basedir/share/mysql \
- $basedir/scripts $pkgdatadir . "$dirname"
-do
- if test -f $i/$file
- then
- pkgdatadir=$i
- break
- fi
-done
-
-sql_file="$pkgdatadir/$file"
-if test ! -f $sql_file
-then
- echo "Could not find file '$file'."
- echo "Please use --basedir to specify the directory where MySQL is installed"
- exit 1
-fi
-
-s_echo()
-{
- if test $sql_only = 0
- then
- echo $1
- fi
-}
-
-s_echo "This script updates all the mysql privilege tables to be usable by"
-s_echo "the current version of MySQL"
-s_echo ""
-
-if test $verbose = 1
-then
- s_echo "You can safely ignore all 'Duplicate column' and 'Unknown column' errors"
- s_echo "because these just mean that your tables are already up to date."
- s_echo "This script is safe to run even if your tables are already up to date!"
- s_echo ""
-fi
-
-run_cmd() {
- # Password argument is added here to allow for spaces in password.
-
- if test ! -z "$password"
- then
- cat $sql_file | $cmd --password="$password"
- else
- cat $sql_file | $cmd
- fi
-}
-
-if test $verbose = 0
-then
- run_cmd > /dev/null 2>&1
-else
- run_cmd > /dev/null
-fi
-if test $? = 0
-then
- s_echo "done"
-else
- s_echo "Got a failure from command:"
- s_echo "cat $sql_file | $cmd"
- s_echo "Please check the above output and try again."
- if test $verbose = 0
- then
- s_echo ""
- s_echo "Running the script with the --verbose option may give you some information"
- s_echo "of what went wrong."
- fi
- s_echo ""
- s_echo "If you get an 'Access denied' error, you should run this script again and"
- s_echo "give the MySQL root user password as an argument with the --password= option"
-fi
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index 8551e4cd6c9..6ddb9ef4c9c 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -5,10 +5,6 @@
# because these just mean that your tables are already up to date.
# This script is safe to run even if your tables are already up to date!
-# On unix, you should use the mysql_fix_privilege_tables script to execute
-# this sql script.
-# On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
-
set sql_mode='';
set storage_engine=MyISAM;
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index a4ce5f9575b..5420ebd908e 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -699,7 +699,7 @@ fi
cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"
-plugin_dir="${PLUGIN_DIR:-@PLUGINDIR@}${PLUGIN_VARIANT}"
+plugin_dir="${PLUGIN_DIR:-@pkgplugindir@}${PLUGIN_VARIANT}"
for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \
"--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION"
diff --git a/sql/events.cc b/sql/events.cc
index d8bf549321e..a2375b1274b 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysql_priv.h"
#include "events.h"
@@ -367,15 +367,14 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
{
sql_print_error("Event Error: An error occurred while creating query string, "
"before writing it into binary log.");
- /* Restore the state of binlog format */
- DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row());
- if (save_binlog_row_based)
- thd->set_current_stmt_binlog_format_row();
- DBUG_RETURN(TRUE);
+ ret= TRUE;
+ }
+ else
+ {
+ /* If the definer is not set or set to CURRENT_USER, the value of CURRENT_USER
+ will be written into the binary log as the definer for the SQL thread. */
+ ret= write_bin_log(thd, TRUE, log_query.c_ptr(), log_query.length());
}
- /* If the definer is not set or set to CURRENT_USER, the value of CURRENT_USER
- will be written into the binary log as the definer for the SQL thread. */
- ret= write_bin_log(thd, TRUE, log_query.c_ptr(), log_query.length());
}
}
mysql_mutex_unlock(&LOCK_event_metadata);
@@ -1017,7 +1016,11 @@ Events::dump_internal_status()
puts("LLA = Last Locked At LUA = Last Unlocked At");
puts("WOC = Waiting On Condition DL = Data Locked");
- mysql_mutex_lock(&LOCK_event_metadata);
+ /*
+ opt_event_scheduler should only be accessed while
+ holding LOCK_global_system_variables.
+ */
+ mysql_mutex_lock(&LOCK_global_system_variables);
if (opt_event_scheduler == EVENTS_DISABLED)
puts("The Event Scheduler is disabled");
else
@@ -1026,7 +1029,7 @@ Events::dump_internal_status()
event_queue->dump_internal_status();
}
- mysql_mutex_unlock(&LOCK_event_metadata);
+ mysql_mutex_unlock(&LOCK_global_system_variables);
DBUG_VOID_RETURN;
}
diff --git a/sql/events.h b/sql/events.h
index 881ade37cbf..380b0d97f0a 100644
--- a/sql/events.h
+++ b/sql/events.h
@@ -1,6 +1,6 @@
#ifndef _EVENT_H_
#define _EVENT_H_
-/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@defgroup Event_Scheduler Event Scheduler
@@ -83,6 +83,7 @@ public:
See sys_var.cc
*/
enum enum_opt_event_scheduler { EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED };
+ /* Protected using LOCK_global_system_variables only. */
static uint opt_event_scheduler;
static mysql_mutex_t LOCK_event_metadata;
static bool check_if_system_tables_error();
@@ -107,9 +108,6 @@ public:
destroy_mutexes();
static bool
- switch_event_scheduler_state(enum enum_opt_event_scheduler new_state);
-
- static bool
create_event(THD *thd, Event_parse_data *parse_data, bool if_exists);
static bool
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 279d5b4c242..7097c0a1a46 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -2346,7 +2346,6 @@ static int open_ndb_binlog_index(THD *thd, TABLE **ndb_binlog_index)
thd->proc_info= "Opening " NDB_REP_DB "." NDB_REP_TABLE;
tables->required_type= FRMTYPE_TABLE;
- uint counter;
thd->clear_error();
if (open_and_lock_tables(thd, tables, FALSE, 0))
{
@@ -2374,7 +2373,6 @@ int ndb_add_ndb_binlog_index(THD *thd, void *_row)
{
ndb_binlog_index_row &row= *(ndb_binlog_index_row *) _row;
int error= 0;
- bool need_reopen;
/*
Turn of binlogging to prevent the table changes to be written to
the binary log.
diff --git a/sql/item_create.cc b/sql/item_create.cc
index a393c886483..5277e2c7b1d 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -2946,9 +2946,7 @@ Create_func_cot Create_func_cot::s_singleton;
Item*
Create_func_cot::create(THD *thd, Item *arg1)
{
- Item *i1= new (thd->mem_root) Item_int((char*) "1", 1, 1);
- Item *i2= new (thd->mem_root) Item_func_tan(arg1);
- return new (thd->mem_root) Item_func_div(i1, i2);
+ return new (thd->mem_root) Item_func_cot(arg1);
}
diff --git a/sql/item_func.cc b/sql/item_func.cc
index ca8f5d00bb1..1616acff942 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -65,6 +65,14 @@ eval_const_cond(COND *cond)
}
+/**
+ Test if the sum of arguments overflows the ulonglong range.
+*/
+static inline bool test_if_sum_overflows_ull(ulonglong arg1, ulonglong arg2)
+{
+ return ULONGLONG_MAX - arg1 < arg2;
+}
+
void Item_func::set_arguments(List<Item> &list)
{
allowed_arg_cols= 1;
@@ -1094,16 +1102,68 @@ double Item_func_plus::real_op()
double value= args[0]->val_real() + args[1]->val_real();
if ((null_value=args[0]->null_value || args[1]->null_value))
return 0.0;
- return fix_result(value);
+ return check_float_overflow(value);
}
longlong Item_func_plus::int_op()
{
- longlong value=args[0]->val_int()+args[1]->val_int();
- if ((null_value=args[0]->null_value || args[1]->null_value))
+ longlong val0= args[0]->val_int();
+ longlong val1= args[1]->val_int();
+ longlong res= val0 + val1;
+ bool res_unsigned= FALSE;
+
+ if ((null_value= args[0]->null_value || args[1]->null_value))
return 0;
- return value;
+
+ /*
+ First check whether the result can be represented as a
+ (bool unsigned_flag, longlong value) pair, then check if it is compatible
+ with this Item's unsigned_flag by calling check_integer_overflow().
+ */
+ if (args[0]->unsigned_flag)
+ {
+ if (args[1]->unsigned_flag || val1 >= 0)
+ {
+ if (test_if_sum_overflows_ull((ulonglong) val0, (ulonglong) val1))
+ goto err;
+ res_unsigned= TRUE;
+ }
+ else
+ {
+ /* val1 is negative */
+ if ((ulonglong) val0 > (ulonglong) LONGLONG_MAX)
+ res_unsigned= TRUE;
+ }
+ }
+ else
+ {
+ if (args[1]->unsigned_flag)
+ {
+ if (val0 >= 0)
+ {
+ if (test_if_sum_overflows_ull((ulonglong) val0, (ulonglong) val1))
+ goto err;
+ res_unsigned= TRUE;
+ }
+ else
+ {
+ if ((ulonglong) val1 > (ulonglong) LONGLONG_MAX)
+ res_unsigned= TRUE;
+ }
+ }
+ else
+ {
+ if (val0 >=0 && val1 >= 0)
+ res_unsigned= TRUE;
+ else if (val0 < 0 && val1 < 0 && res >= 0)
+ goto err;
+ }
+ }
+ return check_integer_overflow(res, res_unsigned);
+
+err:
+ return raise_integer_overflow();
}
@@ -1127,8 +1187,10 @@ my_decimal *Item_func_plus::decimal_op(my_decimal *decimal_value)
return 0;
val2= args[1]->val_decimal(&value2);
if (!(null_value= (args[1]->null_value ||
- (my_decimal_add(E_DEC_FATAL_ERROR, decimal_value, val1,
- val2) > 3))))
+ check_decimal_overflow(my_decimal_add(E_DEC_FATAL_ERROR &
+ ~E_DEC_OVERFLOW,
+ decimal_value,
+ val1, val2)) > 3)))
return decimal_value;
return 0;
}
@@ -1172,16 +1234,71 @@ double Item_func_minus::real_op()
double value= args[0]->val_real() - args[1]->val_real();
if ((null_value=args[0]->null_value || args[1]->null_value))
return 0.0;
- return fix_result(value);
+ return check_float_overflow(value);
}
longlong Item_func_minus::int_op()
{
- longlong value=args[0]->val_int() - args[1]->val_int();
- if ((null_value=args[0]->null_value || args[1]->null_value))
+ longlong val0= args[0]->val_int();
+ longlong val1= args[1]->val_int();
+ longlong res= val0 - val1;
+ bool res_unsigned= FALSE;
+
+ if ((null_value= args[0]->null_value || args[1]->null_value))
return 0;
- return value;
+
+ /*
+ First check whether the result can be represented as a
+ (bool unsigned_flag, longlong value) pair, then check if it is compatible
+ with this Item's unsigned_flag by calling check_integer_overflow().
+ */
+ if (args[0]->unsigned_flag)
+ {
+ if (args[1]->unsigned_flag)
+ {
+ if ((ulonglong) val0 < (ulonglong) val1)
+ {
+ if (res >= 0)
+ goto err;
+ }
+ else
+ res_unsigned= TRUE;
+ }
+ else
+ {
+ if (val1 >= 0)
+ {
+ if ((ulonglong) val0 > (ulonglong) val1)
+ res_unsigned= TRUE;
+ }
+ else
+ {
+ if (test_if_sum_overflows_ull((ulonglong) val0, (ulonglong) -val1))
+ goto err;
+ res_unsigned= TRUE;
+ }
+ }
+ }
+ else
+ {
+ if (args[1]->unsigned_flag)
+ {
+ if ((ulonglong) (val0 - LONGLONG_MIN) < (ulonglong) val1)
+ goto err;
+ }
+ else
+ {
+ if (val0 > 0 && val1 < 0)
+ res_unsigned= TRUE;
+ else if (val0 < 0 && val1 > 0 && res >= 0)
+ goto err;
+ }
+ }
+ return check_integer_overflow(res, res_unsigned);
+
+err:
+ return raise_integer_overflow();
}
@@ -1199,8 +1316,10 @@ my_decimal *Item_func_minus::decimal_op(my_decimal *decimal_value)
return 0;
val2= args[1]->val_decimal(&value2);
if (!(null_value= (args[1]->null_value ||
- (my_decimal_sub(E_DEC_FATAL_ERROR, decimal_value, val1,
- val2) > 3))))
+ (check_decimal_overflow(my_decimal_sub(E_DEC_FATAL_ERROR &
+ ~E_DEC_OVERFLOW,
+ decimal_value, val1,
+ val2)) > 3))))
return decimal_value;
return 0;
}
@@ -1212,17 +1331,86 @@ double Item_func_mul::real_op()
double value= args[0]->val_real() * args[1]->val_real();
if ((null_value=args[0]->null_value || args[1]->null_value))
return 0.0;
- return fix_result(value);
+ return check_float_overflow(value);
}
longlong Item_func_mul::int_op()
{
DBUG_ASSERT(fixed == 1);
- longlong value=args[0]->val_int()*args[1]->val_int();
- if ((null_value=args[0]->null_value || args[1]->null_value))
+ longlong a= args[0]->val_int();
+ longlong b= args[1]->val_int();
+ longlong res;
+ ulonglong res0, res1;
+ ulong a0, a1, b0, b1;
+ bool res_unsigned= FALSE;
+ bool a_negative= FALSE, b_negative= FALSE;
+
+ if ((null_value= args[0]->null_value || args[1]->null_value))
return 0;
- return value;
+
+ /*
+ First check whether the result can be represented as a
+ (bool unsigned_flag, longlong value) pair, then check if it is compatible
+ with this Item's unsigned_flag by calling check_integer_overflow().
+
+ Let a = a1 * 2^32 + a0 and b = b1 * 2^32 + b0. Then
+ a * b = (a1 * 2^32 + a0) * (b1 * 2^32 + b0) = a1 * b1 * 2^64 +
+ + (a1 * b0 + a0 * b1) * 2^32 + a0 * b0;
+ We can determine if the above sum overflows the ulonglong range by
+ sequentially checking the following conditions:
+ 1. If both a1 and b1 are non-zero.
+ 2. Otherwise, if (a1 * b0 + a0 * b1) is greater than ULONG_MAX.
+ 3. Otherwise, if (a1 * b0 + a0 * b1) * 2^32 + a0 * b0 is greater than
+ ULONGLONG_MAX.
+
+ Since we also have to take the unsigned_flag for a and b into account,
+ it is easier to first work with absolute values and set the
+ correct sign later.
+ */
+ if (!args[0]->unsigned_flag && a < 0)
+ {
+ a_negative= TRUE;
+ a= -a;
+ }
+ if (!args[1]->unsigned_flag && b < 0)
+ {
+ b_negative= TRUE;
+ b= -b;
+ }
+
+ a0= 0xFFFFFFFFUL & a;
+ a1= ((ulonglong) a) >> 32;
+ b0= 0xFFFFFFFFUL & b;
+ b1= ((ulonglong) b) >> 32;
+
+ if (a1 && b1)
+ goto err;
+
+ res1= (ulonglong) a1 * b0 + (ulonglong) a0 * b1;
+ if (res1 > 0xFFFFFFFFUL)
+ goto err;
+
+ res1= res1 << 32;
+ res0= (ulonglong) a0 * b0;
+
+ if (test_if_sum_overflows_ull(res1, res0))
+ goto err;
+ res= res1 + res0;
+
+ if (a_negative != b_negative)
+ {
+ if ((ulonglong) res > (ulonglong) LONGLONG_MIN + 1)
+ goto err;
+ res= -res;
+ }
+ else
+ res_unsigned= TRUE;
+
+ return check_integer_overflow(res, res_unsigned);
+
+err:
+ return raise_integer_overflow();
}
@@ -1237,8 +1425,10 @@ my_decimal *Item_func_mul::decimal_op(my_decimal *decimal_value)
return 0;
val2= args[1]->val_decimal(&value2);
if (!(null_value= (args[1]->null_value ||
- (my_decimal_mul(E_DEC_FATAL_ERROR, decimal_value, val1,
- val2) > 3))))
+ (check_decimal_overflow(my_decimal_mul(E_DEC_FATAL_ERROR &
+ ~E_DEC_OVERFLOW,
+ decimal_value, val1,
+ val2)) > 3))))
return decimal_value;
return 0;
}
@@ -1271,7 +1461,7 @@ double Item_func_div::real_op()
signal_divide_by_null();
return 0.0;
}
- return fix_result(value/val2);
+ return check_float_overflow(value/val2);
}
@@ -1287,8 +1477,12 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value)
val2= args[1]->val_decimal(&value2);
if ((null_value= args[1]->null_value))
return 0;
- if ((err= my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_DIV_ZERO, decimal_value,
- val1, val2, prec_increment)) > 3)
+ if ((err= check_decimal_overflow(my_decimal_div(E_DEC_FATAL_ERROR &
+ ~E_DEC_OVERFLOW &
+ ~E_DEC_DIV_ZERO,
+ decimal_value,
+ val1, val2,
+ prec_increment))) > 3)
{
if (err == E_DEC_DIV_ZERO)
signal_divide_by_null();
@@ -1379,22 +1573,35 @@ longlong Item_func_int_div::val_int()
if (my_decimal2int(E_DEC_FATAL_ERROR, &tmp, unsigned_flag, &res) &
E_DEC_OVERFLOW)
- my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0), name, 1);
+ raise_integer_overflow();
return res;
}
- longlong value=args[0]->val_int();
- longlong val2=args[1]->val_int();
+ longlong val0=args[0]->val_int();
+ longlong val1=args[1]->val_int();
+ bool val0_negative, val1_negative, res_negative;
+ ulonglong uval0, uval1, res;
if ((null_value= (args[0]->null_value || args[1]->null_value)))
return 0;
- if (val2 == 0)
+ if (val1 == 0)
{
signal_divide_by_null();
return 0;
}
- return (unsigned_flag ?
- (ulonglong) value / (ulonglong) val2 :
- value / val2);
+
+ val0_negative= !args[0]->unsigned_flag && val0 < 0;
+ val1_negative= !args[1]->unsigned_flag && val1 < 0;
+ res_negative= val0_negative != val1_negative;
+ uval0= (ulonglong) (val0_negative ? -val0 : val0);
+ uval1= (ulonglong) (val1_negative ? -val1 : val1);
+ res= uval0 / uval1;
+ if (res_negative)
+ {
+ if (res > (ulonglong) LONGLONG_MAX)
+ return raise_integer_overflow();
+ res= (ulonglong) (-(longlong) res);
+ }
+ return check_integer_overflow(res, !res_negative);
}
@@ -1413,26 +1620,32 @@ void Item_func_int_div::fix_length_and_dec()
longlong Item_func_mod::int_op()
{
DBUG_ASSERT(fixed == 1);
- longlong value= args[0]->val_int();
- longlong val2= args[1]->val_int();
- longlong result;
+ longlong val0= args[0]->val_int();
+ longlong val1= args[1]->val_int();
+ bool val0_negative, val1_negative;
+ ulonglong uval0, uval1;
+ ulonglong res;
if ((null_value= args[0]->null_value || args[1]->null_value))
return 0; /* purecov: inspected */
- if (val2 == 0)
+ if (val1 == 0)
{
signal_divide_by_null();
return 0;
}
- if (args[0]->unsigned_flag)
- result= args[1]->unsigned_flag ?
- ((ulonglong) value) % ((ulonglong) val2) : ((ulonglong) value) % val2;
- else
- result= args[1]->unsigned_flag ?
- value % ((ulonglong) val2) : value % val2;
-
- return result;
+ /*
+ '%' is calculated by integer division internally. Since dividing
+ LONGLONG_MIN by -1 generates SIGFPE, we calculate using unsigned values and
+ then adjust the sign appropriately.
+ */
+ val0_negative= !args[0]->unsigned_flag && val0 < 0;
+ val1_negative= !args[1]->unsigned_flag && val1 < 0;
+ uval0= (ulonglong) (val0_negative ? -val0 : val0);
+ uval1= (ulonglong) (val1_negative ? -val1 : val1);
+ res= uval0 % uval1;
+ return check_integer_overflow(val0_negative ? -(longlong) res : res,
+ !val0_negative);
}
double Item_func_mod::real_op()
@@ -1502,8 +1715,12 @@ double Item_func_neg::real_op()
longlong Item_func_neg::int_op()
{
longlong value= args[0]->val_int();
- null_value= args[0]->null_value;
- return -value;
+ if ((null_value= args[0]->null_value))
+ return 0;
+ if (args[0]->unsigned_flag &&
+ (ulonglong) value > (ulonglong) LONGLONG_MAX + 1)
+ return raise_integer_overflow();
+ return check_integer_overflow(-value, !args[0]->unsigned_flag && value < 0);
}
@@ -1572,7 +1789,12 @@ longlong Item_func_abs::int_op()
longlong value= args[0]->val_int();
if ((null_value= args[0]->null_value))
return 0;
- return (value >= 0) || unsigned_flag ? value : -value;
+ if (unsigned_flag)
+ return value;
+ /* -LONGLONG_MIN = LONGLONG_MAX + 1 => outside of signed longlong range */
+ if (value == LONGLONG_MIN)
+ return raise_integer_overflow();
+ return (value >= 0) ? value : -value;
}
@@ -1679,7 +1901,7 @@ double Item_func_exp::val_real()
double value= args[0]->val_real();
if ((null_value=args[0]->null_value))
return 0.0; /* purecov: inspected */
- return fix_result(exp(value));
+ return check_float_overflow(exp(value));
}
double Item_func_sqrt::val_real()
@@ -1698,7 +1920,7 @@ double Item_func_pow::val_real()
double val2= args[1]->val_real();
if ((null_value=(args[0]->null_value || args[1]->null_value)))
return 0.0; /* purecov: inspected */
- return fix_result(pow(value,val2));
+ return check_float_overflow(pow(value,val2));
}
// Trigonometric functions
@@ -1734,7 +1956,7 @@ double Item_func_atan::val_real()
double val2= args[1]->val_real();
if ((null_value=args[1]->null_value))
return 0.0;
- return fix_result(atan2(value,val2));
+ return check_float_overflow(atan2(value,val2));
}
return atan(value);
}
@@ -1763,7 +1985,17 @@ double Item_func_tan::val_real()
double value= args[0]->val_real();
if ((null_value=args[0]->null_value))
return 0.0;
- return fix_result(tan(value));
+ return check_float_overflow(tan(value));
+}
+
+
+double Item_func_cot::val_real()
+{
+ DBUG_ASSERT(fixed == 1);
+ double value= args[0]->val_real();
+ if ((null_value=args[0]->null_value))
+ return 0.0;
+ return check_float_overflow(1.0 / tan(value));
}
@@ -2238,7 +2470,7 @@ double Item_func_units::val_real()
double value= args[0]->val_real();
if ((null_value=args[0]->null_value))
return 0;
- return value*mul+add;
+ return check_float_overflow(value * mul + add);
}
@@ -4766,6 +4998,7 @@ int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
user_var_event->user_var_event= var_entry;
user_var_event->type= var_entry->type;
user_var_event->charset_number= var_entry->collation.collation->number;
+ user_var_event->unsigned_flag= var_entry->unsigned_flag;
if (!var_entry->value)
{
/* NULL value*/
diff --git a/sql/item_func.h b/sql/item_func.h
index fc7f8708a45..38253a73265 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -187,13 +187,56 @@ public:
void * arg, traverse_order order);
bool is_expensive_processor(uchar *arg);
virtual bool is_expensive() { return 0; }
- inline double fix_result(double value)
+ inline void raise_numeric_overflow(const char *type_name)
{
- if (isfinite(value))
- return value;
- null_value=1;
+ char buf[256];
+ String str(buf, sizeof(buf), system_charset_info);
+ str.length(0);
+ print(&str, QT_ORDINARY);
+ my_error(ER_DATA_OUT_OF_RANGE, MYF(0), type_name, str.c_ptr_safe());
+ }
+ inline double raise_float_overflow()
+ {
+ raise_numeric_overflow("DOUBLE");
return 0.0;
}
+ inline longlong raise_integer_overflow()
+ {
+ raise_numeric_overflow(unsigned_flag ? "BIGINT UNSIGNED": "BIGINT");
+ return 0;
+ }
+ inline int raise_decimal_overflow()
+ {
+ raise_numeric_overflow("DECIMAL");
+ return E_DEC_OVERFLOW;
+ }
+ /**
+ Throw an error if the input double number is not finite, i.e. is either
+ +/-INF or NAN.
+ */
+ inline double check_float_overflow(double value)
+ {
+ return isfinite(value) ? value : raise_float_overflow();
+ }
+ /**
+ Throw an error if the input BIGINT value represented by the
+ (longlong value, bool unsigned flag) pair cannot be returned by the
+ function, i.e. is not compatible with this Item's unsigned_flag.
+ */
+ inline longlong check_integer_overflow(longlong value, bool val_unsigned)
+ {
+ if ((unsigned_flag && !val_unsigned && value < 0) ||
+ (!unsigned_flag && val_unsigned && (ulonglong) value > LONGLONG_MAX))
+ return raise_integer_overflow();
+ return value;
+ }
+ /**
+ Throw an error if the error code of a DECIMAL operation is E_DEC_OVERFLOW.
+ */
+ inline int check_decimal_overflow(int error)
+ {
+ return (error == E_DEC_OVERFLOW) ? raise_decimal_overflow() : error;
+ }
bool has_timestamp_args()
{
DBUG_ASSERT(fixed == TRUE);
@@ -667,6 +710,14 @@ public:
const char *func_name() const { return "tan"; }
};
+class Item_func_cot :public Item_dec_func
+{
+public:
+ Item_func_cot(Item *a) :Item_dec_func(a) {}
+ double val_real();
+ const char *func_name() const { return "cot"; }
+};
+
class Item_func_integer :public Item_int_func
{
public:
diff --git a/sql/lock.cc b/sql/lock.cc
index 78a16cea18a..7937878073e 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -97,7 +97,7 @@ static void print_lock_error(int error, const char *);
/* Map the return value of thr_lock to an error from errmsg.txt */
static int thr_lock_errno_to_mysql[]=
-{ 0, 1, ER_LOCK_WAIT_TIMEOUT, ER_LOCK_DEADLOCK };
+{ 0, ER_LOCK_ABORTED, ER_LOCK_WAIT_TIMEOUT, ER_LOCK_DEADLOCK };
/**
Perform semantic checks for mysql_lock_tables.
@@ -108,8 +108,7 @@ static int thr_lock_errno_to_mysql[]=
@return 0 if all the check passed, non zero if a check failed.
*/
static int
-lock_tables_check(THD *thd, TABLE **tables, uint count,
- bool *write_lock_used, uint flags)
+lock_tables_check(THD *thd, TABLE **tables, uint count, uint flags)
{
uint system_count, i;
bool is_superuser, log_table_write_query;
@@ -117,10 +116,9 @@ lock_tables_check(THD *thd, TABLE **tables, uint count,
DBUG_ENTER("lock_tables_check");
system_count= 0;
- *write_lock_used= FALSE;
is_superuser= thd->security_ctx->master_access & SUPER_ACL;
log_table_write_query= (is_log_table_write_query(thd->lex->sql_command)
- || ((flags & MYSQL_LOCK_PERF_SCHEMA) != 0));
+ || ((flags & MYSQL_LOCK_LOG_TABLE) != 0));
for (i=0 ; i<count; i++)
{
@@ -153,8 +151,6 @@ lock_tables_check(THD *thd, TABLE **tables, uint count,
if (t->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE)
{
- *write_lock_used= TRUE;
-
if (t->s->table_category == TABLE_CATEGORY_SYSTEM)
system_count++;
@@ -273,141 +269,69 @@ static void reset_lock_data_and_free(MYSQL_LOCK **mysql_lock)
@param tables An array of pointers to the tables to lock.
@param count The number of tables to lock.
@param flags Options:
- MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK Ignore a global read lock
MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY Ignore SET GLOBAL READ_ONLY
- MYSQL_LOCK_IGNORE_FLUSH Ignore a flush tables.
MYSQL_LOCK_IGNORE_TIMEOUT Use maximum timeout value.
- @param need_reopen Out parameter, TRUE if some tables were altered
- or deleted and should be reopened by caller.
-
- @note Caller of this function should always be ready to handle request to
- reopen table unless there are external invariants which guarantee
- that such thing won't be needed (for example we are obtaining lock
- on table on which we already have exclusive metadata lock).
@retval A lock structure pointer on success.
- @retval NULL on error or if some tables should be reopen.
+ @retval NULL if an error or if wait on a lock was killed.
*/
-MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
- uint flags, bool *need_reopen)
+MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, uint flags)
{
int rc;
MYSQL_LOCK *sql_lock;
- bool write_lock_used;
-
- DBUG_ENTER("mysql_lock_tables");
-
- *need_reopen= FALSE;
-
- if (lock_tables_check(thd, tables, count, &write_lock_used, flags))
- DBUG_RETURN (NULL);
-
ulong timeout= (flags & MYSQL_LOCK_IGNORE_TIMEOUT) ?
LONG_TIMEOUT : thd->variables.lock_wait_timeout;
- for (;;)
- {
- if (! (sql_lock= get_lock_data(thd, tables, count, GET_LOCK_STORE_LOCKS)))
- break;
+ DBUG_ENTER("mysql_lock_tables");
- if (global_read_lock && write_lock_used &&
- ! (flags & MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK))
- {
- /*
- Someone has issued LOCK ALL TABLES FOR READ and we want a write lock
- Wait until the lock is gone
- */
- if (thd->global_read_lock.wait_if_global_read_lock(thd, 1, 1))
- {
- /* Clear the lock type of all lock data to avoid reusage. */
- reset_lock_data_and_free(&sql_lock);
- break;
- }
- if (thd->version != refresh_version)
- {
- /* Clear the lock type of all lock data to avoid reusage. */
- reset_lock_data_and_free(&sql_lock);
- goto retry;
- }
- }
+ if (lock_tables_check(thd, tables, count, flags))
+ DBUG_RETURN(NULL);
- thd_proc_info(thd, "System lock");
- DBUG_PRINT("info", ("thd->proc_info %s", thd->proc_info));
- if (sql_lock->table_count && lock_external(thd, sql_lock->table,
- sql_lock->table_count))
- {
- /* Clear the lock type of all lock data to avoid reusage. */
- reset_lock_data_and_free(&sql_lock);
- break;
- }
- DBUG_PRINT("info", ("thd->proc_info %s", thd->proc_info));
- /* Copy the lock data array. thr_multi_lock() reorders its contens. */
- memcpy(sql_lock->locks + sql_lock->lock_count, sql_lock->locks,
- sql_lock->lock_count * sizeof(*sql_lock->locks));
- /* Lock on the copied half of the lock data array. */
- rc= thr_lock_errno_to_mysql[(int) thr_multi_lock(sql_lock->locks +
- sql_lock->lock_count,
- sql_lock->lock_count,
- thd->lock_id, timeout)];
- if (rc > 1) /* a timeout or a deadlock */
- {
- if (sql_lock->table_count)
- (void) unlock_external(thd, sql_lock->table, sql_lock->table_count);
- reset_lock_data_and_free(&sql_lock);
- my_error(rc, MYF(0));
- break;
- }
- else if (rc == 1) /* aborted or killed */
- {
- /*
- reset_lock_data is required here. If thr_multi_lock fails it
- resets lock type for tables, which were locked before (and
- including) one that caused error. Lock type for other tables
- preserved.
- */
- reset_lock_data(sql_lock);
- sql_lock->lock_count= 0; // Locks are already freed
- // Fall through: unlock, reset lock data, free and retry
- }
- else
- {
- /* Success */
- break;
- }
- thd_proc_info(thd, 0);
+ if (! (sql_lock= get_lock_data(thd, tables, count, GET_LOCK_STORE_LOCKS)))
+ DBUG_RETURN(NULL);
- /* going to retry, unlock all tables */
- if (sql_lock->lock_count)
- thr_multi_unlock(sql_lock->locks, sql_lock->lock_count);
+ thd_proc_info(thd, "System lock");
+ DBUG_PRINT("info", ("thd->proc_info %s", thd->proc_info));
+ if (sql_lock->table_count && lock_external(thd, sql_lock->table,
+ sql_lock->table_count))
+ {
+ /* Clear the lock type of all lock data to avoid reusage. */
+ reset_lock_data_and_free(&sql_lock);
+ goto end;
+ }
+ /* Copy the lock data array. thr_multi_lock() reorders its contents. */
+ memcpy(sql_lock->locks + sql_lock->lock_count, sql_lock->locks,
+ sql_lock->lock_count * sizeof(*sql_lock->locks));
+ /* Lock on the copied half of the lock data array. */
+ rc= thr_lock_errno_to_mysql[(int) thr_multi_lock(sql_lock->locks +
+ sql_lock->lock_count,
+ sql_lock->lock_count,
+ thd->lock_id, timeout)];
+ if (rc)
+ {
if (sql_lock->table_count)
(void) unlock_external(thd, sql_lock->table, sql_lock->table_count);
-
- /*
- If thr_multi_lock fails it resets lock type for tables, which
- were locked before (and including) one that caused error. Lock
- type for other tables preserved.
- */
reset_lock_data_and_free(&sql_lock);
-retry:
- /* Let upper level close all used tables and retry or give error. */
- *need_reopen= TRUE;
- break;
+ if (! thd->killed)
+ my_error(rc, MYF(0));
}
+end:
thd_proc_info(thd, 0);
+
if (thd->killed)
{
thd->send_kill_message();
if (sql_lock)
{
- mysql_unlock_tables(thd,sql_lock);
- sql_lock=0;
+ mysql_unlock_tables(thd, sql_lock);
+ sql_lock= 0;
}
}
thd->set_time_after_lock();
- DBUG_RETURN (sql_lock);
+ DBUG_RETURN(sql_lock);
}
diff --git a/sql/log.cc b/sql/log.cc
index ce9d75089d1..279782d271b 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -4671,7 +4671,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
/* setting flags for user var log event */
uchar flags= User_var_log_event::UNDEF_F;
- if (user_var_event->user_var_event->unsigned_flag)
+ if (user_var_event->unsigned_flag)
flags|= User_var_log_event::UNSIGNED_F;
User_var_log_event e(thd, user_var_event->user_var_event->name.str,
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 9b46ad83b14..e87c3688cac 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1455,8 +1455,6 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli)
*/
if (!thd->lock)
{
- bool need_reopen= 1; /* To execute the first lap of the loop below */
-
/*
lock_tables() reads the contents of thd->lex, so they must be
initialized. Contrary to in
@@ -1465,80 +1463,31 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli)
*/
lex_start(thd);
- while ((error= lock_tables(thd, rli->tables_to_lock,
- rli->tables_to_lock_count, 0,
- &need_reopen)))
+ if ((error= lock_tables(thd, rli->tables_to_lock,
+ rli->tables_to_lock_count, 0)))
{
- if (!need_reopen)
- {
- if (thd->is_slave_error || thd->is_fatal_error)
- {
- /*
- Error reporting borrowed from Query_log_event with many excessive
- simplifications (we don't honour --slave-skip-errors)
- */
- uint actual_error= thd->net.last_errno;
- rli->report(ERROR_LEVEL, actual_error,
- "Error '%s' in %s event: when locking tables",
- (actual_error ? thd->net.last_error :
- "unexpected success or fatal error"),
- get_type_str());
- thd->is_fatal_error= 1;
- }
- else
- {
- rli->report(ERROR_LEVEL, error,
- "Error in %s event: when locking tables",
- get_type_str());
- }
- const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
- DBUG_RETURN(error);
- }
-
- /*
- So we need to reopen the tables.
-
- We need to flush the pending RBR event, since it keeps a
- pointer to an open table.
-
- ALTERNATIVE SOLUTION (not implemented): Extract a pointer to
- the pending RBR event and reset the table pointer after the
- tables has been reopened.
-
- NOTE: For this new scheme there should be no pending event:
- need to add code to assert that is the case.
- */
- error= thd->binlog_flush_pending_rows_event(FALSE);
- if (error)
+ if (thd->is_slave_error || thd->is_fatal_error)
{
- rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
- ER(ER_SLAVE_FATAL_ERROR),
- "call to binlog_flush_pending_rows_event() failed");
- thd->is_slave_error= 1;
- DBUG_RETURN(error);
+ /*
+ Error reporting borrowed from Query_log_event with many excessive
+ simplifications (we don't honour --slave-skip-errors)
+ */
+ uint actual_error= thd->net.last_errno;
+ rli->report(ERROR_LEVEL, actual_error,
+ "Error '%s' in %s event: when locking tables",
+ (actual_error ? thd->net.last_error :
+ "unexpected success or fatal error"),
+ get_type_str());
+ thd->is_fatal_error= 1;
}
- TABLE_LIST *tables= rli->tables_to_lock;
- close_tables_for_reopen(thd, &tables, NULL);
-
- uint tables_count= rli->tables_to_lock_count;
- if ((error= open_tables(thd, &tables, &tables_count, 0)))
+ else
{
- if (thd->is_slave_error || thd->is_fatal_error)
- {
- /*
- Error reporting borrowed from Query_log_event with many excessive
- simplifications (we don't honour --slave-skip-errors)
- */
- uint actual_error= thd->net.last_errno;
- rli->report(ERROR_LEVEL, actual_error,
- "Error '%s' on reopening tables",
- (actual_error ? thd->net.last_error :
- "unexpected success or fatal error"));
- thd->is_slave_error= 1;
- }
- const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
- DBUG_RETURN(error);
+ rli->report(ERROR_LEVEL, error,
+ "Error in %s event: when locking tables",
+ get_type_str());
}
+ const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
+ DBUG_RETURN(error);
}
/*
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 4e672f1d6c7..b398baa064e 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -1590,8 +1590,7 @@ inline bool open_and_lock_tables(THD *thd, TABLE_LIST *tables,
TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l,
thr_lock_type lock_type, uint flags);
bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags);
-bool lock_tables(THD *thd, TABLE_LIST *tables, uint counter, uint flags,
- bool *need_reopen);
+bool lock_tables(THD *thd, TABLE_LIST *tables, uint counter, uint flags);
TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
const char *table_name, bool link_in_list);
bool rm_temporary_table(handlerton *base, char *path);
@@ -2145,14 +2144,13 @@ extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher,
extern struct st_VioSSLFd * ssl_acceptor_fd;
#endif /* HAVE_OPENSSL */
-MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **table, uint count,
- uint flags, bool *need_reopen);
+MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **table, uint count, uint flags);
/* mysql_lock_tables() and open_table() flags bits */
-#define MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK 0x0001
-#define MYSQL_LOCK_IGNORE_FLUSH 0x0002
+#define MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK 0x0001
+#define MYSQL_OPEN_IGNORE_FLUSH 0x0002
#define MYSQL_OPEN_TEMPORARY_ONLY 0x0004
#define MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY 0x0008
-#define MYSQL_LOCK_PERF_SCHEMA 0x0010
+#define MYSQL_LOCK_LOG_TABLE 0x0010
#define MYSQL_OPEN_TAKE_UPGRADABLE_MDL 0x0020
/**
Do not try to acquire a metadata lock on the table: we
@@ -2182,8 +2180,8 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **table, uint count,
#define MYSQL_LOCK_IGNORE_TIMEOUT 0x1000
/** Please refer to the internals manual. */
-#define MYSQL_OPEN_REOPEN (MYSQL_LOCK_IGNORE_FLUSH |\
- MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK |\
+#define MYSQL_OPEN_REOPEN (MYSQL_OPEN_IGNORE_FLUSH |\
+ MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK |\
MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY |\
MYSQL_LOCK_IGNORE_TIMEOUT |\
MYSQL_OPEN_GET_NEW_TABLE |\
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 9861c03137f..517782cb0b4 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -6321,3 +6321,9 @@ ER_SPATIAL_MUST_HAVE_GEOM_COL 42000
ER_TOO_LONG_INDEX_COMMENT
eng "Comment for index '%-.64s' is too long (max = %lu)"
+
+ER_LOCK_ABORTED
+ eng "Wait on a lock was aborted due to a pending exclusive lock"
+
+ER_DATA_OUT_OF_RANGE 22003
+ eng "%s value is out of range in '%s'"
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index b4c9aa576d0..a85a863abd9 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2421,7 +2421,7 @@ open_table_get_mdl_lock(THD *thd, TABLE_LIST *table_list,
required to remedy problem appeared during attempt
to open table.
flags Bitmap of flags to modify how open works:
- MYSQL_LOCK_IGNORE_FLUSH - Open table even if
+ MYSQL_OPEN_IGNORE_FLUSH - Open table even if
someone has done a flush or there is a pending
exclusive metadata lock requests against it
(i.e. request high priority metadata lock).
@@ -2480,6 +2480,31 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
TMP_TABLE_KEY_EXTRA);
/*
+ We need this to work for all tables, including temporary
+ tables, for backwards compatibility. But not under LOCK
+ TABLES, since under LOCK TABLES one can't use a non-prelocked
+ table. This code only works for updates done inside DO/SELECT
+ f1() statements, normal DML is handled by means of
+ sql_command_flags.
+ */
+ if (global_read_lock && table_list->lock_type >= TL_WRITE_ALLOW_WRITE &&
+ ! (flags & MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK) &&
+ ! thd->locked_tables_mode)
+ {
+ /*
+ Someone has issued FLUSH TABLES WITH READ LOCK and we want
+ a write lock. Wait until the lock is gone.
+ */
+ if (thd->global_read_lock.wait_if_global_read_lock(thd, 1, 1))
+ DBUG_RETURN(TRUE);
+
+ if (thd->version != refresh_version)
+ {
+ (void) ot_ctx->request_backoff_action(Open_table_context::OT_WAIT_TDC);
+ DBUG_RETURN(TRUE);
+ }
+ }
+ /*
Unless requested otherwise, try to resolve this table in the list
of temporary tables of this thread. In MySQL temporary tables
are always thread-local and "shadow" possible base tables with the
@@ -2680,7 +2705,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
if (!thd->open_tables)
thd->version=refresh_version;
else if ((thd->version != refresh_version) &&
- ! (flags & MYSQL_LOCK_IGNORE_FLUSH))
+ ! (flags & MYSQL_OPEN_IGNORE_FLUSH))
{
/* Someone did a refresh while thread was opening tables */
mysql_mutex_unlock(&LOCK_open);
@@ -2811,7 +2836,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
if (share->version != refresh_version)
{
- if (!(flags & MYSQL_LOCK_IGNORE_FLUSH))
+ if (!(flags & MYSQL_OPEN_IGNORE_FLUSH))
{
/*
We already have an MDL lock. But we have encountered an old
@@ -3293,7 +3318,6 @@ bool
Locked_tables_list::reopen_tables(THD *thd)
{
Open_table_context ot_ctx_unused(thd, LONG_TIMEOUT);
- bool lt_refresh_unused;
size_t reopen_count= 0;
MYSQL_LOCK *lock;
MYSQL_LOCK *merged_lock;
@@ -3333,7 +3357,7 @@ Locked_tables_list::reopen_tables(THD *thd)
break something else.
*/
lock= mysql_lock_tables(thd, m_reopen_array, reopen_count,
- MYSQL_OPEN_REOPEN, &lt_refresh_unused);
+ MYSQL_OPEN_REOPEN);
thd->in_lock_tables= 0;
if (lock == NULL || (merged_lock=
mysql_lock_merge(thd->lock, lock)) == NULL)
@@ -5061,7 +5085,6 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type,
TABLE *table;
Open_table_context ot_ctx(thd, (lock_flags & MYSQL_LOCK_IGNORE_TIMEOUT) ?
LONG_TIMEOUT : thd->variables.lock_wait_timeout);
- bool refresh;
bool error;
DBUG_ENTER("open_ltable");
@@ -5073,8 +5096,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type,
/* open_ltable can be used only for BASIC TABLEs */
table_list->required_type= FRMTYPE_TABLE;
-retry:
- while ((error= open_table(thd, table_list, thd->mem_root, &ot_ctx, 0)) &&
+ while ((error= open_table(thd, table_list, thd->mem_root, &ot_ctx, lock_flags)) &&
ot_ctx.can_recover_from_failed_open())
{
/*
@@ -5120,18 +5142,9 @@ retry:
DBUG_ASSERT(thd->lock == 0); // You must lock everything at once
if ((table->reginfo.lock_type= lock_type) != TL_UNLOCK)
if (! (thd->lock= mysql_lock_tables(thd, &table_list->table, 1,
- lock_flags, &refresh)))
+ lock_flags)))
{
- if (refresh)
- {
- close_thread_tables(thd);
- table_list->table= NULL;
- table_list->mdl_request.ticket= NULL;
- thd->mdl_context.rollback_to_savepoint(ot_ctx.start_of_statement_svp());
- goto retry;
- }
- else
- table= 0;
+ table= 0;
}
}
}
@@ -5168,42 +5181,27 @@ bool open_and_lock_tables(THD *thd, TABLE_LIST *tables,
Prelocking_strategy *prelocking_strategy)
{
uint counter;
- bool need_reopen;
- /*
- Remember the set of metadata locks which this connection
- managed to acquire before the start of the current statement.
- It can be either transaction-scope locks, or HANDLER locks,
- or LOCK TABLES locks. If mysql_lock_tables() fails with
- need_reopen request, we'll use it to instruct
- close_tables_for_reopen() to release all locks of this
- statement.
- */
- MDL_ticket *start_of_statement_svp= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("open_and_lock_tables");
DBUG_PRINT("enter", ("derived handling: %d", derived));
- for ( ; ; )
- {
- if (open_tables(thd, &tables, &counter, flags, prelocking_strategy))
- DBUG_RETURN(TRUE);
- DBUG_EXECUTE_IF("sleep_open_and_lock_after_open", {
- const char *old_proc_info= thd->proc_info;
- thd->proc_info= "DBUG sleep";
- my_sleep(6000000);
- thd->proc_info= old_proc_info;});
-
- if (!lock_tables(thd, tables, counter, flags,
- &need_reopen))
- break;
- if (!need_reopen)
- DBUG_RETURN(TRUE);
- close_tables_for_reopen(thd, &tables, start_of_statement_svp);
- }
+ if (open_tables(thd, &tables, &counter, flags, prelocking_strategy))
+ DBUG_RETURN(TRUE);
+
+ DBUG_EXECUTE_IF("sleep_open_and_lock_after_open", {
+ const char *old_proc_info= thd->proc_info;
+ thd->proc_info= "DBUG sleep";
+ my_sleep(6000000);
+ thd->proc_info= old_proc_info;});
+
+ if (lock_tables(thd, tables, counter, flags))
+ DBUG_RETURN(TRUE);
+
if (derived &&
(mysql_handle_derived(thd->lex, &mysql_derived_prepare) ||
(thd->fill_derived_tables() &&
mysql_handle_derived(thd->lex, &mysql_derived_filling))))
DBUG_RETURN(TRUE); /* purecov: inspected */
+
DBUG_RETURN(FALSE);
}
@@ -5216,7 +5214,7 @@ bool open_and_lock_tables(THD *thd, TABLE_LIST *tables,
thd - thread handler
tables - list of tables for open
flags - bitmap of flags to modify how the tables will be open:
- MYSQL_LOCK_IGNORE_FLUSH - open table even if someone has
+ MYSQL_OPEN_IGNORE_FLUSH - open table even if someone has
done a flush or namelock on it.
RETURN
@@ -5261,37 +5259,28 @@ static void mark_real_tables_as_free_for_reuse(TABLE_LIST *table)
}
-/*
- Lock all tables in list
+/**
+ Lock all tables in a list.
- SYNOPSIS
- lock_tables()
- thd Thread handler
- tables Tables to lock
- count Number of opened tables
- flags Options (see mysql_lock_tables() for details)
- need_reopen Out parameter which if TRUE indicates that some
- tables were dropped or altered during this call
- and therefore invoker should reopen tables and
- try to lock them once again (in this case
- lock_tables() will also return error).
+ @param thd Thread handler
+ @param tables Tables to lock
+ @param count Number of opened tables
+ @param flags Options (see mysql_lock_tables() for details)
- NOTES
- You can't call lock_tables twice, as this would break the dead-lock-free
- handling thr_lock gives us. You most always get all needed locks at
- once.
+ You can't call lock_tables() while holding thr_lock locks, as
+ this would break the dead-lock-free handling thr_lock gives us.
+ You must always get all needed locks at once.
- If query for which we are calling this function marked as requiring
- prelocking, this function will change locked_tables_mode to
- LTM_PRELOCKED.
+ If the query for which we are calling this function is marked as
+ requiring prelocking, this function will change
+ locked_tables_mode to LTM_PRELOCKED.
- RETURN VALUES
- 0 ok
- -1 Error
+ @retval FALSE Success.
+ @retval TRUE A lock wait timeout, deadlock or out of memory.
*/
bool lock_tables(THD *thd, TABLE_LIST *tables, uint count,
- uint flags, bool *need_reopen)
+ uint flags)
{
TABLE_LIST *table;
@@ -5302,7 +5291,6 @@ bool lock_tables(THD *thd, TABLE_LIST *tables, uint count,
*/
DBUG_ASSERT(thd->locked_tables_mode <= LTM_LOCK_TABLES ||
!thd->lex->requires_prelocking());
- *need_reopen= FALSE;
if (!tables && !thd->lex->requires_prelocking())
DBUG_RETURN(thd->decide_logging_format(tables));
@@ -5347,7 +5335,7 @@ bool lock_tables(THD *thd, TABLE_LIST *tables, uint count,
DEBUG_SYNC(thd, "before_lock_tables_takes_lock");
if (! (thd->lock= mysql_lock_tables(thd, start, (uint) (ptr - start),
- flags, need_reopen)))
+ flags)))
DBUG_RETURN(TRUE);
DEBUG_SYNC(thd, "after_lock_tables_takes_lock");
@@ -8869,7 +8857,7 @@ open_system_tables_for_read(THD *thd, TABLE_LIST *table_list,
thd->reset_n_backup_open_tables_state(backup);
if (open_and_lock_tables(thd, table_list, FALSE,
- MYSQL_LOCK_IGNORE_FLUSH |
+ MYSQL_OPEN_IGNORE_FLUSH |
MYSQL_LOCK_IGNORE_TIMEOUT))
{
lex->restore_backup_query_tables_list(&query_tables_list_backup);
@@ -8957,11 +8945,11 @@ open_system_table_for_update(THD *thd, TABLE_LIST *one_table)
TABLE *
open_log_table(THD *thd, TABLE_LIST *one_table, Open_tables_backup *backup)
{
- uint flags= ( MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK |
+ uint flags= ( MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK |
MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY |
- MYSQL_LOCK_IGNORE_FLUSH |
+ MYSQL_OPEN_IGNORE_FLUSH |
MYSQL_LOCK_IGNORE_TIMEOUT |
- MYSQL_LOCK_PERF_SCHEMA);
+ MYSQL_LOCK_LOG_TABLE);
TABLE *table;
/* Save value that is changed in mysql_lock_tables() */
ulonglong save_utime_after_lock= thd->utime_after_lock;
@@ -8989,8 +8977,7 @@ open_log_table(THD *thd, TABLE_LIST *one_table, Open_tables_backup *backup)
open tables cannot be accepted when restoring the open tables
state.
*/
- if (thd->killed)
- close_thread_tables(thd);
+ close_thread_tables(thd);
thd->restore_backup_open_tables_state(backup);
}
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 8ce3cee3c36..de6d92eccfd 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -75,6 +75,7 @@ typedef struct st_user_var_events
ulong length;
Item_result type;
uint charset_number;
+ bool unsigned_flag;
} BINLOG_USER_VAR_EVENT;
#define RP_LOCK_LOG_IS_ALREADY_LOCKED 1
@@ -1161,9 +1162,7 @@ public:
class Drop_table_error_handler : public Internal_error_handler
{
public:
- Drop_table_error_handler(Internal_error_handler *err_handler)
- :m_err_handler(err_handler)
- { }
+ Drop_table_error_handler() {}
public:
bool handle_condition(THD *thd,
@@ -1174,7 +1173,6 @@ public:
MYSQL_ERROR ** cond_hdl);
private:
- Internal_error_handler *m_err_handler;
};
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 75855020127..e700dd93a55 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -934,7 +934,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
}
else
{
- Drop_table_error_handler err_handler(thd->get_internal_handler());
+ Drop_table_error_handler err_handler;
thd->push_internal_handler(&err_handler);
error= -1;
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 3afeb4164bd..dfa06495e9d 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -405,6 +405,56 @@ bool mysql_ha_close(THD *thd, TABLE_LIST *tables)
}
+/**
+ A helper class to process an error from mysql_lock_tables().
+ HANDLER READ statement's attempt to lock the subject table
+ may get aborted if there is a pending DDL. In that case
+ we close the table, reopen it, and try to read again.
+ This is implicit and obscure, since HANDLER position
+ is lost in the process, but it's the legacy server
+ behaviour we should preserve.
+*/
+
+class Sql_handler_lock_error_handler: public Internal_error_handler
+{
+public:
+ virtual
+ bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char *sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR **cond_hdl);
+
+ bool need_reopen() const { return m_need_reopen; };
+ void init() { m_need_reopen= FALSE; };
+private:
+ bool m_need_reopen;
+};
+
+
+/**
+ Handle an error from mysql_lock_tables().
+ Ignore ER_LOCK_ABORTED errors.
+*/
+
+bool
+Sql_handler_lock_error_handler::
+handle_condition(THD *thd,
+ uint sql_errno,
+ const char *sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR **cond_hdl)
+{
+ *cond_hdl= NULL;
+ if (sql_errno == ER_LOCK_ABORTED)
+ m_need_reopen= TRUE;
+
+ return m_need_reopen;
+}
+
+
/*
Read from a HANDLER table.
@@ -442,7 +492,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
uint num_rows;
uchar *UNINIT_VAR(key);
uint UNINIT_VAR(key_len);
- bool need_reopen;
+ Sql_handler_lock_error_handler sql_handler_lock_error;
DBUG_ENTER("mysql_ha_read");
DBUG_PRINT("enter",("'%s'.'%s' as '%s'",
tables->db, tables->table_name, tables->alias));
@@ -506,8 +556,12 @@ retry:
thd->open_tables= hash_tables->table;
- lock= mysql_lock_tables(thd, &thd->open_tables, 1, 0, &need_reopen);
+ sql_handler_lock_error.init();
+ thd->push_internal_handler(&sql_handler_lock_error);
+
+ lock= mysql_lock_tables(thd, &thd->open_tables, 1, 0);
+ thd->pop_internal_handler();
/*
In 5.1 and earlier, mysql_lock_tables() could replace the TABLE
object with another one (reopen it). This is no longer the case
@@ -517,8 +571,9 @@ retry:
/* Restore previous context. */
thd->open_tables= backup_open_tables;
- if (need_reopen)
+ if (sql_handler_lock_error.need_reopen())
{
+ DBUG_ASSERT(!lock && !thd->is_error());
mysql_ha_close_table(thd, hash_tables);
goto retry;
}
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 26fb4e4e4e4..7423dd9d292 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -2396,7 +2396,8 @@ void kill_delayed_threads(void)
bool Delayed_insert::open_and_lock_table()
{
if (!(table= open_n_lock_single_table(&thd, &table_list,
- TL_WRITE_DELAYED, 0)))
+ TL_WRITE_DELAYED,
+ MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK)))
{
thd.fatal_error(); // Abort waiting inserts
return TRUE;
@@ -2557,7 +2558,6 @@ pthread_handler_t handle_delayed_insert(void *arg)
if (di->tables_in_use && ! thd->lock && !thd->killed)
{
- bool need_reopen;
/*
Request for new delayed insert.
Lock the table, but avoid to be blocked by a global read lock.
@@ -2568,30 +2568,10 @@ pthread_handler_t handle_delayed_insert(void *arg)
handler will close the table and finish when the outstanding
inserts are done.
*/
- if (! (thd->lock= mysql_lock_tables(thd, &di->table, 1,
- MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK,
- &need_reopen)))
+ if (! (thd->lock= mysql_lock_tables(thd, &di->table, 1, 0)))
{
- if (need_reopen && !thd->killed)
- {
- /*
- We were waiting to obtain TL_WRITE_DELAYED (probably due to
- someone having or requesting TL_WRITE_ALLOW_READ) and got
- aborted. Try to reopen table and if it fails die.
- */
- TABLE_LIST *tl_ptr = &di->table_list;
- close_tables_for_reopen(thd, &tl_ptr, NULL);
- di->table= 0;
- if (di->open_and_lock_table())
- {
- thd->killed= THD::KILL_CONNECTION;
- }
- }
- else
- {
- /* Fatal error */
- thd->killed= THD::KILL_CONNECTION;
- }
+ /* Fatal error */
+ thd->killed= THD::KILL_CONNECTION;
}
mysql_cond_broadcast(&di->cond_client);
}
@@ -3542,7 +3522,6 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
List_iterator_fast<Item> it(*items);
Item *item;
Field *tmp_field;
- bool not_used;
DBUG_ENTER("create_table_from_items");
tmp_table.alias= 0;
@@ -3666,8 +3645,7 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
since it won't wait for the table lock (we have exclusive metadata lock on
the table) and thus can't get aborted.
*/
- if (! ((*lock)= mysql_lock_tables(thd, &table, 1,
- MYSQL_LOCK_IGNORE_FLUSH, &not_used)) ||
+ if (! ((*lock)= mysql_lock_tables(thd, &table, 1, 0)) ||
hooks->postlock(&table, 1))
{
if (*lock)
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index d400e96ce7e..cfb57475b68 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -2128,8 +2128,6 @@ static int check_part_field(enum_field_types sql_type,
}
switch (sql_type)
{
- case MYSQL_TYPE_NEWDECIMAL:
- case MYSQL_TYPE_DECIMAL:
case MYSQL_TYPE_TINY:
case MYSQL_TYPE_SHORT:
case MYSQL_TYPE_LONG:
@@ -2151,6 +2149,8 @@ static int check_part_field(enum_field_types sql_type,
*result_type= STRING_RESULT;
*need_cs_check= TRUE;
return FALSE;
+ case MYSQL_TYPE_NEWDECIMAL:
+ case MYSQL_TYPE_DECIMAL:
case MYSQL_TYPE_TIMESTAMP:
case MYSQL_TYPE_NULL:
case MYSQL_TYPE_FLOAT:
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 8b8e223ad02..542a0378bf4 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2934,7 +2934,7 @@ fill_schema_show_cols_or_idxs(THD *thd, TABLE_LIST *tables,
*/
lex->sql_command= SQLCOM_SHOW_FIELDS;
res= open_normal_and_derived_tables(thd, show_table_list,
- (MYSQL_LOCK_IGNORE_FLUSH |
+ (MYSQL_OPEN_IGNORE_FLUSH |
MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL |
(can_deadlock ?
MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)));
@@ -3516,7 +3516,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
show_table_list->i_s_requested_object=
schema_table->i_s_requested_object;
res= open_normal_and_derived_tables(thd, show_table_list,
- (MYSQL_LOCK_IGNORE_FLUSH |
+ (MYSQL_OPEN_IGNORE_FLUSH |
MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL |
(can_deadlock ? MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)));
lex->sql_command= save_sql_command;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 8ba8c50b01e..2a9e01daf18 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1811,7 +1811,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
my_bool drop_temporary)
{
bool error;
- Drop_table_error_handler err_handler(thd->get_internal_handler());
+ Drop_table_error_handler err_handler;
DBUG_ENTER("mysql_rm_table");
@@ -4426,7 +4426,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
MY_STAT stat_info;
Open_table_context ot_ctx_unused(thd, LONG_TIMEOUT);
DBUG_ENTER("prepare_for_repair");
- uint reopen_for_repair_flags= (MYSQL_LOCK_IGNORE_FLUSH |
+ uint reopen_for_repair_flags= (MYSQL_OPEN_IGNORE_FLUSH |
MYSQL_OPEN_HAS_MDL_LOCK);
if (!(check_opt->sql_flags & TT_USEFRM))
@@ -7155,7 +7155,7 @@ view_err:
tbl.table_name= tbl.alias= tmp_name;
/* Table is in thd->temporary_tables */
(void) open_table(thd, &tbl, thd->mem_root, &ot_ctx_unused,
- MYSQL_LOCK_IGNORE_FLUSH);
+ MYSQL_OPEN_IGNORE_FLUSH);
new_table= tbl.table;
}
else
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 1643bce8ddd..62a35335374 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -203,33 +203,26 @@ int mysql_update(THD *thd,
SQL_SELECT *select;
READ_RECORD info;
SELECT_LEX *select_lex= &thd->lex->select_lex;
- bool need_reopen;
ulonglong id;
List<Item> all_fields;
THD::killed_state killed_status= THD::NOT_KILLED;
MDL_ticket *start_of_statement_svp= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("mysql_update");
- for ( ; ; )
- {
- if (open_tables(thd, &table_list, &table_count, 0))
- DBUG_RETURN(1);
+ if (open_tables(thd, &table_list, &table_count, 0))
+ DBUG_RETURN(1);
- if (table_list->multitable_view)
- {
- DBUG_ASSERT(table_list->view != 0);
- DBUG_PRINT("info", ("Switch to multi-update"));
- /* pass counter value */
- thd->lex->table_count= table_count;
- /* convert to multiupdate */
- DBUG_RETURN(2);
- }
- if (!lock_tables(thd, table_list, table_count, 0, &need_reopen))
- break;
- if (!need_reopen)
- DBUG_RETURN(1);
- close_tables_for_reopen(thd, &table_list, start_of_statement_svp);
+ if (table_list->multitable_view)
+ {
+ DBUG_ASSERT(table_list->view != 0);
+ DBUG_PRINT("info", ("Switch to multi-update"));
+ /* pass counter value */
+ thd->lex->table_count= table_count;
+ /* convert to multiupdate */
+ DBUG_RETURN(2);
}
+ if (lock_tables(thd, table_list, table_count, 0))
+ DBUG_RETURN(1);
if (mysql_handle_derived(thd->lex, &mysql_derived_prepare) ||
(thd->fill_derived_tables() &&
@@ -963,17 +956,14 @@ int mysql_multi_update_prepare(THD *thd)
uint table_count= lex->table_count;
const bool using_lock_tables= thd->locked_tables_mode != LTM_NONE;
bool original_multiupdate= (thd->lex->sql_command == SQLCOM_UPDATE_MULTI);
- bool need_reopen= FALSE;
MDL_ticket *start_of_statement_svp= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("mysql_multi_update_prepare");
/* following need for prepared statements, to run next time multi-update */
thd->lex->sql_command= SQLCOM_UPDATE_MULTI;
-reopen_tables:
-
/* open tables and create derived ones, but do not lock and fill them */
- if (((original_multiupdate || need_reopen) &&
+ if ((original_multiupdate &&
open_tables(thd, &table_list, &table_count, 0)) ||
mysql_handle_derived(lex, &mysql_derived_prepare))
DBUG_RETURN(TRUE);
@@ -1089,58 +1079,11 @@ reopen_tables:
/* now lock and fill tables */
if (!thd->stmt_arena->is_stmt_prepare() &&
- lock_tables(thd, table_list, table_count, 0, &need_reopen))
+ lock_tables(thd, table_list, table_count, 0))
{
- if (!need_reopen)
- DBUG_RETURN(TRUE);
-
- DBUG_PRINT("info", ("lock_tables failed, reopening"));
-
- /*
- We have to reopen tables since some of them were altered or dropped
- during lock_tables() or something was done with their triggers.
- Let us do some cleanups to be able do setup_table() and setup_fields()
- once again.
- */
- List_iterator_fast<Item> it(*fields);
- Item *item;
- while ((item= it++))
- item->cleanup();
-
- /*
- To not to hog memory (as a result of the
- unit->reinit_exec_mechanism() call below):
- */
- lex->unit.cleanup();
-
- for (SELECT_LEX *sl= lex->all_selects_list;
- sl;
- sl= sl->next_select_in_list())
- {
- SELECT_LEX_UNIT *unit= sl->master_unit();
- unit->reinit_exec_mechanism(); // reset unit->prepared flags
- /*
- Reset 'clean' flag back to force normal execution of
- unit->cleanup() in Prepared_statement::cleanup_stmt()
- (call to lex->unit.cleanup() above sets this flag to TRUE).
- */
- unit->unclean();
- }
-
- /*
- Also we need to cleanup Natural_join_column::table_field items.
- To not to traverse a join tree we will cleanup whole
- thd->free_list (in PS execution mode that list may not contain
- items from 'fields' list, so the cleanup above is necessary to.
- */
- cleanup_items(thd->free_list);
- cleanup_items(thd->stmt_arena->free_list);
- close_tables_for_reopen(thd, &table_list, start_of_statement_svp);
-
- DEBUG_SYNC(thd, "multi_update_reopen_tables");
-
- goto reopen_tables;
+ DBUG_RETURN(TRUE);
}
+ /* @todo: downgrade the metadata locks here. */
/*
Check that we are not using table that we are updating, but we should
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 2e239a9161c..e14286210b4 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006 MySQL AB, 2009-2010 Sun Microsystems, Inc.
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
How to add new variables:
@@ -647,32 +647,40 @@ static bool event_scheduler_check(sys_var *self, THD *thd, set_var *var)
}
static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type)
{
+ uint opt_event_scheduler_value= Events::opt_event_scheduler;
mysql_mutex_unlock(&LOCK_global_system_variables);
/*
Events::start() is heavyweight. In particular it creates a new THD,
which takes LOCK_global_system_variables internally.
Thus we have to release it here.
We need to re-take it before returning, though.
- And we need to take it *without* holding Events::LOCK_event_metadata.
+
+ Note that since we release LOCK_global_system_variables before calling
+ start/stop, there is a possibility that the server variable
+ can become out of sync with the real event scheduler state.
+
+ This can happen with two concurrent statments if the first gets
+ interrupted after start/stop but before retaking
+ LOCK_global_system_variables. However, this problem should be quite
+ rare and it's difficult to avoid it without opening up possibilities
+ for deadlocks. See bug#51160.
*/
- bool ret= Events::opt_event_scheduler == Events::EVENTS_ON
+ bool ret= opt_event_scheduler_value == Events::EVENTS_ON
? Events::start()
: Events::stop();
- mysql_mutex_unlock(&Events::LOCK_event_metadata);
mysql_mutex_lock(&LOCK_global_system_variables);
- mysql_mutex_lock(&Events::LOCK_event_metadata);
if (ret)
my_error(ER_EVENT_SET_VAR_ERROR, MYF(0));
return ret;
}
-static PolyLock_mutex PLock_event_metadata(&Events::LOCK_event_metadata);
+
static Sys_var_enum Sys_event_scheduler(
"event_scheduler", "Enable the event scheduler. Possible values are "
"ON, OFF, and DISABLED (keep the event scheduler completely "
"deactivated, it cannot be activated run-time)",
GLOBAL_VAR(Events::opt_event_scheduler), CMD_LINE(OPT_ARG),
event_scheduler_names, DEFAULT(Events::EVENTS_OFF),
- &PLock_event_metadata, NOT_IN_BINLOG,
+ NO_MUTEX_GUARD, NOT_IN_BINLOG,
ON_CHECK(event_scheduler_check), ON_UPDATE(event_scheduler_update));
#endif
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 632dca1ce44..7d88b7276f2 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1668,7 +1668,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
open all time zone tables to see if they exist.
*/
if (open_and_lock_tables(thd, tz_tables, FALSE,
- MYSQL_LOCK_IGNORE_FLUSH | MYSQL_LOCK_IGNORE_TIMEOUT))
+ MYSQL_OPEN_IGNORE_FLUSH | MYSQL_LOCK_IGNORE_TIMEOUT))
{
sql_print_warning("Can't open and lock time zone table: %s "
"trying to live without them", thd->stmt_da->message());
diff --git a/sql/udf_example.c b/sql/udf_example.c
index 73256bb5529..fa1b44178ac 100644
--- a/sql/udf_example.c
+++ b/sql/udf_example.c
@@ -107,7 +107,7 @@
** option.
**
** If you can't get AGGREGATES to work, check that you have the column
-** 'type' in the mysql.func table. If not, run 'mysql_fix_privilege_tables'.
+** 'type' in the mysql.func table. If not, run 'mysql_upgrade'.
**
*/
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 42f05530d41..e4f7da5e5f3 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -29,8 +29,6 @@ IF(UNIX)
ADD_DEFINITIONS("-DUNIV_AIX -DUNIX_MUST_NOT_INLINE")
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
ADD_DEFINITIONS("-DUNIV_SOLARIS")
- ELSE()
- ADD_DEFINITIONS("-DUNIV_MUST_NOT_INLINE")
ENDIF()
ENDIF()
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index f02773e73b9..d7c750b81a6 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -849,7 +849,6 @@ fi
%attr(755, root, root) %{_bindir}/myisampack
%attr(755, root, root) %{_bindir}/mysql_convert_table_format
%attr(755, root, root) %{_bindir}/mysql_fix_extensions
-%attr(755, root, root) %{_bindir}/mysql_fix_privilege_tables
%attr(755, root, root) %{_bindir}/mysql_install_db
%attr(755, root, root) %{_bindir}/mysql_secure_installation
%attr(755, root, root) %{_bindir}/mysql_setpermission
@@ -1105,6 +1104,10 @@ fi
- Fix some problems with the directives around "tcmalloc" (experimental),
remove erroneous traces of the InnoDB plugin (that is 5.1 only).
+* Fri Oct 06 2009 Magnus Blaudd <mvensson@mysql.com>
+
+- Removed mysql_fix_privilege_tables
+
* Fri Oct 02 2009 Alexander Nozdrin <alexander.nozdrin@sun.com>
- "mysqlmanager" got removed from version 5.4, all references deleted.