Commit 8a5956c9 authored by Jon Olav Hauglid's avatar Jon Olav Hauglid

merge from mysql-next-mr-bugfixing

parents e60ef893 527ff458
...@@ -278,6 +278,7 @@ ENDIF() ...@@ -278,6 +278,7 @@ ENDIF()
SET(MYSQL_DOCS_LOCATION "" CACHE PATH "Location from where documentation is copied") SET(MYSQL_DOCS_LOCATION "" CACHE PATH "Location from where documentation is copied")
MARK_AS_ADVANCED(MYSQL_DOCS_LOCATION) MARK_AS_ADVANCED(MYSQL_DOCS_LOCATION)
INSTALL(DIRECTORY Docs/ DESTINATION ${INSTALL_DOCDIR} INSTALL(DIRECTORY Docs/ DESTINATION ${INSTALL_DOCDIR}
PATTERN "INSTALL-BINARY" EXCLUDE
PATTERN "Makefile.*" EXCLUDE PATTERN "Makefile.*" EXCLUDE
PATTERN "myisam.txt" EXCLUDE PATTERN "myisam.txt" EXCLUDE
PATTERN "glibc*" EXCLUDE PATTERN "glibc*" EXCLUDE
......
...@@ -4460,12 +4460,13 @@ typedef struct ...@@ -4460,12 +4460,13 @@ typedef struct
{ {
const char *name; const char *name;
uint code; uint code;
const char *text;
} st_error; } st_error;
static st_error global_error_names[] = static st_error global_error_names[] =
{ {
#include <mysqld_ername.h> #include <mysqld_ername.h>
{ 0, 0 } { 0, 0, 0 }
}; };
uint get_errcode_from_name(char *error_name, char *error_end) uint get_errcode_from_name(char *error_name, char *error_end)
......
EXTRA_DIST = \ EXTRA_DIST = \
cmake_parse_arguments.cmake \ cmake_parse_arguments.cmake \
cpack_source_ignore_files.cmake \
package_name.cmake \ package_name.cmake \
configurable_file_content.in \ configurable_file_content.in \
check_minimal_version.cmake \ check_minimal_version.cmake \
......
...@@ -80,6 +80,8 @@ IF(FEATURE_SET) ...@@ -80,6 +80,8 @@ IF(FEATURE_SET)
ENDFOREACH() ENDFOREACH()
ENDIF() ENDIF()
SET(WITHOUT_AUDIT_NULL ON CACHE BOOL "")
SET(WITHOUT_DAEMON_EXAMPLE ON CACHE BOOL "")
OPTION(ENABLE_LOCAL_INFILE "" ON) OPTION(ENABLE_LOCAL_INFILE "" ON)
SET(WITH_SSL bundled CACHE STRING "") SET(WITH_SSL bundled CACHE STRING "")
......
...@@ -130,12 +130,12 @@ foreach my $option (@ARGV) ...@@ -130,12 +130,12 @@ foreach my $option (@ARGV)
} }
if($option =~ /with-ssl=/) if($option =~ /with-ssl=/)
{ {
$cmakeargs = $cmakeargs." -DWITH_SSL=bundled"; $cmakeargs = $cmakeargs." -DWITH_SSL=yes";
next; next;
} }
if($option =~ /with-ssl/) if($option =~ /with-ssl/)
{ {
$cmakeargs = $cmakeargs." -DWITH_SSL=yes"; $cmakeargs = $cmakeargs." -DWITH_SSL=bundled";
next; next;
} }
if($option =~ /prefix=/) if($option =~ /prefix=/)
......
SET(CPACK_SOURCE_IGNORE_FILES
\\\\.bzr/
\\\\.bzr-mysql
\\\\.bzrignore
CMakeCache\\\\.txt
cmake_dist\\\\.cmake
CPackSourceConfig\\\\.cmake
CPackConfig.cmake
/cmake_install\\\\.cmake
/CTestTestfile\\\\.cmake
/CMakeFiles/
/version_resources/
/_CPack_Packages/
$\\\\.gz
$\\\\.zip
/CMakeFiles/
/version_resources/
/_CPack_Packages/
scripts/make_binary_distribution$
scripts/msql2mysql$
scripts/mysql_config$
scripts/mysql_convert_table_format$
scripts/mysql_find_rows$
scripts/mysql_fix_extensions$
scripts/mysql_install_db$
scripts/mysql_secure_installation$
scripts/mysql_setpermission$
scripts/mysql_zap$
scripts/mysqlaccess$
scripts/mysqld_multi$
scripts/mysqld_safe$
scripts/mysqldumpslow$
scripts/mysqlhotcopy$
Makefile$
include/config\\\\.h$
include/my_config\\\\.h$
/autom4te\\\\.cache/
errmsg\\\\.sys$
#
)
...@@ -80,7 +80,7 @@ ENDIF() ...@@ -80,7 +80,7 @@ ENDIF()
SET(INSTALL_LIBDIR_STANDALONE "lib") SET(INSTALL_LIBDIR_STANDALONE "lib")
SET(INSTALL_INCLUDEDIR_STANDALONE "include") SET(INSTALL_INCLUDEDIR_STANDALONE "include")
SET(INSTALL_PLUGINDIR_STANDALONE "lib/plugin") SET(INSTALL_PLUGINDIR_STANDALONE "lib/plugin")
SET(INSTALL_DOCDIR_STANDALONE "doc") SET(INSTALL_DOCDIR_STANDALONE "docs")
SET(INSTALL_MANDIR_STANDALONE "man") SET(INSTALL_MANDIR_STANDALONE "man")
SET(INSTALL_MYSQLSHAREDIR_STANDALONE "share") SET(INSTALL_MYSQLSHAREDIR_STANDALONE "share")
SET(INSTALL_SHAREDIR_STANDALONE "share") SET(INSTALL_SHAREDIR_STANDALONE "share")
......
...@@ -108,17 +108,7 @@ IF(NOT CPACK_SOURCE_PACKAGE_FILE_NAME) ...@@ -108,17 +108,7 @@ IF(NOT CPACK_SOURCE_PACKAGE_FILE_NAME)
ENDIF() ENDIF()
SET(CPACK_PACKAGE_VENDOR "Sun Microsystems, Inc") SET(CPACK_PACKAGE_VENDOR "Sun Microsystems, Inc")
SET(CPACK_SOURCE_GENERATOR "TGZ") SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_SOURCE_IGNORE_FILES INCLUDE(cpack_source_ignore_files)
\\\\.bzr/
\\\\.bzr-mysql
.bzrignore
CMakeCache.txt
/CMakeFiles/
/version_resources/
/_CPack_Packages/
$.gz
$.zip
)
# Defintions for windows version resources # Defintions for windows version resources
SET(PRODUCTNAME "MySQL Server") SET(PRODUCTNAME "MySQL Server")
......
...@@ -30,7 +30,7 @@ SET(LIBM m) ...@@ -30,7 +30,7 @@ SET(LIBM m)
# CMake defined -lthread as thread flag. This crashes in dlopen # CMake defined -lthread as thread flag. This crashes in dlopen
# when trying to load plugins workaround with -lpthread # when trying to load plugins workaround with -lpthread
SET(CMAKE_THREADS_LIBS_INIT -lpthread CACHE INTERNAL "") SET(CMAKE_THREADS_LIBS_INIT -lpthread CACHE INTERNAL "" FORCE)
# Solaris specific large page support # Solaris specific large page support
CHECK_SYMBOL_EXISTS(MHA_MAPSIZE_VA sys/mman.h HAVE_DECL_MHA_MAPSIZE_VA) CHECK_SYMBOL_EXISTS(MHA_MAPSIZE_VA sys/mman.h HAVE_DECL_MHA_MAPSIZE_VA)
......
...@@ -199,11 +199,34 @@ int main(int argc, char *argv[]) ...@@ -199,11 +199,34 @@ int main(int argc, char *argv[])
} }
static void print_escaped_string(FILE *f, const char *str)
{
const char *tmp = str;
while (tmp[0] != 0)
{
switch (tmp[0])
{
case '\\': fprintf(f, "\\\\"); break;
case '\'': fprintf(f, "\\\'"); break;
case '\"': fprintf(f, "\\\""); break;
case '\n': fprintf(f, "\\n"); break;
case '\r': fprintf(f, "\\r"); break;
default: fprintf(f, "%c", tmp[0]);
}
tmp++;
}
}
static int create_header_files(struct errors *error_head) static int create_header_files(struct errors *error_head)
{ {
uint er_last; uint er_last;
FILE *er_definef, *sql_statef, *er_namef; FILE *er_definef, *sql_statef, *er_namef;
struct errors *tmp_error; struct errors *tmp_error;
struct message *er_msg;
const char *er_text;
DBUG_ENTER("create_header_files"); DBUG_ENTER("create_header_files");
LINT_INIT(er_last); LINT_INIT(er_last);
...@@ -245,9 +268,12 @@ static int create_header_files(struct errors *error_head) ...@@ -245,9 +268,12 @@ static int create_header_files(struct errors *error_head)
"{ %-40s,\"%s\", \"%s\" },\n", tmp_error->er_name, "{ %-40s,\"%s\", \"%s\" },\n", tmp_error->er_name,
tmp_error->sql_code1, tmp_error->sql_code2); tmp_error->sql_code1, tmp_error->sql_code2);
/*generating er_name file */ /*generating er_name file */
fprintf(er_namef, "{ \"%s\", %d },\n", tmp_error->er_name, er_msg= find_message(tmp_error, default_language, 0);
er_text = (er_msg ? er_msg->text : "");
fprintf(er_namef, "{ \"%s\", %d, \"", tmp_error->er_name,
tmp_error->d_code); tmp_error->d_code);
print_escaped_string(er_namef, er_text);
fprintf(er_namef, "\" },\n");
} }
/* finishing off with mysqld_error.h */ /* finishing off with mysqld_error.h */
fprintf(er_definef, "#define ER_ERROR_LAST %d\n", er_last); fprintf(er_definef, "#define ER_ERROR_LAST %d\n", er_last);
......
...@@ -184,6 +184,45 @@ static const char *get_ha_error_msg(int code) ...@@ -184,6 +184,45 @@ static const char *get_ha_error_msg(int code)
return NullS; return NullS;
} }
typedef struct
{
const char *name;
uint code;
const char *text;
} st_error;
static st_error global_error_names[] =
{
#include <mysqld_ername.h>
{ 0, 0, 0 }
};
/**
Lookup an error by code in the global_error_names array.
@param code the code to lookup
@param [out] name_ptr the error name, when found
@param [out] msg_ptr the error text, when found
@return 1 when found, otherwise 0
*/
int get_ER_error_msg(uint code, const char **name_ptr, const char **msg_ptr)
{
st_error *tmp_error;
tmp_error= & global_error_names[0];
while (tmp_error->name != NULL)
{
if (tmp_error->code == code)
{
*name_ptr= tmp_error->name;
*msg_ptr= tmp_error->text;
return 1;
}
tmp_error++;
}
return 0;
}
#if defined(__WIN__) #if defined(__WIN__)
static my_bool print_win_error_msg(DWORD error, my_bool verbose) static my_bool print_win_error_msg(DWORD error, my_bool verbose)
...@@ -211,6 +250,7 @@ int main(int argc,char *argv[]) ...@@ -211,6 +250,7 @@ int main(int argc,char *argv[])
{ {
int error,code,found; int error,code,found;
const char *msg; const char *msg;
const char *name;
char *unknown_error = 0; char *unknown_error = 0;
#if defined(__WIN__) #if defined(__WIN__)
my_bool skip_win_message= 0; my_bool skip_win_message= 0;
...@@ -316,6 +356,14 @@ int main(int argc,char *argv[]) ...@@ -316,6 +356,14 @@ int main(int argc,char *argv[])
else else
puts(msg); puts(msg);
} }
if (get_ER_error_msg(code, & name, & msg))
{
found= 1;
if (verbose)
printf("MySQL error code %3d (%s): %s\n", code, name, msg);
else
puts(msg);
}
if (!found) if (!found)
{ {
#if defined(__WIN__) #if defined(__WIN__)
......
...@@ -118,6 +118,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, ...@@ -118,6 +118,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
net_clear_error(net); net_clear_error(net);
thd->current_stmt= stmt; thd->current_stmt= stmt;
thd->thread_stack= (char*) &thd;
thd->store_globals(); // Fix if more than one connect thd->store_globals(); // Fix if more than one connect
/* /*
We have to call free_old_query before we start to fill mysql->fields We have to call free_old_query before we start to fill mysql->fields
......
...@@ -23,6 +23,7 @@ INSTALL( ...@@ -23,6 +23,7 @@ INSTALL(
PATTERN "mtr.out*" EXCLUDE PATTERN "mtr.out*" EXCLUDE
PATTERN ".cvsignore" EXCLUDE PATTERN ".cvsignore" EXCLUDE
PATTERN "*.am" EXCLUDE PATTERN "*.am" EXCLUDE
PATTERN "*.in" EXCLUDE
) )
......
...@@ -61,10 +61,10 @@ create table t1 (a int unique); ...@@ -61,10 +61,10 @@ create table t1 (a int unique);
create table t2 (a int); create table t2 (a int);
drop function if exists f1; drop function if exists f1;
Warnings: Warnings:
Note 1305 FUNCTION f1 does not exist Note 1305 FUNCTION test.f1 does not exist
drop function if exists f2; drop function if exists f2;
Warnings: Warnings:
Note 1305 FUNCTION f2 does not exist Note 1305 FUNCTION test.f2 does not exist
create function f1() returns int create function f1() returns int
begin begin
insert into t1 (a) values (1); insert into t1 (a) values (1);
......
...@@ -1231,7 +1231,7 @@ Warnings: ...@@ -1231,7 +1231,7 @@ Warnings:
Note 1051 Unknown table 'test' Note 1051 Unknown table 'test'
drop function if exists test_function; drop function if exists test_function;
Warnings: Warnings:
Note 1305 FUNCTION test_function does not exist Note 1305 FUNCTION test.test_function does not exist
drop view if exists v1; drop view if exists v1;
Warnings: Warnings:
Note 1051 Unknown table 'test.v1' Note 1051 Unknown table 'test.v1'
......
...@@ -2,5 +2,6 @@ MySQL error code 150: Foreign key constraint is incorrectly formed ...@@ -2,5 +2,6 @@ MySQL error code 150: Foreign key constraint is incorrectly formed
Win32 error code 150: System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed. Win32 error code 150: System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.
OS error code 23: Too many open files in system OS error code 23: Too many open files in system
Win32 error code 23: Data error (cyclic redundancy check). Win32 error code 23: Data error (cyclic redundancy check).
MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
Win32 error code 1062: The service has not been started. Win32 error code 1062: The service has not been started.
Illegal error code: 30000 Illegal error code: 30000
Illegal error code: 10000 Illegal error code: 10000
MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
MySQL error code 1076 (ER_READY): %s: ready for connections.
Version: '%s' socket: '%s' port: %d
MySQL error code 1459 (ER_TABLE_NEEDS_UPGRADE): Table upgrade required. Please do "REPAIR TABLE `%-.32s`" or dump/reload to fix it!
MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %lu)
...@@ -2181,7 +2181,7 @@ drop procedure peter_p1 $$ ...@@ -2181,7 +2181,7 @@ drop procedure peter_p1 $$
drop procedure peter_p2 $$ drop procedure peter_p2 $$
drop procedure if exists peter_p3 $$ drop procedure if exists peter_p3 $$
Warnings: Warnings:
Note 1305 PROCEDURE peter_p3 does not exist Note 1305 PROCEDURE test.peter_p3 does not exist
create procedure peter_p3() create procedure peter_p3()
begin begin
declare continue handler for sqlexception declare continue handler for sqlexception
......
...@@ -46,7 +46,7 @@ call foo()| ...@@ -46,7 +46,7 @@ call foo()|
ERROR 42000: PROCEDURE test.foo does not exist ERROR 42000: PROCEDURE test.foo does not exist
drop procedure if exists foo| drop procedure if exists foo|
Warnings: Warnings:
Note 1305 PROCEDURE foo does not exist Note 1305 PROCEDURE test.foo does not exist
show create procedure foo| show create procedure foo|
ERROR 42000: PROCEDURE foo does not exist ERROR 42000: PROCEDURE foo does not exist
show create function foo| show create function foo|
...@@ -1028,7 +1028,7 @@ drop table t1| ...@@ -1028,7 +1028,7 @@ drop table t1|
drop function bug_13627_f| drop function bug_13627_f|
drop function if exists bug12329; drop function if exists bug12329;
Warnings: Warnings:
Note 1305 FUNCTION bug12329 does not exist Note 1305 FUNCTION test.bug12329 does not exist
create table t1 as select 1 a; create table t1 as select 1 a;
create table t2 as select 1 a; create table t2 as select 1 a;
create function bug12329() returns int return (select a from t1); create function bug12329() returns int return (select a from t1);
......
...@@ -394,10 +394,10 @@ CASE expression tests. ...@@ -394,10 +394,10 @@ CASE expression tests.
DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p1;
Warnings: Warnings:
Note 1305 PROCEDURE p1 does not exist Note 1305 PROCEDURE test.p1 does not exist
DROP PROCEDURE IF EXISTS p2; DROP PROCEDURE IF EXISTS p2;
Warnings: Warnings:
Note 1305 PROCEDURE p2 does not exist Note 1305 PROCEDURE test.p2 does not exist
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
Warnings: Warnings:
Note 1051 Unknown table 't1' Note 1051 Unknown table 't1'
......
...@@ -2695,10 +2695,10 @@ delete from t3| ...@@ -2695,10 +2695,10 @@ delete from t3|
insert into t3 values(1)| insert into t3 values(1)|
drop procedure if exists bug7992_1| drop procedure if exists bug7992_1|
Warnings: Warnings:
Note 1305 PROCEDURE bug7992_1 does not exist Note 1305 PROCEDURE test.bug7992_1 does not exist
drop procedure if exists bug7992_2| drop procedure if exists bug7992_2|
Warnings: Warnings:
Note 1305 PROCEDURE bug7992_2 does not exist Note 1305 PROCEDURE test.bug7992_2 does not exist
create procedure bug7992_1() create procedure bug7992_1()
begin begin
declare i int; declare i int;
......
...@@ -21,11 +21,11 @@ end| ...@@ -21,11 +21,11 @@ end|
call bug4902_2()| call bug4902_2()|
show warnings| show warnings|
Level Code Message Level Code Message
Note 1305 PROCEDURE bug4902_2 does not exist Note 1305 PROCEDURE test.bug4902_2 does not exist
call bug4902_2()| call bug4902_2()|
show warnings| show warnings|
Level Code Message Level Code Message
Note 1305 PROCEDURE bug4902_2 does not exist Note 1305 PROCEDURE test.bug4902_2 does not exist
drop procedure bug4902_2| drop procedure bug4902_2|
drop table if exists t1| drop table if exists t1|
create table t1 ( create table t1 (
......
...@@ -1183,7 +1183,7 @@ drop table t1; ...@@ -1183,7 +1183,7 @@ drop table t1;
create table t1 (col1 tinyint); create table t1 (col1 tinyint);
drop procedure if exists t1; drop procedure if exists t1;
Warnings: Warnings:
Note 1305 PROCEDURE t1 does not exist Note 1305 PROCEDURE test.t1 does not exist
create procedure t1 () begin declare exit handler for sqlexception create procedure t1 () begin declare exit handler for sqlexception
select'a'; insert into t1 values (200); end;| select'a'; insert into t1 values (200); end;|
call t1(); call t1();
......
...@@ -392,6 +392,52 @@ a ...@@ -392,6 +392,52 @@ a
4 4
DROP FUNCTION sequence; DROP FUNCTION sequence;
DROP TABLE t1,t2; DROP TABLE t1,t2;
drop function if exists test.metaphon;
drop function if exists metaphon;
CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
select metaphon("Hello");
metaphon("Hello")
HL
drop function if exists test.metaphon;
Warnings:
Note 1305 FUNCTION test.metaphon does not exist
select metaphon("Hello");
metaphon("Hello")
HL
drop function metaphon;
CREATE FUNCTION test.metaphon(a TEXT) RETURNS TEXT return "This is a SF";
create database db_31767;
use db_31767;
CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
use test;
select metaphon("Hello");
metaphon("Hello")
HL
select test.metaphon("Hello");
test.metaphon("Hello")
This is a SF
drop function metaphon;
select metaphon("Hello");
metaphon("Hello")
This is a SF
drop function metaphon;
use db_31767;
drop database db_31767;
drop function if exists no_such_func;
Warnings:
Note 1305 FUNCTION (UDF) no_such_func does not exist
drop function no_such_func;
ERROR 42000: FUNCTION (UDF) no_such_func does not exist
drop function if exists test.no_such_func;
Warnings:
Note 1305 FUNCTION test.no_such_func does not exist
drop function test.no_such_func;
ERROR 42000: FUNCTION test.no_such_func does not exist
drop procedure if exists no_such_proc;
ERROR 3D000: No database selected
drop procedure no_such_proc;
ERROR 3D000: No database selected
use test;
# #
# Bug#46259: 5.0.83 -> 5.1.36, query doesn't work # Bug#46259: 5.0.83 -> 5.1.36, query doesn't work
# #
......
...@@ -2086,7 +2086,7 @@ CREATE TABLE t1 ( bug_table_seq INTEGER NOT NULL); ...@@ -2086,7 +2086,7 @@ CREATE TABLE t1 ( bug_table_seq INTEGER NOT NULL);
CREATE OR REPLACE VIEW v1 AS SELECT * from t1; CREATE OR REPLACE VIEW v1 AS SELECT * from t1;
DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p1;
Warnings: Warnings:
Note 1305 PROCEDURE p1 does not exist Note 1305 PROCEDURE test.p1 does not exist
CREATE PROCEDURE p1 ( ) CREATE PROCEDURE p1 ( )
BEGIN BEGIN
DO (SELECT @next := IFNULL(max(bug_table_seq),0) + 1 FROM v1); DO (SELECT @next := IFNULL(max(bug_table_seq),0) + 1 FROM v1);
......
...@@ -228,13 +228,13 @@ INSERT INTO t2 VALUES ( 'a`', 'a`' ); ...@@ -228,13 +228,13 @@ INSERT INTO t2 VALUES ( 'a`', 'a`' );
INSERT INTO t3 VALUES ( 'a`', 'a`', '1000-01-1' ); INSERT INTO t3 VALUES ( 'a`', 'a`', '1000-01-1' );
DROP PROCEDURE IF EXISTS sp1; DROP PROCEDURE IF EXISTS sp1;
Warnings: Warnings:
Note 1305 PROCEDURE sp1 does not exist Note 1305 PROCEDURE test.sp1 does not exist
DROP PROCEDURE IF EXISTS sp2; DROP PROCEDURE IF EXISTS sp2;
Warnings: Warnings:
Note 1305 PROCEDURE sp2 does not exist Note 1305 PROCEDURE test.sp2 does not exist
DROP PROCEDURE IF EXISTS sp3; DROP PROCEDURE IF EXISTS sp3;
Warnings: Warnings:
Note 1305 PROCEDURE sp3 does not exist Note 1305 PROCEDURE test.sp3 does not exist
CREATE PROCEDURE sp1() CREATE PROCEDURE sp1()
BEGIN BEGIN
DECLARE x NUMERIC ZEROFILL; DECLARE x NUMERIC ZEROFILL;
......
...@@ -787,6 +787,7 @@ f1 f2 f3 ...@@ -787,6 +787,7 @@ f1 f2 f3
222222 bbbbbb 2 222222 bbbbbb 2
drop table t1; drop table t1;
Illegal ndb error code: 1186 Illegal ndb error code: 1186
MySQL error code 1186 (ER_FLUSH_MASTER_BINLOG_CLOSED): Binlog closed, cannot RESET MASTER
CREATE TABLE t1 ( CREATE TABLE t1 (
a VARBINARY(40) NOT NULL, a VARBINARY(40) NOT NULL,
b VARCHAR (256) CHARACTER SET UTF8 NOT NULL, b VARCHAR (256) CHARACTER SET UTF8 NOT NULL,
......
...@@ -66,7 +66,7 @@ SET GLOBAL max_prepared_stmt_count=3; ...@@ -66,7 +66,7 @@ SET GLOBAL max_prepared_stmt_count=3;
** Creating procedure ** ** Creating procedure **
DROP PROCEDURE IF EXISTS sp_checkstmts; DROP PROCEDURE IF EXISTS sp_checkstmts;
Warnings: Warnings:
Note 1305 PROCEDURE sp_checkstmts does not exist Note 1305 PROCEDURE test.sp_checkstmts does not exist
CREATE PROCEDURE sp_checkstmts () CREATE PROCEDURE sp_checkstmts ()
BEGIN BEGIN
PREPARE newstmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; PREPARE newstmt from "SELECT * FROM information_schema.CHARACTER_SETS C";
......
--source include/not_windows.inc
# #
# Check if the variable MY_PERROR is set # Check if the variable MY_PERROR is set
# #
...@@ -17,3 +18,17 @@ enable_query_log; ...@@ -17,3 +18,17 @@ enable_query_log;
# As there is no error code defined for 10000, expect error # As there is no error code defined for 10000, expect error
--error 1 --error 1
--exec $MY_PERROR 10000 2>&1 --exec $MY_PERROR 10000 2>&1
#
# Bug#10143 (Perror not showing error description)
#
# test reported case
--exec $MY_PERROR 1062 2>&1
# test errors that contain characters to escape in the text.
--exec $MY_PERROR 1076 2>&1
--exec $MY_PERROR 1459 2>&1
--exec $MY_PERROR 1461 2>&1
...@@ -436,6 +436,75 @@ SELECT * FROM t2 WHERE a = sequence(); ...@@ -436,6 +436,75 @@ SELECT * FROM t2 WHERE a = sequence();
DROP FUNCTION sequence; DROP FUNCTION sequence;
DROP TABLE t1,t2; DROP TABLE t1,t2;
#
# Bug#31767 (DROP FUNCTION name resolution)
#
--disable_warnings
drop function if exists test.metaphon;
drop function if exists metaphon;
--enable_warnings
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
select metaphon("Hello");
# The UDF should not be dropped
drop function if exists test.metaphon;
select metaphon("Hello");
drop function metaphon;
CREATE FUNCTION test.metaphon(a TEXT) RETURNS TEXT return "This is a SF";
create database db_31767;
use db_31767;
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
use test;
# Uses the UDF
select metaphon("Hello");
# Uses the SF
select test.metaphon("Hello");
# Should drop the UDF, resolving the name the same way select does.
drop function metaphon;
# Should call the SF
select metaphon("Hello");
# Drop the SF
drop function metaphon;
# Change the current database to none.
use db_31767;
drop database db_31767;
drop function if exists no_such_func;
--error ER_SP_DOES_NOT_EXIST
drop function no_such_func;
drop function if exists test.no_such_func;
--error ER_SP_DOES_NOT_EXIST
drop function test.no_such_func;
--error ER_NO_DB_ERROR
drop procedure if exists no_such_proc;
--error ER_NO_DB_ERROR
drop procedure no_such_proc;
use test;
--echo # --echo #
--echo # Bug#46259: 5.0.83 -> 5.1.36, query doesn't work --echo # Bug#46259: 5.0.83 -> 5.1.36, query doesn't work
--echo # --echo #
......
...@@ -192,6 +192,13 @@ ADD_CUSTOM_COMMAND( ...@@ -192,6 +192,13 @@ ADD_CUSTOM_COMMAND(
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen_lex_hash.cc) DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen_lex_hash.cc)
MYSQL_ADD_EXECUTABLE(mysql_tzinfo_to_sql tztime.cc)
SET_TARGET_PROPERTIES(mysql_tzinfo_to_sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL")
TARGET_LINK_LIBRARIES(mysql_tzinfo_to_sql ${MYSQLD_STATIC_PLUGIN_LIBS}
mysys dbug strings vio regex
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
${SSL_LIBRARIES})
ADD_CUSTOM_TARGET( ADD_CUSTOM_TARGET(
GenServerSource GenServerSource
DEPENDS ${GEN_SOURCES} DEPENDS ${GEN_SOURCES}
......
...@@ -47,6 +47,8 @@ FOREACH (dir ${dirs}) ...@@ -47,6 +47,8 @@ FOREACH (dir ${dirs})
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir} INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}
DESTINATION ${INSTALL_MYSQLSHAREDIR}) DESTINATION ${INSTALL_MYSQLSHAREDIR})
ENDFOREACH() ENDFOREACH()
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets DESTINATION ${INSTALL_MYSQLSHAREDIR}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets DESTINATION ${INSTALL_MYSQLSHAREDIR}
PATTERN "languages.html" EXCLUDE
)
INSTALL(FILES ${files} DESTINATION ${INSTALL_MYSQLSHAREDIR}) INSTALL(FILES ${files} DESTINATION ${INSTALL_MYSQLSHAREDIR})
...@@ -4132,6 +4132,47 @@ create_sp_error: ...@@ -4132,6 +4132,47 @@ create_sp_error:
case SQLCOM_DROP_PROCEDURE: case SQLCOM_DROP_PROCEDURE:
case SQLCOM_DROP_FUNCTION: case SQLCOM_DROP_FUNCTION:
{ {
#ifdef HAVE_DLOPEN
if (lex->sql_command == SQLCOM_DROP_FUNCTION &&
! lex->spname->m_explicit_name)
{
/* DROP FUNCTION <non qualified name> */
udf_func *udf = find_udf(lex->spname->m_name.str,
lex->spname->m_name.length);
if (udf)
{
if (check_access(thd, DELETE_ACL, "mysql", NULL, NULL, 1, 0))
goto error;
if (!(res = mysql_drop_function(thd, &lex->spname->m_name)))
{
my_ok(thd);
break;
}
my_error(ER_SP_DROP_FAILED, MYF(0),
"FUNCTION (UDF)", lex->spname->m_name.str);
goto error;
}
if (lex->spname->m_db.str == NULL)
{
if (lex->drop_if_exists)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_SP_DOES_NOT_EXIST, ER(ER_SP_DOES_NOT_EXIST),
"FUNCTION (UDF)", lex->spname->m_name.str);
res= FALSE;
my_ok(thd);
break;
}
my_error(ER_SP_DOES_NOT_EXIST, MYF(0),
"FUNCTION (UDF)", lex->spname->m_name.str);
goto error;
}
/* Fall thought to test for a stored function */
}
#endif
int sp_result; int sp_result;
int type= (lex->sql_command == SQLCOM_DROP_PROCEDURE ? int type= (lex->sql_command == SQLCOM_DROP_PROCEDURE ?
TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION); TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION);
...@@ -4178,34 +4219,6 @@ create_sp_error: ...@@ -4178,34 +4219,6 @@ create_sp_error:
} }
#endif #endif
} }
else
{
#ifdef HAVE_DLOPEN
if (lex->sql_command == SQLCOM_DROP_FUNCTION)
{
udf_func *udf = find_udf(lex->spname->m_name.str,
lex->spname->m_name.length);
if (udf)
{
if (check_access(thd, DELETE_ACL, "mysql", NULL, NULL, 1, 0))
goto error;
if (!(res = mysql_drop_function(thd, &lex->spname->m_name)))
{
my_ok(thd);
break;
}
}
}
#endif
if (lex->spname->m_db.str)
sp_result= SP_KEY_NOT_FOUND;
else
{
my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
goto error;
}
}
res= sp_result; res= sp_result;
switch (sp_result) { switch (sp_result) {
case SP_OK: case SP_OK:
...@@ -4217,7 +4230,7 @@ create_sp_error: ...@@ -4217,7 +4230,7 @@ create_sp_error:
res= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); res= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_SP_DOES_NOT_EXIST, ER(ER_SP_DOES_NOT_EXIST), ER_SP_DOES_NOT_EXIST, ER(ER_SP_DOES_NOT_EXIST),
SP_COM_STRING(lex), lex->spname->m_name.str); SP_COM_STRING(lex), lex->spname->m_qname.str);
if (!res) if (!res)
my_ok(thd); my_ok(thd);
break; break;
......
...@@ -78,8 +78,8 @@ IF(NOT CMAKE_CROSSCOMPILING) ...@@ -78,8 +78,8 @@ IF(NOT CMAKE_CROSSCOMPILING)
) )
ENDIF() ENDIF()
IF(HAVE_IBGCC_ATOMIC_BUILTINS) IF(HAVE_IB_GCC_ATOMIC_BUILTINS)
ADD_DEFINITIONS(-DHAVE_IBGCCC_ATOMIC_BUILTINS=1) ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_BUILTINS=1)
ENDIF() ENDIF()
# either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment