Local merge

This commit is contained in:
Marc Alff 2010-11-16 06:59:26 +01:00
commit d6d16303cd
49 changed files with 2069 additions and 233 deletions

View file

@ -331,23 +331,33 @@ ELSE()
SET(CPACK_GENERATOR "TGZ")
ENDIF()
ADD_SUBDIRECTORY(packaging/WiX)
# Create a single package with "make package"
# (see http://public.kitware.com/Bug/view.php?id=11452)
SET(CPACK_MONOLITHIC_INSTALL 1 CACHE INTERNAL "")
INCLUDE(CPack)
IF(UNIX)
INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL)
INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL COMPONENT Info)
ENDIF()
#
# RPM installs documentation directly from the source tree
#
IF(NOT INSTALL_LAYOUT MATCHES "RPM")
INSTALL(FILES COPYING EXCEPTIONS-CLIENT LICENSE.mysql DESTINATION ${INSTALL_DOCREADMEDIR} OPTIONAL)
INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR})
INSTALL(FILES COPYING EXCEPTIONS-CLIENT LICENSE.mysql
DESTINATION ${INSTALL_DOCREADMEDIR}
COMPONENT Readme
OPTIONAL
)
INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme)
IF(UNIX)
INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR})
INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme)
ENDIF()
# MYSQL_DOCS_LOCATON is used in "make dist", points to the documentation directory
SET(MYSQL_DOCS_LOCATION "" CACHE PATH "Location from where documentation is copied")
MARK_AS_ADVANCED(MYSQL_DOCS_LOCATION)
INSTALL(DIRECTORY Docs/ DESTINATION ${INSTALL_DOCDIR}
COMPONENT Documentation
PATTERN "INSTALL-BINARY" EXCLUDE
PATTERN "Makefile.*" EXCLUDE
PATTERN "glibc*" EXCLUDE

View file

@ -185,6 +185,11 @@ foreach my $option (@ARGV)
($option =~ /enable/ ? "1" : "0");
next;
}
if ($option =~ /with-comment=/)
{
$cmakeargs = $cmakeargs." \"-DWITH_COMMENT=".substr($option,13)."\"";
next;
}
$option = uc($option);
$option =~ s/-/_/g;

View file

@ -78,7 +78,9 @@ FUNCTION(INSTALL_MANPAGE file)
ELSE()
SET(SECTION man8)
ENDIF()
INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}")
MESSAGE("huj!")
INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}"
COMPONENT ManPages)
ENDIF()
ENDFUNCTION()
@ -137,12 +139,7 @@ IF(UNIX)
STRING(REPLACE "${CMAKE_CFG_INTDIR}"
"\${CMAKE_INSTALL_CONFIG_NAME}" output ${output})
ENDIF()
IF(component)
SET(COMP COMPONENT ${component})
ELSE()
SET(COMP)
ENDIF()
INSTALL(FILES ${output} DESTINATION ${destination} ${COMP})
INSTALL(FILES ${output} DESTINATION ${destination} COMPONENT ${component})
ENDIF()
ENDMACRO()
@ -224,8 +221,6 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
IF(SIGNCODE AND SIGNCODE_ENABLED)
SIGN_TARGET(${target})
ENDIF()
# For Windows, add version info to executables
ADD_VERSION_INFO(${target})
# Install man pages on Unix
IF(UNIX)
GET_TARGET_PROPERTY(target_location ${target} LOCATION)

View file

@ -250,6 +250,9 @@ MACRO(MERGE_LIBRARIES)
ENDFOREACH()
ENDIF()
CREATE_EXPORT_FILE(SRC ${TARGET} "${ARG_EXPORTS}")
IF(NOT ARG_NOINSTALL)
ADD_VERSION_INFO(${TARGET} SHARED SRC)
ENDIF()
ADD_LIBRARY(${TARGET} ${LIBTYPE} ${SRC})
TARGET_LINK_LIBRARIES(${TARGET} ${LIBS})
IF(ARG_OUTPUT_NAME)

View file

@ -37,7 +37,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
LIST(REMOVE_AT ARG_DEFAULT_ARGS 0)
SET(sources ${ARG_DEFAULT_ARGS})
ADD_VERSION_INFO(${target} EXECUTABLE sources)
ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
# tell CPack where to install
IF(NOT ARG_EXCLUDE_FROM_ALL)

View file

@ -133,9 +133,8 @@ ENDIF()
# Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
# for more info.
IF(MSVC)
GET_TARGET_PROPERTY(location gen_versioninfo LOCATION)
IF(NOT location)
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
SET(FILETYPE VFT_APP)
CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in
${CMAKE_BINARY_DIR}/versioninfo_exe.rc)
@ -143,31 +142,14 @@ IF(MSVC)
SET(FILETYPE VFT_DLL)
CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in
${CMAKE_BINARY_DIR}/versioninfo_dll.rc)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_BINARY_DIR}/versioninfo_exe.res
${CMAKE_BINARY_DIR}/versioninfo_dll.res
COMMAND ${CMAKE_RC_COMPILER} versioninfo_exe.rc
COMMAND ${CMAKE_RC_COMPILER} versioninfo_dll.rc
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
ADD_CUSTOM_TARGET(gen_versioninfo
DEPENDS
${CMAKE_BINARY_DIR}/versioninfo_exe.res
${CMAKE_BINARY_DIR}/versioninfo_dll.res
)
ENDIF()
FUNCTION(ADD_VERSION_INFO target)
GET_TARGET_PROPERTY(target_type ${target} TYPE)
ADD_DEPENDENCIES(${target} gen_versioninfo)
IF(target_type MATCHES "SHARED" OR target_type MATCHES "MODULE")
SET_PROPERTY(TARGET ${target} APPEND PROPERTY LINK_FLAGS
"\"${CMAKE_BINARY_DIR}/versioninfo_dll.res\"")
ELSEIF(target_type MATCHES "EXE")
SET_PROPERTY(TARGET ${target} APPEND PROPERTY LINK_FLAGS
"${target_link_flags} \"${CMAKE_BINARY_DIR}/versioninfo_exe.res\"")
FUNCTION(ADD_VERSION_INFO target target_type sources_var)
IF("${target_type}" MATCHES "SHARED" OR "${target_type}" MATCHES "MODULE")
SET(rcfile ${CMAKE_BINARY_DIR}/versioninfo_dll.rc)
ELSEIF("${target_type}" MATCHES "EXE")
SET(rcfile ${CMAKE_BINARY_DIR}/versioninfo_exe.rc)
ENDIF()
SET(${sources_var} ${${sources_var}} ${rcfile} PARENT_SCOPE)
ENDFUNCTION()
ELSE()
FUNCTION(ADD_VERSION_INFO)

View file

@ -151,6 +151,7 @@ MACRO(MYSQL_ADD_PLUGIN)
ENDIF()
ENDIF()
ADD_VERSION_INFO(${target} MODULE SOURCES)
ADD_LIBRARY(${target} MODULE ${SOURCES})
DTRACE_INSTRUMENT(${target})
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX ""

View file

@ -172,7 +172,7 @@ IF(UNIX)
SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION})
ENDIF()
ENDMACRO()
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} COMPONENT SharedLibraries)
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} Development)
ENDIF()
IF(NOT DISABLE_SHARED)
@ -210,7 +210,7 @@ IF(NOT DISABLE_SHARED)
"${CMAKE_SHARED_LIBRARY_SUFFIX}"
""
linkname)
INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries)
INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries)
SET(OS_SHARED_LIB_SYMLINKS "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}")
LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS)
FOREACH(ver ${OS_SHARED_LIB_SYMLINKS})
@ -219,7 +219,7 @@ IF(NOT DISABLE_SHARED)
"${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${ver}"
linkname)
INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries)
INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries)
ENDFOREACH()
ENDIF()
ENDIF()

View file

@ -22,4 +22,4 @@ SET(MYSQLSERVICES_SOURCES
my_thread_scheduler_service.c)
ADD_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR})
INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)

View file

@ -21,8 +21,10 @@ IF(MAN1_FILES)
IF(MAN1_EXCLUDE)
LIST(REMOVE_ITEM MAN1_FILES ${MAN1_EXCLUDE})
ENDIF()
INSTALL(FILES ${MAN1_FILES} DESTINATION ${INSTALL_MANDIR}/man1)
INSTALL(FILES ${MAN1_FILES} DESTINATION ${INSTALL_MANDIR}/man1
COMPONENT ManPages)
ENDIF()
IF(MAN8_FILES)
INSTALL(FILES ${MAN8_FILES} DESTINATION ${INSTALL_MANDIR}/man8)
INSTALL(FILES ${MAN8_FILES} DESTINATION ${INSTALL_MANDIR}/man8
COMPONENT ManPages)
ENDIF()

View file

@ -53,7 +53,8 @@ IF(UNIX)
IF(INSTALL_MYSQLTESTDIR)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run
DESTINATION ${INSTALL_MYSQLTESTDIR})
DESTINATION ${INSTALL_MYSQLTESTDIR}
COMPONENT Test)
ENDIF()
ENDIF()

View file

@ -1,2 +1,2 @@
perl mysql-test-run.pl --timer --force --comment=1st --experimental=collections/default.experimental 1st
perl mysql-test-run.pl --timer --force --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_1_2_ndb parts.partition_alter1_1_ndb parts.partition_alter1_2_innodb parts.partition_alter1_2_ndb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb main.variables-big rpl_ndb.rpl_truncate_7ndb_2
perl mysql-test-run.pl --timer --force --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 large_tests.alter_table main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_1_2_ndb parts.partition_alter1_1_ndb parts.partition_alter1_2_innodb parts.partition_alter1_2_ndb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb rpl_ndb.rpl_truncate_7ndb_2

View file

@ -30,6 +30,7 @@ FILES TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARAMETERS SPECIFIC_SCHEMA
PARTITIONS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
PROCESSLIST ID
@ -42,6 +43,7 @@ SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
STATISTICS TABLE_SCHEMA
TABLES TABLE_SCHEMA
TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
TABLE_PRIVILEGES TABLE_SCHEMA
TRIGGERS TRIGGER_SCHEMA
@ -74,6 +76,7 @@ FILES TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARAMETERS SPECIFIC_SCHEMA
PARTITIONS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
PROCESSLIST ID
@ -86,6 +89,7 @@ SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
STATISTICS TABLE_SCHEMA
TABLES TABLE_SCHEMA
TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
TABLE_PRIVILEGES TABLE_SCHEMA
TRIGGERS TRIGGER_SCHEMA

View file

@ -14,3 +14,32 @@ flush privileges;
ERROR HY000: Table 'host' was not locked with LOCK TABLES
unlock tables;
drop table t1;
#
# Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN
#
CREATE USER nopriv_user@localhost;
connection: default
DROP TABLE IF EXISTS t1,t2,t3;
DROP FUNCTION IF EXISTS f;
CREATE TABLE t1 (key1 INT PRIMARY KEY);
CREATE TABLE t2 (key2 INT);
INSERT INTO t1 VALUES (1),(2);
CREATE FUNCTION f() RETURNS INT RETURN 1;
GRANT FILE ON *.* TO 'nopriv_user'@'localhost';
FLUSH PRIVILEGES;
connection: con1
SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE 'mytest';
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1;
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1;
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
CREATE TABLE t3 (i INT) AS SELECT MAX(key1) FROM t1 WHERE f() < 1;
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
connection: default
DROP TABLE t1,t2;
DROP FUNCTION f;
DROP USER nopriv_user@localhost;
#
# End Bug#54812
#

View file

@ -1,5 +1,38 @@
drop table if exists t1, t2;
#
# Bug#57778: failed primary key add to partitioned innodb table
# inconsistent and crashes
#
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL)
PARTITION BY KEY (a) PARTITIONS 2;
INSERT INTO t1 VALUES (0,1), (0,2);
ALTER TABLE t1 ADD PRIMARY KEY (a);
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 2 */
SELECT * FROM t1;
a b
0 1
0 2
UPDATE t1 SET a = 1, b = 1 WHERE a = 0 AND b = 2;
ALTER TABLE t1 ADD PRIMARY KEY (a);
SELECT * FROM t1;
a b
1 1
0 1
ALTER TABLE t1 DROP PRIMARY KEY;
SELECT * FROM t1;
a b
1 1
0 1
DROP TABLE t1;
#
# Bug#57113: ha_partition::extra(ha_extra_function):
# Assertion `m_extra_cache' failed
CREATE TABLE t1

View file

@ -3202,6 +3202,510 @@ test1
DROP PROCEDURE p1;
DROP PROCEDURE p2;
TINYINT
CREATE PROCEDURE p1(OUT v TINYINT)
SET v = 127;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = 127;
@a @a = 127
127 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
SMALLINT
CREATE PROCEDURE p1(OUT v SMALLINT)
SET v = 32767;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = 32767;
@a @a = 32767
32767 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
MEDIUMINT
CREATE PROCEDURE p1(OUT v MEDIUMINT)
SET v = 8388607;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = 8388607;
@a @a = 8388607
8388607 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
INT
CREATE PROCEDURE p1(OUT v INT)
SET v = 2147483647;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = 2147483647;
@a @a = 2147483647
2147483647 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
BIGINT
CREATE PROCEDURE p1(OUT v BIGINT)
SET v = 9223372036854775807;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = 9223372036854775807;
@a @a = 9223372036854775807
9223372036854775807 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
BIT(11)
CREATE PROCEDURE p1(OUT v BIT(11))
SET v = b'10100100101';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = b'10100100101';
@a @a = b'10100100101'
1317 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
TIMESTAMP
CREATE PROCEDURE p1(OUT v TIMESTAMP)
SET v = '2007-11-18 15:01:02';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = '2007-11-18 15:01:02';
@a @a = '2007-11-18 15:01:02'
2007-11-18 15:01:02 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
DATETIME
CREATE PROCEDURE p1(OUT v DATETIME)
SET v = '1234-11-12 12:34:59';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = '1234-11-12 12:34:59';
@a @a = '1234-11-12 12:34:59'
1234-11-12 12:34:59 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
TIME
CREATE PROCEDURE p1(OUT v TIME)
SET v = '123:45:01';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = '123:45:01';
@a @a = '123:45:01'
123:45:01 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
DATE
CREATE PROCEDURE p1(OUT v DATE)
SET v = '1234-11-12';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = '1234-11-12';
@a @a = '1234-11-12'
1234-11-12 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
YEAR
CREATE PROCEDURE p1(OUT v YEAR)
SET v = 2010;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = 2010;
@a @a = 2010
2010 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
FLOAT(7, 4)
CREATE PROCEDURE p1(OUT v FLOAT(7, 4))
SET v = 123.4567;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a - 123.4567 < 0.00001;
@a @a - 123.4567 < 0.00001
123.45670318603516 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
DOUBLE(8, 5)
CREATE PROCEDURE p1(OUT v DOUBLE(8, 5))
SET v = 123.45678;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a - 123.45678 < 0.000001;
@a @a - 123.45678 < 0.000001
123.45678 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
DECIMAL(9, 6)
CREATE PROCEDURE p1(OUT v DECIMAL(9, 6))
SET v = 123.456789;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` decimal(65,30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = 123.456789;
@a @a = 123.456789
123.456789 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
CHAR(32)
CREATE PROCEDURE p1(OUT v CHAR(32))
SET v = REPEAT('a', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('a', 16);
@a @a = REPEAT('a', 16)
aaaaaaaaaaaaaaaa 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
VARCHAR(32)
CREATE PROCEDURE p1(OUT v VARCHAR(32))
SET v = REPEAT('b', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('b', 16);
@a @a = REPEAT('b', 16)
bbbbbbbbbbbbbbbb 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
TINYTEXT
CREATE PROCEDURE p1(OUT v TINYTEXT)
SET v = REPEAT('c', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('c', 16);
@a @a = REPEAT('c', 16)
cccccccccccccccc 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
TEXT
CREATE PROCEDURE p1(OUT v TEXT)
SET v = REPEAT('d', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('d', 16);
@a @a = REPEAT('d', 16)
dddddddddddddddd 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
MEDIUMTEXT
CREATE PROCEDURE p1(OUT v MEDIUMTEXT)
SET v = REPEAT('e', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('e', 16);
@a @a = REPEAT('e', 16)
eeeeeeeeeeeeeeee 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
LONGTEXT
CREATE PROCEDURE p1(OUT v LONGTEXT)
SET v = REPEAT('f', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('f', 16);
@a @a = REPEAT('f', 16)
ffffffffffffffff 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
BINARY(32)
CREATE PROCEDURE p1(OUT v BINARY(32))
SET v = REPEAT('g', 32);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('g', 32);
@a @a = REPEAT('g', 32)
gggggggggggggggggggggggggggggggg 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
VARBINARY(32)
CREATE PROCEDURE p1(OUT v VARBINARY(32))
SET v = REPEAT('h', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('h', 16);
@a @a = REPEAT('h', 16)
hhhhhhhhhhhhhhhh 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
TINYBLOB
CREATE PROCEDURE p1(OUT v TINYBLOB)
SET v = REPEAT('i', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('i', 16);
@a @a = REPEAT('i', 16)
iiiiiiiiiiiiiiii 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
BLOB
CREATE PROCEDURE p1(OUT v BLOB)
SET v = REPEAT('j', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('j', 16);
@a @a = REPEAT('j', 16)
jjjjjjjjjjjjjjjj 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
MEDIUMBLOB
CREATE PROCEDURE p1(OUT v MEDIUMBLOB)
SET v = REPEAT('k', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('k', 16);
@a @a = REPEAT('k', 16)
kkkkkkkkkkkkkkkk 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
LONGBLOB
CREATE PROCEDURE p1(OUT v LONGBLOB)
SET v = REPEAT('l', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = REPEAT('l', 16);
@a @a = REPEAT('l', 16)
llllllllllllllll 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
SET('aaa', 'bbb')
CREATE PROCEDURE p1(OUT v SET('aaa', 'bbb'))
SET v = 'aaa';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = 'aaa';
@a @a = 'aaa'
aaa 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
ENUM('aaa', 'bbb')
CREATE PROCEDURE p1(OUT v ENUM('aaa', 'bbb'))
SET v = 'aaa';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
Table Create Table
tmp1 CREATE TEMPORARY TABLE `tmp1` (
`c1` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT @a, @a = 'aaa';
@a @a = 'aaa'
aaa 1
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
# End of WL#4435.
#
# WL#4284: Transactional DDL locking

View file

@ -1,20 +1,20 @@
SET SESSION transaction_prealloc_size=1024*1024*1024*1;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST
<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST
SET SESSION transaction_prealloc_size=1024*1024*1024*2;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST
<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST
SET SESSION transaction_prealloc_size=1024*1024*1024*3;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST
<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST
SET SESSION transaction_prealloc_size=1024*1024*1024*4;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST
<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST
SET SESSION transaction_prealloc_size=1024*1024*1024*5;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST
<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST

View file

@ -105,6 +105,30 @@ OPTIMIZE TABLE t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
if (!$skip_update)
{
eval CREATE TABLE t1
(a INT NULL AUTO_INCREMENT,
UNIQUE KEY (a))
ENGINE=$engine;
SET LAST_INSERT_ID = 999;
SET INSERT_ID = 0;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
SELECT * FROM t1;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
SELECT * FROM t1;
UPDATE t1 SET a = 1 WHERE a IS NULL;
SELECT LAST_INSERT_ID();
SELECT * FROM t1;
UPDATE t1 SET a = NULL WHERE a = 1;
SELECT LAST_INSERT_ID();
SELECT * FROM t1;
DROP TABLE t1;
SET INSERT_ID = 1;
}
-- echo # Simple test with NULL
eval CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
@ -831,5 +855,30 @@ SELECT * FROM t ORDER BY c1 ASC;
DROP TABLE t;
if (!$skip_update)
{
eval CREATE TABLE t1
(a INT NULL AUTO_INCREMENT,
UNIQUE KEY (a))
ENGINE=$engine
PARTITION BY KEY(a) PARTITIONS 2;
SET LAST_INSERT_ID = 999;
SET INSERT_ID = 0;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
SELECT * FROM t1;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
SELECT * FROM t1;
UPDATE t1 SET a = 1 WHERE a IS NULL;
SELECT LAST_INSERT_ID();
SELECT * FROM t1;
UPDATE t1 SET a = NULL WHERE a = 1;
SELECT LAST_INSERT_ID();
SELECT * FROM t1;
DROP TABLE t1;
}
--echo ##############################################################################
}

View file

@ -120,6 +120,38 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1
(a INT NULL AUTO_INCREMENT,
UNIQUE KEY (a))
ENGINE='Blackhole';
SET LAST_INSERT_ID = 999;
SET INSERT_ID = 0;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
UPDATE t1 SET a = 1 WHERE a IS NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
UPDATE t1 SET a = NULL WHERE a = 1;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
DROP TABLE t1;
SET INSERT_ID = 1;
# Simple test with NULL
CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,

View file

@ -136,6 +136,42 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1
(a INT NULL AUTO_INCREMENT,
UNIQUE KEY (a))
ENGINE='InnoDB';
SET LAST_INSERT_ID = 999;
SET INSERT_ID = 0;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
1
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = 1 WHERE a IS NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = NULL WHERE a = 1;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
DROP TABLE t1;
SET INSERT_ID = 1;
# Simple test with NULL
CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
@ -1023,4 +1059,40 @@ c1 c2
2 20
127 40
DROP TABLE t;
CREATE TABLE t1
(a INT NULL AUTO_INCREMENT,
UNIQUE KEY (a))
ENGINE='InnoDB'
PARTITION BY KEY(a) PARTITIONS 2;
SET LAST_INSERT_ID = 999;
SET INSERT_ID = 0;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
1
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = 1 WHERE a IS NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = NULL WHERE a = 1;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
DROP TABLE t1;
##############################################################################

View file

@ -136,6 +136,42 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=MEMORY AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1
(a INT NULL AUTO_INCREMENT,
UNIQUE KEY (a))
ENGINE='Memory';
SET LAST_INSERT_ID = 999;
SET INSERT_ID = 0;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
1
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = 1 WHERE a IS NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = NULL WHERE a = 1;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
DROP TABLE t1;
SET INSERT_ID = 1;
# Simple test with NULL
CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
@ -1051,4 +1087,40 @@ c1 c2
2 20
127 40
DROP TABLE t;
CREATE TABLE t1
(a INT NULL AUTO_INCREMENT,
UNIQUE KEY (a))
ENGINE='Memory'
PARTITION BY KEY(a) PARTITIONS 2;
SET LAST_INSERT_ID = 999;
SET INSERT_ID = 0;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
1
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = 1 WHERE a IS NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = NULL WHERE a = 1;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
DROP TABLE t1;
##############################################################################

View file

@ -136,6 +136,42 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=MyISAM AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1
(a INT NULL AUTO_INCREMENT,
UNIQUE KEY (a))
ENGINE='MyISAM';
SET LAST_INSERT_ID = 999;
SET INSERT_ID = 0;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
1
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = 1 WHERE a IS NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = NULL WHERE a = 1;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
DROP TABLE t1;
SET INSERT_ID = 1;
# Simple test with NULL
CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
@ -1070,4 +1106,40 @@ c1 c2
2 20
127 40
DROP TABLE t;
CREATE TABLE t1
(a INT NULL AUTO_INCREMENT,
UNIQUE KEY (a))
ENGINE='MyISAM'
PARTITION BY KEY(a) PARTITIONS 2;
SET LAST_INSERT_ID = 999;
SET INSERT_ID = 0;
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
1
INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = 1 WHERE a IS NULL;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
UPDATE t1 SET a = NULL WHERE a = 1;
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
999
SELECT * FROM t1;
a
0
DROP TABLE t1;
##############################################################################

View file

@ -15,3 +15,8 @@ query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails spo
ctype_utf8mb4_ndb : Bug#55799, Bug#51907, disabled by Konstantin 2010-08-06
main.mysqlhotcopy_myisam : Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
main.mysqlhotcopy_archive: Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
log_tables-big : Bug#48646 2010-11-15 mattiasj report already exists
read_many_rows_innodb : Bug#37635 2010-11-15 mattiasj report already exists
sum_distinct-big : Bug#56927 2010-11-15 mattiasj was not tested
alter_table-big : Bug#37248 2010-11-15 mattiasj was not tested
create-big : Bug#37248 2010-11-15 mattiasj was not tested

View file

@ -54,3 +54,57 @@ lock tables t1 read;
flush privileges;
unlock tables;
drop table t1;
--echo #
--echo # Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN
--echo #
CREATE USER nopriv_user@localhost;
connection default;
--echo connection: default
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3;
DROP FUNCTION IF EXISTS f;
--enable_warnings
CREATE TABLE t1 (key1 INT PRIMARY KEY);
CREATE TABLE t2 (key2 INT);
INSERT INTO t1 VALUES (1),(2);
CREATE FUNCTION f() RETURNS INT RETURN 1;
GRANT FILE ON *.* TO 'nopriv_user'@'localhost';
FLUSH PRIVILEGES;
connect (con1,localhost,nopriv_user,,);
connection con1;
--echo connection: con1
--error ER_PROCACCESS_DENIED_ERROR
SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE 'mytest';
--error ER_PROCACCESS_DENIED_ERROR
INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1;
--error ER_PROCACCESS_DENIED_ERROR
SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1;
--error ER_PROCACCESS_DENIED_ERROR
CREATE TABLE t3 (i INT) AS SELECT MAX(key1) FROM t1 WHERE f() < 1;
disconnect con1;
--source include/wait_until_disconnected.inc
connection default;
--echo connection: default
DROP TABLE t1,t2;
DROP FUNCTION f;
DROP USER nopriv_user@localhost;
--echo #
--echo # End Bug#54812
--echo #

View file

@ -14,6 +14,24 @@
drop table if exists t1, t2;
--enable_warnings
--echo #
--echo # Bug#57778: failed primary key add to partitioned innodb table
--echo # inconsistent and crashes
--echo #
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL)
PARTITION BY KEY (a) PARTITIONS 2;
INSERT INTO t1 VALUES (0,1), (0,2);
--error ER_DUP_ENTRY
ALTER TABLE t1 ADD PRIMARY KEY (a);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
UPDATE t1 SET a = 1, b = 1 WHERE a = 0 AND b = 2;
ALTER TABLE t1 ADD PRIMARY KEY (a);
SELECT * FROM t1;
ALTER TABLE t1 DROP PRIMARY KEY;
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # Bug#57113: ha_partition::extra(ha_extra_function):
--echo # Assertion `m_extra_cache' failed

View file

@ -3296,6 +3296,12 @@ SELECT @a;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
###########################################################################
--source t/wl4435_generated.inc
###########################################################################
--echo
--echo # End of WL#4435.

View file

@ -37,19 +37,19 @@
--disable_warnings
SET SESSION transaction_prealloc_size=1024*1024*1024*1;
--replace_column 1 <Id> 6 <Time>
--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*2;
--replace_column 1 <Id> 6 <Time>
--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*3;
--replace_column 1 <Id> 6 <Time>
--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*4;
--replace_column 1 <Id> 6 <Time>
--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*5;
--replace_column 1 <Id> 6 <Time>
--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
--enable_warnings

View file

@ -0,0 +1,588 @@
###########################################################################
--echo
--echo TINYINT
--echo
CREATE PROCEDURE p1(OUT v TINYINT)
SET v = 127;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = 127;
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo SMALLINT
--echo
CREATE PROCEDURE p1(OUT v SMALLINT)
SET v = 32767;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = 32767;
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo MEDIUMINT
--echo
CREATE PROCEDURE p1(OUT v MEDIUMINT)
SET v = 8388607;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = 8388607;
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo INT
--echo
CREATE PROCEDURE p1(OUT v INT)
SET v = 2147483647;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = 2147483647;
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo BIGINT
--echo
CREATE PROCEDURE p1(OUT v BIGINT)
SET v = 9223372036854775807;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = 9223372036854775807;
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo BIT(11)
--echo
CREATE PROCEDURE p1(OUT v BIT(11))
SET v = b'10100100101';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = b'10100100101';
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo TIMESTAMP
--echo
CREATE PROCEDURE p1(OUT v TIMESTAMP)
SET v = '2007-11-18 15:01:02';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = '2007-11-18 15:01:02';
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo DATETIME
--echo
CREATE PROCEDURE p1(OUT v DATETIME)
SET v = '1234-11-12 12:34:59';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = '1234-11-12 12:34:59';
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo TIME
--echo
CREATE PROCEDURE p1(OUT v TIME)
SET v = '123:45:01';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = '123:45:01';
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo DATE
--echo
CREATE PROCEDURE p1(OUT v DATE)
SET v = '1234-11-12';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = '1234-11-12';
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo YEAR
--echo
CREATE PROCEDURE p1(OUT v YEAR)
SET v = 2010;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = 2010;
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo FLOAT(7, 4)
--echo
CREATE PROCEDURE p1(OUT v FLOAT(7, 4))
SET v = 123.4567;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a - 123.4567 < 0.00001;
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo DOUBLE(8, 5)
--echo
CREATE PROCEDURE p1(OUT v DOUBLE(8, 5))
SET v = 123.45678;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a - 123.45678 < 0.000001;
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo DECIMAL(9, 6)
--echo
CREATE PROCEDURE p1(OUT v DECIMAL(9, 6))
SET v = 123.456789;
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = 123.456789;
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo CHAR(32)
--echo
CREATE PROCEDURE p1(OUT v CHAR(32))
SET v = REPEAT('a', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('a', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo VARCHAR(32)
--echo
CREATE PROCEDURE p1(OUT v VARCHAR(32))
SET v = REPEAT('b', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('b', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo TINYTEXT
--echo
CREATE PROCEDURE p1(OUT v TINYTEXT)
SET v = REPEAT('c', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('c', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo TEXT
--echo
CREATE PROCEDURE p1(OUT v TEXT)
SET v = REPEAT('d', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('d', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo MEDIUMTEXT
--echo
CREATE PROCEDURE p1(OUT v MEDIUMTEXT)
SET v = REPEAT('e', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('e', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo LONGTEXT
--echo
CREATE PROCEDURE p1(OUT v LONGTEXT)
SET v = REPEAT('f', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('f', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo BINARY(32)
--echo
CREATE PROCEDURE p1(OUT v BINARY(32))
SET v = REPEAT('g', 32);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('g', 32);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo VARBINARY(32)
--echo
CREATE PROCEDURE p1(OUT v VARBINARY(32))
SET v = REPEAT('h', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('h', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo TINYBLOB
--echo
CREATE PROCEDURE p1(OUT v TINYBLOB)
SET v = REPEAT('i', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('i', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo BLOB
--echo
CREATE PROCEDURE p1(OUT v BLOB)
SET v = REPEAT('j', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('j', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo MEDIUMBLOB
--echo
CREATE PROCEDURE p1(OUT v MEDIUMBLOB)
SET v = REPEAT('k', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('k', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo LONGBLOB
--echo
CREATE PROCEDURE p1(OUT v LONGBLOB)
SET v = REPEAT('l', 16);
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = REPEAT('l', 16);
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo SET('aaa', 'bbb')
--echo
CREATE PROCEDURE p1(OUT v SET('aaa', 'bbb'))
SET v = 'aaa';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = 'aaa';
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;
###########################################################################
--echo
--echo ENUM('aaa', 'bbb')
--echo
CREATE PROCEDURE p1(OUT v ENUM('aaa', 'bbb'))
SET v = 'aaa';
PREPARE stmt1 FROM 'CALL p1(?)';
EXECUTE stmt1 USING @a;
CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
SHOW CREATE TABLE tmp1;
SELECT @a, @a = 'aaa';
DROP TEMPORARY TABLE tmp1;
DROP PROCEDURE p1;

View file

@ -173,7 +173,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
if (file >= 0)
{
pos= my_tell(file, MYF(0));
pos= mysql_file_tell(file, MYF(0));
if ((pos == (my_off_t) -1) && (my_errno == ESPIPE))
{
/*
@ -205,7 +205,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
if (!(cache_myflags & MY_DONT_CHECK_FILESIZE))
{
/* Calculate end of file to avoid allocating oversized buffers */
end_of_file=my_seek(file,0L,MY_SEEK_END,MYF(0));
end_of_file= mysql_file_seek(file, 0L, MY_SEEK_END, MYF(0));
/* Need to reset seek_not_done now that we just did a seek. */
info->seek_not_done= end_of_file == seek_offset ? 0 : 1;
if (end_of_file < seek_offset)
@ -485,7 +485,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
*/
if (info->seek_not_done)
{
if ((my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0))
if ((mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(0))
!= MY_FILEPOS_ERROR))
{
/* No error, reset seek_not_done flag. */
@ -529,7 +529,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
end aligned with a block.
*/
length=(Count & (size_t) ~(IO_SIZE-1))-diff_length;
if ((read_length= my_read(info->file,Buffer, length, info->myflags))
if ((read_length= mysql_file_read(info->file,Buffer, length, info->myflags))
!= length)
{
/*
@ -572,7 +572,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
}
length=0; /* Didn't read any chars */
}
else if ((length= my_read(info->file,info->buffer, max_length,
else if ((length= mysql_file_read(info->file,info->buffer, max_length,
info->myflags)) < Count ||
length == (size_t) -1)
{
@ -1056,7 +1056,7 @@ int _my_b_read_r(register IO_CACHE *cache, uchar *Buffer, size_t Count)
*/
if (cache->seek_not_done)
{
if (my_seek(cache->file, pos_in_file, MY_SEEK_SET, MYF(0))
if (mysql_file_seek(cache->file, pos_in_file, MY_SEEK_SET, MYF(0))
== MY_FILEPOS_ERROR)
{
cache->error= -1;
@ -1064,7 +1064,7 @@ int _my_b_read_r(register IO_CACHE *cache, uchar *Buffer, size_t Count)
DBUG_RETURN(1);
}
}
len= my_read(cache->file, cache->buffer, length, cache->myflags);
len= mysql_file_read(cache->file, cache->buffer, length, cache->myflags);
}
DBUG_PRINT("io_cache_share", ("read %lu bytes", (ulong) len));
@ -1203,7 +1203,7 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
With read-append cache we must always do a seek before we read,
because the write could have moved the file pointer astray
*/
if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) == MY_FILEPOS_ERROR)
if (mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR)
{
info->error= -1;
unlock_append_buffer(info);
@ -1220,8 +1220,8 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
size_t read_length;
length=(Count & (size_t) ~(IO_SIZE-1))-diff_length;
if ((read_length= my_read(info->file,Buffer, length,
info->myflags)) == (size_t) -1)
if ((read_length= mysql_file_read(info->file,Buffer, length,
info->myflags)) == (size_t) -1)
{
info->error= -1;
unlock_append_buffer(info);
@ -1254,7 +1254,7 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
}
else
{
length= my_read(info->file,info->buffer, max_length, info->myflags);
length= mysql_file_read(info->file,info->buffer, max_length, info->myflags);
if (length == (size_t) -1)
{
info->error= -1;
@ -1431,7 +1431,7 @@ int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
return 1;
}
if (my_seek(info->file,next_pos_in_file,MY_SEEK_SET,MYF(0))
if (mysql_file_seek(info->file, next_pos_in_file, MY_SEEK_SET, MYF(0))
== MY_FILEPOS_ERROR)
{
info->error= -1;
@ -1441,8 +1441,8 @@ int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
read_length=IO_SIZE*2- (size_t) (next_pos_in_file & (IO_SIZE-1));
if (Count < read_length)
{ /* Small block, read to cache */
if ((read_length=my_read(info->file,info->request_pos,
read_length, info->myflags)) == (size_t) -1)
if ((read_length=mysql_file_read(info->file,info->request_pos,
read_length, info->myflags)) == (size_t) -1)
return info->error= -1;
use_length=min(Count,read_length);
memcpy(Buffer,info->request_pos,(size_t) use_length);
@ -1462,7 +1462,7 @@ int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
}
else
{ /* Big block, don't cache it */
if ((read_length= my_read(info->file,Buffer, Count,info->myflags))
if ((read_length= mysql_file_read(info->file, Buffer, Count,info->myflags))
!= Count)
{
info->error= read_length == (size_t) -1 ? -1 : read_length+left_length;
@ -1569,14 +1569,14 @@ int _my_b_write(register IO_CACHE *info, const uchar *Buffer, size_t Count)
"seek_not_done" to indicate this to other functions operating
on the IO_CACHE.
*/
if (my_seek(info->file,info->pos_in_file,MY_SEEK_SET,MYF(0)))
if (mysql_file_seek(info->file, info->pos_in_file, MY_SEEK_SET, MYF(0)))
{
info->error= -1;
return (1);
}
info->seek_not_done=0;
}
if (my_write(info->file, Buffer, length, info->myflags | MY_NABP))
if (mysql_file_write(info->file, Buffer, length, info->myflags | MY_NABP))
return info->error= -1;
#ifdef THREAD
@ -1639,7 +1639,7 @@ int my_b_append(register IO_CACHE *info, const uchar *Buffer, size_t Count)
if (Count >= IO_SIZE)
{ /* Fill first intern buffer */
length=Count & (size_t) ~(IO_SIZE-1);
if (my_write(info->file,Buffer, length, info->myflags | MY_NABP))
if (mysql_file_write(info->file,Buffer, length, info->myflags | MY_NABP))
{
unlock_append_buffer(info);
return info->error= -1;
@ -1695,11 +1695,11 @@ int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count,
{
/* Of no overlap, write everything without buffering */
if (pos + Count <= info->pos_in_file)
return my_pwrite(info->file, Buffer, Count, pos,
info->myflags | MY_NABP);
return mysql_file_pwrite(info->file, Buffer, Count, pos,
info->myflags | MY_NABP);
/* Write the part of the block that is before buffer */
length= (uint) (info->pos_in_file - pos);
if (my_pwrite(info->file, Buffer, length, pos, info->myflags | MY_NABP))
if (mysql_file_pwrite(info->file, Buffer, length, pos, info->myflags | MY_NABP))
info->error= error= -1;
Buffer+=length;
pos+= length;
@ -1789,7 +1789,7 @@ int my_b_flush_io_cache(IO_CACHE *info,
*/
if (!append_cache && info->seek_not_done)
{ /* File touched, do seek */
if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) ==
if (mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(0)) ==
MY_FILEPOS_ERROR)
{
UNLOCK_APPEND_BUFFER;
@ -1803,7 +1803,7 @@ int my_b_flush_io_cache(IO_CACHE *info,
info->write_end= (info->write_buffer+info->buffer_length-
((pos_in_file+length) & (IO_SIZE-1)));
if (my_write(info->file,info->write_buffer,length,
if (mysql_file_write(info->file,info->write_buffer,length,
info->myflags | MY_NABP))
info->error= -1;
else
@ -1815,7 +1815,7 @@ int my_b_flush_io_cache(IO_CACHE *info,
else
{
info->end_of_file+=(info->write_pos-info->append_read_pos);
DBUG_ASSERT(info->end_of_file == my_tell(info->file,MYF(0)));
DBUG_ASSERT(info->end_of_file == mysql_file_tell(info->file, MYF(0)));
}
info->append_read_pos=info->write_pos=info->write_buffer;

View file

@ -27,6 +27,12 @@ ENDIF()
SET(ENV{VS_UNICODE_OUTPUT})
# Switch off the monolithic install
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=0 ${CMAKE_BINARY_DIR}
OUTPUT_QUIET
)
INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake)
IF(CPACK_WIX_CONFIG)
@ -318,3 +324,9 @@ EXECUTE_PROCESS(
${EXTRA_LIGHT_ARGS}
)
# Switch monolithic install on again
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=1 ${CMAKE_BINARY_DIR}
OUTPUT_QUIET
)

View file

@ -310,7 +310,7 @@ IF(WIN32)
FOREACH(file ${SH_FILES})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY)
INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT ${${file}_COMPONENT})
INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT Server_Scripts)
ENDFOREACH()
ELSE()
# On Unix, most of the files end up in the bin directory

View file

@ -26,13 +26,13 @@ ELSE()
ENDIF()
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Data/ATIS
DESTINATION ${prefix}sql-bench/Data)
DESTINATION ${prefix}sql-bench/Data COMPONENT SqlBench)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Data/Wisconsin
DESTINATION ${prefix}sql-bench/Data)
DESTINATION ${prefix}sql-bench/Data COMPONENT SqlBench)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/limits
DESTINATION ${prefix}sql-bench)
DESTINATION ${prefix}sql-bench COMPONENT SqlBench)
FILE(GLOB all_files ${CMAKE_CURRENT_SOURCE_DIR}/*)
@ -54,10 +54,10 @@ FOREACH(file ${all_files})
CONFIGURE_FILE(${file} ${target} COPYONLY)
IF (ext MATCHES ".bat")
IF(WIN32)
INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench)
INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench COMPONENT SqlBench)
ENDIF()
ELSE()
INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench)
INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench COMPONENT SqlBench)
ENDIF()
ENDIF()
ENDFOREACH()

View file

@ -283,7 +283,7 @@ IF(WIN32 AND MYSQLD_EXECUTABLE)
COMPONENT DataFiles PATTERN "initdb.dep" EXCLUDE PATTERN "bootstrap.sql" EXCLUDE)
ELSE()
# Not windows or cross compiling, just install an empty directory
INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql)
INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles)
ENDIF()
ENDIF()

View file

@ -3093,7 +3093,9 @@ int ha_partition::write_row(uchar * buf)
bool have_auto_increment= table->next_number_field && buf == table->record[0];
my_bitmap_map *old_map;
THD *thd= ha_thd();
timestamp_auto_set_type orig_timestamp_type= table->timestamp_field_type;
timestamp_auto_set_type saved_timestamp_type= table->timestamp_field_type;
ulong saved_sql_mode= thd->variables.sql_mode;
bool saved_auto_inc_field_not_null= table->auto_increment_field_not_null;
#ifdef NOT_NEEDED
uchar *rec0= m_rec0;
#endif
@ -3129,6 +3131,22 @@ int ha_partition::write_row(uchar * buf)
*/
if (error)
goto exit;
/*
Don't allow generation of auto_increment value the partitions handler.
If a partitions handler would change the value, then it might not
match the partition any longer.
This can occur if 'SET INSERT_ID = 0; INSERT (NULL)',
So allow this by adding 'MODE_NO_AUTO_VALUE_ON_ZERO' to sql_mode.
The partitions handler::next_insert_id must always be 0. Otherwise
we need to forward release_auto_increment, or reset it for all
partitions.
*/
if (table->next_number_field->val_int() == 0)
{
table->auto_increment_field_not_null= TRUE;
thd->variables.sql_mode|= MODE_NO_AUTO_VALUE_ON_ZERO;
}
}
old_map= dbug_tmp_use_all_columns(table, table->read_set);
@ -3162,7 +3180,9 @@ int ha_partition::write_row(uchar * buf)
set_auto_increment_if_higher(table->next_number_field);
reenable_binlog(thd);
exit:
table->timestamp_field_type= orig_timestamp_type;
thd->variables.sql_mode= saved_sql_mode;
table->auto_increment_field_not_null= saved_auto_inc_field_not_null;
table->timestamp_field_type= saved_timestamp_type;
DBUG_RETURN(error);
}
@ -3229,11 +3249,24 @@ int ha_partition::update_row(const uchar *old_data, uchar *new_data)
}
else
{
Field *saved_next_number_field= table->next_number_field;
/*
Don't allow generation of auto_increment value for update.
table->next_number_field is never set on UPDATE.
But is set for INSERT ... ON DUPLICATE KEY UPDATE,
and since update_row() does not generate or update an auto_inc value,
we cannot have next_number_field set when moving a row
to another partition with write_row(), since that could
generate/update the auto_inc value.
This gives the same behavior for partitioned vs non partitioned tables.
*/
table->next_number_field= NULL;
DBUG_PRINT("info", ("Update from partition %d to partition %d",
old_part_id, new_part_id));
tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
error= m_file[new_part_id]->ha_write_row(new_data);
reenable_binlog(thd);
table->next_number_field= saved_next_number_field;
if (error)
goto exit;
@ -6375,9 +6408,42 @@ bool ha_partition::get_error_message(int error, String *buf)
*/
uint ha_partition::alter_table_flags(uint flags)
{
uint flags_to_return, flags_to_check;
DBUG_ENTER("ha_partition::alter_table_flags");
DBUG_RETURN(ht->alter_table_flags(flags) |
m_file[0]->alter_table_flags(flags));
flags_to_return= ht->alter_table_flags(flags);
flags_to_return|= m_file[0]->alter_table_flags(flags);
/*
If one partition fails we must be able to revert the change for the other,
already altered, partitions. So both ADD and DROP can only be supported in
pairs.
*/
flags_to_check= HA_ONLINE_ADD_INDEX_NO_WRITES;
flags_to_check|= HA_ONLINE_DROP_INDEX_NO_WRITES;
if ((flags_to_return & flags_to_check) != flags_to_check)
flags_to_return&= ~flags_to_check;
flags_to_check= HA_ONLINE_ADD_UNIQUE_INDEX_NO_WRITES;
flags_to_check|= HA_ONLINE_DROP_UNIQUE_INDEX_NO_WRITES;
if ((flags_to_return & flags_to_check) != flags_to_check)
flags_to_return&= ~flags_to_check;
flags_to_check= HA_ONLINE_ADD_PK_INDEX_NO_WRITES;
flags_to_check|= HA_ONLINE_DROP_PK_INDEX_NO_WRITES;
if ((flags_to_return & flags_to_check) != flags_to_check)
flags_to_return&= ~flags_to_check;
flags_to_check= HA_ONLINE_ADD_INDEX;
flags_to_check|= HA_ONLINE_DROP_INDEX;
if ((flags_to_return & flags_to_check) != flags_to_check)
flags_to_return&= ~flags_to_check;
flags_to_check= HA_ONLINE_ADD_UNIQUE_INDEX;
flags_to_check|= HA_ONLINE_DROP_UNIQUE_INDEX;
if ((flags_to_return & flags_to_check) != flags_to_check)
flags_to_return&= ~flags_to_check;
flags_to_check= HA_ONLINE_ADD_PK_INDEX;
flags_to_check|= HA_ONLINE_DROP_PK_INDEX;
if ((flags_to_return & flags_to_check) != flags_to_check)
flags_to_return&= ~flags_to_check;
DBUG_RETURN(flags_to_return);
}
@ -6412,6 +6478,7 @@ int ha_partition::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
handler **file;
int ret= 0;
DBUG_ENTER("ha_partition::add_index");
/*
There has already been a check in fix_partition_func in mysql_alter_table
before this call, which checks for unique/primary key violations of the
@ -6419,8 +6486,28 @@ int ha_partition::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
*/
for (file= m_file; *file; file++)
if ((ret= (*file)->add_index(table_arg, key_info, num_of_keys)))
break;
return ret;
goto err;
DBUG_RETURN(ret);
err:
if (file > m_file)
{
uint *key_numbers= (uint*) ha_thd()->alloc(sizeof(uint) * num_of_keys);
uint old_num_of_keys= table_arg->s->keys;
uint i;
/* The newly created keys have the last id's */
for (i= 0; i < num_of_keys; i++)
key_numbers[i]= i + old_num_of_keys;
if (!table_arg->key_info)
table_arg->key_info= key_info;
while (--file >= m_file)
{
(void) (*file)->prepare_drop_index(table_arg, key_numbers, num_of_keys);
(void) (*file)->final_drop_index(table_arg);
}
if (table_arg->key_info == key_info)
table_arg->key_info= NULL;
}
DBUG_RETURN(ret);
}

View file

@ -174,6 +174,8 @@
/*
These bits are set if different kinds of indexes can be created
off-line without re-create of the table (but with a table lock).
Partitioning needs both ADD and DROP to be supported by its underlying
handlers, due to error handling, see bug#57778.
*/
#define HA_ONLINE_ADD_INDEX_NO_WRITES (1L << 0) /*add index w/lock*/
#define HA_ONLINE_DROP_INDEX_NO_WRITES (1L << 1) /*drop index w/lock*/

View file

@ -226,8 +226,6 @@ bool Item::val_bool()
*/
String *Item::val_str_ascii(String *str)
{
DBUG_ASSERT(fixed == 1);
if (!(collation.collation->state & MY_CS_NONASCII))
return val_str(str);
@ -3459,19 +3457,16 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it)
str_value.charset());
collation.set(str_value.charset(), DERIVATION_COERCIBLE);
decimals= 0;
param_type= MYSQL_TYPE_STRING;
break;
}
case REAL_RESULT:
set_double(arg->val_real());
param_type= MYSQL_TYPE_DOUBLE;
break;
case INT_RESULT:
set_int(arg->val_int(), arg->max_length);
param_type= MYSQL_TYPE_LONG;
break;
case DECIMAL_RESULT:
@ -3483,8 +3478,6 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it)
return TRUE;
set_decimal(dv);
param_type= MYSQL_TYPE_NEWDECIMAL;
break;
}
@ -3516,6 +3509,7 @@ void
Item_param::set_out_param_info(Send_field *info)
{
m_out_param_info= info;
param_type= m_out_param_info->type;
}
@ -3561,6 +3555,7 @@ void Item_param::make_field(Send_field *field)
field->org_table_name= m_out_param_info->org_table_name;
field->col_name= m_out_param_info->col_name;
field->org_col_name= m_out_param_info->org_col_name;
field->length= m_out_param_info->length;
field->charsetnr= m_out_param_info->charsetnr;
field->flags= m_out_param_info->flags;

View file

@ -2177,7 +2177,11 @@ bool MYSQL_LOG::init_and_set_log_file_name(const char *log_name,
1 error
*/
bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
bool MYSQL_LOG::open(
#ifdef HAVE_PSI_INTERFACE
PSI_file_key log_file_key,
#endif
const char *log_name, enum_log_type log_type_arg,
const char *new_name, enum cache_type io_cache_type_arg)
{
char buff[FN_REFLEN];
@ -2205,7 +2209,12 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
db[0]= 0;
if ((file= mysql_file_open(key_file_MYSQL_LOG,
#ifdef HAVE_PSI_INTERFACE
/* Keep the key for reopen */
m_log_file_key= log_file_key;
#endif
if ((file= mysql_file_open(log_file_key,
log_file_name, open_flags,
MYF(MY_WME | ME_WAITTANG))) < 0 ||
init_io_cache(&log_file, file, IO_SIZE, io_cache_type,
@ -2389,7 +2398,11 @@ void MYSQL_QUERY_LOG::reopen_file()
Note that at this point, log_state != LOG_CLOSED (important for is_open()).
*/
open(save_name, log_type, 0, io_cache_type);
open(
#ifdef HAVE_PSI_INTERFACE
m_log_file_key,
#endif
save_name, log_type, 0, io_cache_type);
my_free(save_name);
mysql_mutex_unlock(&LOCK_log);
@ -2855,8 +2868,8 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
write_error= 0;
/* open the main log file */
if (MYSQL_LOG::open(log_name, log_type_arg, new_name,
io_cache_type_arg))
if (MYSQL_LOG::open(key_file_binlog,
log_name, log_type_arg, new_name, io_cache_type_arg))
{
#ifdef HAVE_REPLICATION
close_purge_index_file();

View file

@ -196,7 +196,11 @@ public:
MYSQL_LOG();
void init_pthread_objects();
void cleanup();
bool open(const char *log_name,
bool open(
#ifdef HAVE_PSI_INTERFACE
PSI_file_key log_file_key,
#endif
const char *log_name,
enum_log_type log_type,
const char *new_name,
enum cache_type io_cache_type_arg);
@ -223,6 +227,10 @@ public:
volatile enum_log_state log_state;
enum cache_type io_cache_type;
friend class Log_event;
#ifdef HAVE_PSI_INTERFACE
/** Instrumentation key to use for file io in @c log_file */
PSI_file_key m_log_file_key;
#endif
};
class MYSQL_QUERY_LOG: public MYSQL_LOG
@ -241,14 +249,22 @@ public:
bool open_slow_log(const char *log_name)
{
char buf[FN_REFLEN];
return open(generate_name(log_name, "-slow.log", 0, buf), LOG_NORMAL, 0,
WRITE_CACHE);
return open(
#ifdef HAVE_PSI_INTERFACE
key_file_slow_log,
#endif
generate_name(log_name, "-slow.log", 0, buf),
LOG_NORMAL, 0, WRITE_CACHE);
}
bool open_query_log(const char *log_name)
{
char buf[FN_REFLEN];
return open(generate_name(log_name, ".log", 0, buf), LOG_NORMAL, 0,
WRITE_CACHE);
return open(
#ifdef HAVE_PSI_INTERFACE
key_file_query_log,
#endif
generate_name(log_name, ".log", 0, buf),
LOG_NORMAL, 0, WRITE_CACHE);
}
private:

View file

@ -7838,9 +7838,10 @@ PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
key_file_dbopt, key_file_des_key_file, key_file_ERRMSG, key_select_to_file,
key_file_fileparser, key_file_frm, key_file_global_ddl_log, key_file_load,
key_file_loadfile, key_file_log_event_data, key_file_log_event_info,
key_file_master_info, key_file_misc, key_file_MYSQL_LOG, key_file_partition,
key_file_master_info, key_file_misc, key_file_partition,
key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog,
key_file_trg, key_file_trn, key_file_init;
PSI_file_key key_file_query_log, key_file_slow_log;
static PSI_file_info all_server_files[]=
{
@ -7863,11 +7864,12 @@ static PSI_file_info all_server_files[]=
{ &key_file_log_event_info, "log_event_info", 0},
{ &key_file_master_info, "master_info", 0},
{ &key_file_misc, "misc", 0},
{ &key_file_MYSQL_LOG, "MYSQL_LOG", 0},
{ &key_file_partition, "partition", 0},
{ &key_file_pid, "pid", 0},
{ &key_file_query_log, "query_log", 0},
{ &key_file_relay_log_info, "relay_log_info", 0},
{ &key_file_send_file, "send_file", 0},
{ &key_file_slow_log, "slow_log", 0},
{ &key_file_tclog, "tclog", 0},
{ &key_file_trg, "trigger_name", 0},
{ &key_file_trn, "trigger", 0},

View file

@ -270,9 +270,10 @@ extern PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
key_file_dbopt, key_file_des_key_file, key_file_ERRMSG, key_select_to_file,
key_file_fileparser, key_file_frm, key_file_global_ddl_log, key_file_load,
key_file_loadfile, key_file_log_event_data, key_file_log_event_info,
key_file_master_info, key_file_misc, key_file_MYSQL_LOG, key_file_partition,
key_file_master_info, key_file_misc, key_file_partition,
key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog,
key_file_trg, key_file_trn, key_file_init;
extern PSI_file_key key_file_query_log, key_file_slow_log;
void init_server_psi_keys();
#endif /* HAVE_PSI_INTERFACE */

View file

@ -220,6 +220,7 @@ private:
during execution.
*/
bool m_return_value_set;
/**
TRUE if the context is created for a sub-statement.
*/

View file

@ -1842,8 +1842,9 @@ void select_to_file::send_error(uint errcode,const char *err)
bool select_to_file::send_eof()
{
int error= test(end_io_cache(&cache));
if (mysql_file_close(file, MYF(MY_WME)))
error= 1;
if (mysql_file_close(file, MYF(MY_WME)) || thd->is_error())
error= true;
if (!error)
{
::my_ok(thd,row_count);
@ -2884,6 +2885,13 @@ bool select_dumpvar::send_eof()
if (! row_count)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_SP_FETCH_NO_DATA, ER(ER_SP_FETCH_NO_DATA));
/*
Don't send EOF if we're in error condition (which implies we've already
sent or are sending an error)
*/
if (thd->is_error())
return true;
::my_ok(thd,row_count);
return 0;
}

View file

@ -3506,6 +3506,9 @@ bool select_insert::send_eof()
error= (thd->locked_tables_mode <= LTM_LOCK_TABLES ?
table->file->ha_end_bulk_insert() : 0);
if (!error && thd->is_error())
error= thd->stmt_da->sql_errno();
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
@ -4049,7 +4052,7 @@ bool select_create::send_eof()
{
bool tmp=select_insert::send_eof();
if (tmp)
abort();
abort_result_set();
else
{
/*
@ -4081,7 +4084,7 @@ void select_create::abort_result_set()
DBUG_ENTER("select_create::abort_result_set");
/*
In select_insert::abort() we roll back the statement, including
In select_insert::abort_result_set() we roll back the statement, including
truncating the transaction cache of the binary log. To do this, we
pretend that the statement is transactional, even though it might
be the case that it was not.

View file

@ -1185,7 +1185,7 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
uint32 length= 0;
THD *thd= stmt->thd;
DBUG_ENTER("insert_params_from_vars");
DBUG_ENTER("insert_params_from_vars_with_log");
if (query->copy(stmt->query(), stmt->query_length(), default_charset_info))
DBUG_RETURN(1);
@ -2898,8 +2898,15 @@ bool Select_fetch_protocol_binary::send_result_set_metadata(List<Item> &list, ui
bool Select_fetch_protocol_binary::send_eof()
{
/*
Don't send EOF if we're in error condition (which implies we've already
sent or are sending an error)
*/
if (thd->is_error())
return true;
::my_eof(thd);
return FALSE;
return false;
}

View file

@ -2064,7 +2064,9 @@ bool multi_update::send_eof()
Does updates for the last n - 1 tables, returns 0 if ok;
error takes into account killed status gained in do_updates()
*/
int local_error = (table_count) ? do_updates() : 0;
int local_error= thd->is_error();
if (!local_error)
local_error = (table_count) ? do_updates() : 0;
/*
if local_error is not set ON until after do_updates() then
later carried out killing should not affect binlogging.

View file

@ -61,12 +61,17 @@ IF(UNIX)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh
${CMAKE_CURRENT_BINARY_DIR}/${script} @ONLY )
IF(script MATCHES ".ini")
SET(comp IniFiles)
ELSE()
SET(comp Server_Scripts)
ENDIF()
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${script}
DESTINATION ${inst_location}
DESTINATION ${inst_location} COMPONENT ${comp}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDFOREACH()
IF(INSTALL_SUPPORTFILESDIR)
INSTALL(FILES magic DESTINATION ${inst_location})
INSTALL(FILES magic DESTINATION ${inst_location} COMPONENT SupportFiles)
ENDIF()
INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
@ -83,7 +88,7 @@ IF(UNIX)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql.server.sh
${CMAKE_CURRENT_BINARY_DIR}/mysql.server @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql.server
DESTINATION ${inst_location}
DESTINATION ${inst_location} COMPONENT SupportFiles
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF()

View file

@ -335,6 +335,7 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
%package -n MySQL-shared%{product_suffix}
Summary: MySQL - Shared libraries
Group: Applications/Databases
Provides: mysql-shared
Obsoletes: MySQL-shared-community
%description -n MySQL-shared%{product_suffix}

View file

@ -2103,6 +2103,255 @@ static void test_wl4435_2()
}
#define WL4435_TEST(sql_type, sql_value, \
c_api_in_type, c_api_out_type, \
c_type, c_type_ext, \
printf_args, assert_condition) \
\
do { \
int rc; \
MYSQL_STMT *ps; \
MYSQL_BIND psp; \
MYSQL_RES *rs_metadata; \
MYSQL_FIELD *fields; \
c_type pspv c_type_ext; \
my_bool psp_null; \
\
bzero(&pspv, sizeof (pspv)); \
\
rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1"); \
myquery(rc); \
\
rc= mysql_query(mysql, \
"CREATE PROCEDURE p1(OUT v " sql_type ") SET v = " sql_value ";"); \
myquery(rc); \
\
ps = mysql_simple_prepare(mysql, "CALL p1(?)"); \
check_stmt(ps); \
\
bzero(&psp, sizeof (psp)); \
psp.buffer_type= c_api_in_type; \
psp.is_null= &psp_null; \
psp.buffer= (char *) &pspv; \
psp.buffer_length= sizeof (psp); \
\
rc= mysql_stmt_bind_param(ps, &psp); \
check_execute(ps, rc); \
\
rc= mysql_stmt_execute(ps); \
check_execute(ps, rc); \
\
DIE_UNLESS(mysql->server_status & SERVER_PS_OUT_PARAMS); \
DIE_UNLESS(mysql_stmt_field_count(ps) == 1); \
\
rs_metadata= mysql_stmt_result_metadata(ps); \
fields= mysql_fetch_fields(rs_metadata); \
\
rc= mysql_stmt_bind_result(ps, &psp); \
check_execute(ps, rc); \
\
rc= mysql_stmt_fetch(ps); \
DIE_UNLESS(rc == 0); \
\
DIE_UNLESS(fields[0].type == c_api_out_type); \
printf printf_args; \
printf("; in type: %d; out type: %d\n", \
(int) c_api_in_type, (int) c_api_out_type); \
\
rc= mysql_stmt_fetch(ps); \
DIE_UNLESS(rc == MYSQL_NO_DATA); \
\
rc= mysql_stmt_next_result(ps); \
DIE_UNLESS(rc == 0); \
\
mysql_stmt_free_result(ps); \
mysql_stmt_close(ps); \
\
DIE_UNLESS(assert_condition); \
\
} while (0)
static void test_wl4435_3()
{
char tmp[255];
puts("");
// The following types are not supported:
// - ENUM
// - SET
//
// The following types are supported but can not be used for
// OUT-parameters:
// - MEDIUMINT;
// - BIT(..);
//
// The problem is that those types are not supported for IN-parameters,
// and OUT-parameters should be bound as IN-parameters before execution.
//
// The following types should not be used:
// - MYSQL_TYPE_YEAR (use MYSQL_TYPE_SHORT instead);
// - MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_LONG_BLOB
// (use MYSQL_TYPE_BLOB instead);
WL4435_TEST("TINYINT", "127",
MYSQL_TYPE_TINY, MYSQL_TYPE_TINY,
char, ,
(" - TINYINT / char / MYSQL_TYPE_TINY:\t\t\t %d", (int) pspv),
pspv == 127);
WL4435_TEST("SMALLINT", "32767",
MYSQL_TYPE_SHORT, MYSQL_TYPE_SHORT,
short, ,
(" - SMALLINT / short / MYSQL_TYPE_SHORT:\t\t %d", (int) pspv),
pspv == 32767);
WL4435_TEST("INT", "2147483647",
MYSQL_TYPE_LONG, MYSQL_TYPE_LONG,
int, ,
(" - INT / int / MYSQL_TYPE_LONG:\t\t\t %d", pspv),
pspv == 2147483647l);
WL4435_TEST("BIGINT", "9223372036854775807",
MYSQL_TYPE_LONGLONG, MYSQL_TYPE_LONGLONG,
long long, ,
(" - BIGINT / long long / MYSQL_TYPE_LONGLONG:\t\t %lld", pspv),
pspv == 9223372036854775807ll);
WL4435_TEST("TIMESTAMP", "'2007-11-18 15:01:02'",
MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_TIMESTAMP,
MYSQL_TIME, ,
(" - TIMESTAMP / MYSQL_TIME / MYSQL_TYPE_TIMESTAMP:\t "
"%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
(int) pspv.year, (int) pspv.month, (int) pspv.day,
(int) pspv.hour, (int) pspv.minute, (int) pspv.second),
pspv.year == 2007 && pspv.month == 11 && pspv.day == 18 &&
pspv.hour == 15 && pspv.minute == 1 && pspv.second == 2);
WL4435_TEST("DATETIME", "'1234-11-12 12:34:59'",
MYSQL_TYPE_DATETIME, MYSQL_TYPE_DATETIME,
MYSQL_TIME, ,
(" - DATETIME / MYSQL_TIME / MYSQL_TYPE_DATETIME:\t "
"%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
(int) pspv.year, (int) pspv.month, (int) pspv.day,
(int) pspv.hour, (int) pspv.minute, (int) pspv.second),
pspv.year == 1234 && pspv.month == 11 && pspv.day == 12 &&
pspv.hour == 12 && pspv.minute == 34 && pspv.second == 59);
WL4435_TEST("TIME", "'123:45:01'",
MYSQL_TYPE_TIME, MYSQL_TYPE_TIME,
MYSQL_TIME, ,
(" - TIME / MYSQL_TIME / MYSQL_TYPE_TIME:\t\t "
"%.3d:%.2d:%.2d",
(int) pspv.hour, (int) pspv.minute, (int) pspv.second),
pspv.hour == 123 && pspv.minute == 45 && pspv.second == 1);
WL4435_TEST("DATE", "'1234-11-12'",
MYSQL_TYPE_DATE, MYSQL_TYPE_DATE,
MYSQL_TIME, ,
(" - DATE / MYSQL_TIME / MYSQL_TYPE_DATE:\t\t "
"%.4d-%.2d-%.2d",
(int) pspv.year, (int) pspv.month, (int) pspv.day),
pspv.year == 1234 && pspv.month == 11 && pspv.day == 12);
WL4435_TEST("YEAR", "'2010'",
MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR,
short, ,
(" - YEAR / short / MYSQL_TYPE_SHORT:\t\t\t %.4d", (int) pspv),
pspv == 2010);
WL4435_TEST("FLOAT(7, 4)", "123.4567",
MYSQL_TYPE_FLOAT, MYSQL_TYPE_FLOAT,
float, ,
(" - FLOAT / float / MYSQL_TYPE_FLOAT:\t\t\t %g", (double) pspv),
pspv - 123.4567 < 0.0001);
WL4435_TEST("DOUBLE(8, 5)", "123.45678",
MYSQL_TYPE_DOUBLE, MYSQL_TYPE_DOUBLE,
double, ,
(" - DOUBLE / double / MYSQL_TYPE_DOUBLE:\t\t %g", (double) pspv),
pspv - 123.45678 < 0.00001);
WL4435_TEST("DECIMAL(9, 6)", "123.456789",
MYSQL_TYPE_NEWDECIMAL, MYSQL_TYPE_NEWDECIMAL,
char, [255],
(" - DECIMAL / char[] / MYSQL_TYPE_NEWDECIMAL:\t\t '%s'", (char *) pspv),
!strcmp(pspv, "123.456789"));
WL4435_TEST("CHAR(32)", "REPEAT('C', 16)",
MYSQL_TYPE_STRING, MYSQL_TYPE_STRING,
char, [255],
(" - CHAR(32) / char[] / MYSQL_TYPE_STRING:\t\t '%s'", (char *) pspv),
!strcmp(pspv, "CCCCCCCCCCCCCCCC"));
WL4435_TEST("VARCHAR(32)", "REPEAT('V', 16)",
MYSQL_TYPE_VAR_STRING, MYSQL_TYPE_VAR_STRING,
char, [255],
(" - VARCHAR(32) / char[] / MYSQL_TYPE_VAR_STRING:\t '%s'", (char *) pspv),
!strcmp(pspv, "VVVVVVVVVVVVVVVV"));
WL4435_TEST("TINYTEXT", "REPEAT('t', 16)",
MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_BLOB,
char, [255],
(" - TINYTEXT / char[] / MYSQL_TYPE_TINY_BLOB:\t\t '%s'", (char *) pspv),
!strcmp(pspv, "tttttttttttttttt"));
WL4435_TEST("TEXT", "REPEAT('t', 16)",
MYSQL_TYPE_BLOB, MYSQL_TYPE_BLOB,
char, [255],
(" - TEXT / char[] / MYSQL_TYPE_BLOB:\t\t\t '%s'", (char *) pspv),
!strcmp(pspv, "tttttttttttttttt"));
WL4435_TEST("MEDIUMTEXT", "REPEAT('t', 16)",
MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_BLOB,
char, [255],
(" - MEDIUMTEXT / char[] / MYSQL_TYPE_MEDIUM_BLOB:\t '%s'", (char *) pspv),
!strcmp(pspv, "tttttttttttttttt"));
WL4435_TEST("LONGTEXT", "REPEAT('t', 16)",
MYSQL_TYPE_LONG_BLOB, MYSQL_TYPE_BLOB,
char, [255],
(" - LONGTEXT / char[] / MYSQL_TYPE_LONG_BLOB:\t\t '%s'", (char *) pspv),
!strcmp(pspv, "tttttttttttttttt"));
WL4435_TEST("BINARY(32)", "REPEAT('\1', 16)",
MYSQL_TYPE_STRING, MYSQL_TYPE_STRING,
char, [255],
(" - BINARY(32) / char[] / MYSQL_TYPE_STRING:\t\t '%s'", (char *) pspv),
memset(tmp, 1, 16) && !memcmp(tmp, pspv, 16));
WL4435_TEST("VARBINARY(32)", "REPEAT('\1', 16)",
MYSQL_TYPE_VAR_STRING, MYSQL_TYPE_VAR_STRING,
char, [255],
(" - VARBINARY(32) / char[] / MYSQL_TYPE_VAR_STRING:\t '%s'", (char *) pspv),
memset(tmp, 1, 16) && !memcmp(tmp, pspv, 16));
WL4435_TEST("TINYBLOB", "REPEAT('\2', 16)",
MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_BLOB,
char, [255],
(" - TINYBLOB / char[] / MYSQL_TYPE_TINY_BLOB:\t\t '%s'", (char *) pspv),
memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16));
WL4435_TEST("BLOB", "REPEAT('\2', 16)",
MYSQL_TYPE_BLOB, MYSQL_TYPE_BLOB,
char, [255],
(" - BLOB / char[] / MYSQL_TYPE_BLOB:\t\t\t '%s'", (char *) pspv),
memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16));
WL4435_TEST("MEDIUMBLOB", "REPEAT('\2', 16)",
MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_BLOB,
char, [255],
(" - MEDIUMBLOB / char[] / MYSQL_TYPE_MEDIUM_BLOB:\t '%s'", (char *) pspv),
memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16));
WL4435_TEST("LONGBLOB", "REPEAT('\2', 16)",
MYSQL_TYPE_LONG_BLOB, MYSQL_TYPE_BLOB,
char, [255],
(" - LONGBLOB / char[] / MYSQL_TYPE_LONG_BLOB:\t\t '%s'", (char *) pspv),
memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16));
}
/* Test simple prepare field results */
static void test_prepare_field_result()
@ -19468,6 +19717,7 @@ static struct my_tests_st my_tests[]= {
{ "test_wl4284_1", test_wl4284_1 },
{ "test_wl4435", test_wl4435 },
{ "test_wl4435_2", test_wl4435_2 },
{ "test_wl4435_3", test_wl4435_3 },
{ "test_bug38486", test_bug38486 },
{ "test_bug33831", test_bug33831 },
{ "test_bug40365", test_bug40365 },

View file

@ -1,114 +1,8 @@
Windows building readme
======================================
----------------IMPORTANT----------------------------
This readme outlines the instructions for building
MySQL for Windows staring from version 5.1.
This readme does not apply to MySQL versions 5.0
or ealier.
-----------------------------------------------------
The Windows build system uses a tool named CMake to generate build files for
a variety of project systems. This tool is combined with a set of jscript
files to enable building of MySQL for Windows directly out of a bzr clone.
For relevant information, please refer to http://forge.mysql.com/wiki/CMake
The steps required are below.
Step 1:
-------
Install a Windows C++ compiler. If you don't have one, you can use
the free compiler "Visual C++ 2005 express edition", which from Cmake
point of view is same as Visual studio 8:
http://msdn.microsoft.com/vstudio/express/
Step 2
------
Download and install CMake. It can be downloaded from http://www.cmake.org.
Once it is installed, modify your path to make sure you can execute
the cmake binary.
Step 3
------
Download and install bison for Windows. It can be downloaded from
http://gnuwin32.sourceforge.net/packages/bison.htm. Please download using
the link named "Complete package, excluding sources". This includes an
installer that will install bison. After the installer finishes, modify
your path so that you can execute bison.
(As an alternative you can take the sql_yacc.yy and sql_yacc.h files from a
matching mysql tar distribution and drop them into the sql directory just
before you start the build)
Step 4
------
One of the nice CMake features is "out-of-source" build support, which
means not building in the source directory, but in dedicated build
directory. This keeps the source directory clean and allows for more than
single build tree for the same source tree (e.g debug and release, 32 and
64 bit etc). We'll create subdirectory "bld" in the source directory for
this purpose. Clone your bzr tree to any location you like.
Step 5
------
From the root of your installation directory use cmake . -L to see the
various configuration parameters.
So the command line could look like:
cmake .. -G "target" -DWITH_INNOBASE_STORAGE_ENGINE=1
The recommended way of configuring would be to use -DBUILD_CONFIG=mysql_release
to build binaries exactly the same as the official MySQL releases.
Step 6
------
From the root of your installation directory/bzr clone, you can
use cmake to compile the sources. Use cmake --help when necessary.
Before you start building the sources, please remove the old build area
created from an earlier run and start afresh.
C:\> del bld
C:\> md bld
C:\> cd bld
C:\> cmake .. -G "target name" -DBUILD_CONFIG=mysql_release
For Example:
To generate the Win64 project files using Visual Studio 9, you would run
cmake .. -G "Visual Studio 9 2008 Win64"
Other target names supported using CMake 2.6 patch 4 are:
Visual Studio 7 "Visual Studio 7 .NET 2003"
Visual Studio 8 "Visual Studio 8 2005"
Visual Studio 8 (64 bit) "Visual Studio 8 2005 Win64"
Visual Studio 9 "Visual Studio 9 2008"
Visual Studio 9 (64 bit) "Visual Studio 9 2008 Win64"
For generating project files using Visual Studio 10, you need CMake 2.8
or higher and corresponding target names are
Visual Studio 10 "Visual Studio 10"
Visual Studio 10 (64 bit) "Visual Studio 10 Win64"
Step 7
------
From the root of your bzr clone, start your build.
For Visual Studio, execute mysql.sln. This will start the IDE
and you can click the build solution menu option.
Alternatively, you could start the build from command line as follows
devenv mysql.sln /build relwithdebinfo
Current issues
--------------
1. After changing configuration (eg. adding or removing a storage engine), it
may be necessary to clean the build tree to remove any stale objects.
2. To use Visual C++ Express Edition you also need to install the Platform SDK.
Please see this link: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
At step 5 you only need to add the libraries advapi32.lib and user32.lib to
the file "corewin_express.vsprops" in order to avoid link errors.
For relevant information and/or for building binaries from source distribution,
please refer to http://forge.mysql.com/wiki/CMake