merge mysql-next-mr-alik

This commit is contained in:
Vladislav Vaintroub 2009-09-24 12:35:16 +02:00
commit 626bac8471
133 changed files with 10490 additions and 1874 deletions

View file

@ -1,4 +1,4 @@
[MYSQL]
post_commit_to = "commits@lists.mysql.com"
post_push_to = "commits@lists.mysql.com"
tree_name = "mysql-5.4.5-next-mr"
tree_name = "mysql-5.4.5-next-mr-signal"

View file

@ -3064,3 +3064,4 @@ sql/share/spanish
sql/share/swedish
sql/share/ukrainian
libmysqld/examples/mysqltest.cc
libmysqld/sql_signal.cc

View file

@ -39,6 +39,17 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
#define MY_INIT(name); { my_progname= name; my_init(); }
/**
Max length of an error message generated by mysys utilities.
Some mysys functions produce error messages. These mostly go
to stderr.
This constant defines the size of the buffer used to format
the message. It should be kept in sync with MYSQL_ERRMSG_SIZE,
since sometimes mysys errors are stored in the server diagnostics
area, and we would like to avoid unexpected truncation.
*/
#define MYSYS_ERRMSG_SIZE (512)
#define MY_FILE_ERROR ((size_t) -1)
/* General bitmaps for my_func's */
@ -90,8 +101,6 @@ extern int NEAR my_errno; /* Last error in mysys */
#define ME_COLOUR2 ((2 << ME_HIGHBYTE))
#define ME_COLOUR3 ((3 << ME_HIGHBYTE))
#define ME_FATALERROR 1024 /* Fatal statement error */
#define ME_NO_WARNING_FOR_ERROR 2048 /* Don't push a warning for error */
#define ME_NO_SP_HANDLER 4096 /* Don't call stored routine error handlers */
/* Bits in last argument to fn_format */
#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */
@ -210,8 +219,8 @@ extern int errno; /* declare errno */
extern char *home_dir; /* Home directory for user */
extern const char *my_progname; /* program-name (printed in errors) */
extern char NEAR curr_dir[]; /* Current directory for user */
extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
extern int (*fatal_error_handler_hook)(uint my_err, const char *str,
extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
myf MyFlags);
extern uint my_file_limit;
extern ulong my_thread_stack_size;
@ -658,15 +667,15 @@ extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_sync(File fd, myf my_flags);
extern int my_sync_dir(const char *dir_name, myf my_flags);
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
extern int my_error _VARARGS((int nr,myf MyFlags, ...));
extern int my_printf_error _VARARGS((uint my_err, const char *format,
myf MyFlags, ...))
ATTRIBUTE_FORMAT(printf, 2, 4);
extern void my_error _VARARGS((int nr,myf MyFlags, ...));
extern void my_printf_error _VARARGS((uint my_err, const char *format,
myf MyFlags, ...))
ATTRIBUTE_FORMAT(printf, 2, 4);
extern int my_error_register(const char **errmsgs, int first, int last);
extern const char **my_error_unregister(int first, int last);
extern int my_message(uint my_err, const char *str,myf MyFlags);
extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags);
extern int my_message_curses(uint my_err, const char *str,myf MyFlags);
extern void my_message(uint my_err, const char *str,myf MyFlags);
extern void my_message_no_curses(uint my_err, const char *str,myf MyFlags);
extern void my_message_curses(uint my_err, const char *str,myf MyFlags);
extern my_bool my_init(void);
extern void my_end(int infoflag);
extern int my_redel(const char *from, const char *to, int MyFlags);

View file

@ -139,6 +139,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
../sql/partition_info.cc ../sql/sql_connect.cc
../sql/scheduler.cc ../sql/event_parse_data.cc
./sql/sql_signal.cc
${GEN_SOURCES}
${LIB_SOURCES})

View file

@ -77,7 +77,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
sql_tablespace.cc \
rpl_injector.cc my_user.c partition_info.cc \
sql_servers.cc event_parse_data.cc
sql_servers.cc event_parse_data.cc sql_signal.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources)
nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)

View file

@ -483,7 +483,8 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
*prev_row= NULL;
data->embedded_info->prev_ptr= prev_row;
return_ok:
net_send_eof(thd, thd->server_status, thd->total_warn_count);
net_send_eof(thd, thd->server_status,
thd->warning_info->statement_warn_count());
DBUG_RETURN(0);
err:
DBUG_RETURN(1);

View file

@ -112,7 +112,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
/* Clear result variables */
thd->clear_error();
thd->main_da.reset_diagnostics_area();
thd->stmt_da->reset_diagnostics_area();
mysql->affected_rows= ~(my_ulonglong) 0;
mysql->field_count= 0;
net_clear_error(net);
@ -217,7 +217,7 @@ static my_bool emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
stmt->stmt_id= thd->client_stmt_id;
stmt->param_count= thd->client_param_count;
stmt->field_count= 0;
mysql->warning_count= thd->total_warn_count;
mysql->warning_count= thd->warning_info->statement_warn_count();
if (thd->first_data)
{
@ -402,7 +402,7 @@ static void emb_free_embedded_thd(MYSQL *mysql)
static const char * emb_read_statistics(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
return thd->is_error() ? thd->main_da.message() : "";
return thd->is_error() ? thd->stmt_da->message() : "";
}
@ -703,9 +703,10 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
err:
{
NET *net= &mysql->net;
strmake(net->last_error, thd->main_da.message(), sizeof(net->last_error)-1);
strmake(net->last_error, thd->stmt_da->message(),
sizeof(net->last_error)-1);
memcpy(net->sqlstate,
mysql_errno_to_sqlstate(thd->main_da.sql_errno()),
mysql_errno_to_sqlstate(thd->stmt_da->sql_errno()),
sizeof(net->sqlstate)-1);
}
return result;
@ -729,8 +730,8 @@ void THD::clear_data_list()
void THD::clear_error()
{
if (main_da.is_error())
main_da.reset_diagnostics_area();
if (stmt_da->is_error())
stmt_da->reset_diagnostics_area();
}
static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length,
@ -804,7 +805,7 @@ MYSQL_DATA *THD::alloc_new_dataset()
static
bool
write_eof_packet(THD *thd, uint server_status, uint total_warn_count)
write_eof_packet(THD *thd, uint server_status, uint statement_warn_count)
{
if (!thd->mysql) // bootstrap file handling
return FALSE;
@ -821,7 +822,7 @@ write_eof_packet(THD *thd, uint server_status, uint total_warn_count)
is cleared between substatements, and mysqltest gets confused
*/
thd->cur_data->embedded_info->warning_count=
(thd->spcont ? 0 : min(total_warn_count, 65535));
(thd->spcont ? 0 : min(statement_warn_count, 65535));
return FALSE;
}
@ -978,7 +979,8 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
}
if (flags & SEND_EOF)
write_eof_packet(thd, thd->server_status, thd->total_warn_count);
write_eof_packet(thd, thd->server_status,
thd->warning_info->statement_warn_count());
DBUG_RETURN(prepare_for_send(list));
err:
@ -1040,25 +1042,24 @@ bool Protocol_binary::write()
bool
net_send_ok(THD *thd,
uint server_status, uint total_warn_count,
ha_rows affected_rows, ulonglong id, const char *message)
uint server_status, uint statement_warn_count,
ulonglong affected_rows, ulonglong id, const char *message)
{
DBUG_ENTER("emb_net_send_ok");
MYSQL_DATA *data;
bool error;
MYSQL *mysql= thd->mysql;
if (!mysql) // bootstrap file handling
DBUG_RETURN(FALSE);
if (!(data= thd->alloc_new_dataset()))
return TRUE;
DBUG_RETURN(TRUE);
data->embedded_info->affected_rows= affected_rows;
data->embedded_info->insert_id= id;
if (message)
strmake(data->embedded_info->info, message,
sizeof(data->embedded_info->info)-1);
error= write_eof_packet(thd, server_status, total_warn_count);
bool error= write_eof_packet(thd, server_status, statement_warn_count);
thd->cur_data= 0;
DBUG_RETURN(error);
}
@ -1075,15 +1076,16 @@ net_send_ok(THD *thd,
*/
bool
net_send_eof(THD *thd, uint server_status, uint total_warn_count)
net_send_eof(THD *thd, uint server_status, uint statement_warn_count)
{
bool error= write_eof_packet(thd, server_status, total_warn_count);
bool error= write_eof_packet(thd, server_status, statement_warn_count);
thd->cur_data= 0;
return error;
}
bool net_send_error_packet(THD *thd, uint sql_errno, const char *err)
bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
const char *sqlstate)
{
MYSQL_DATA *data= thd->cur_data;
struct embedded_query_result *ei;
@ -1100,7 +1102,7 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err)
ei= data->embedded_info;
ei->last_errno= sql_errno;
strmake(ei->info, err, sizeof(ei->info)-1);
strmov(ei->sqlstate, mysql_errno_to_sqlstate(sql_errno));
strmov(ei->sqlstate, sqlstate);
ei->server_status= thd->server_status;
thd->cur_data= 0;
return FALSE;

View file

@ -362,12 +362,12 @@ select cast(19999999999999999999 as signed);
cast(19999999999999999999 as signed)
9223372036854775807
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select cast(-19999999999999999999 as signed);
cast(-19999999999999999999 as signed)
-9223372036854775808
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select -9223372036854775808;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def -9223372036854775808 8 20 20 N 32897 0 63

View file

@ -380,7 +380,7 @@ select cast(s1 as decimal(7,2)) from t1;
cast(s1 as decimal(7,2))
99999.99
Warnings:
Error 1264 Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
Warning 1264 Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
drop table t1;
CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
mt mediumtext, lt longtext);

View file

@ -1631,27 +1631,27 @@ select char(0xff,0x8f using utf8);
char(0xff,0x8f using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FF8F'
Warning 1300 Invalid utf8 character string: 'FF8F'
select char(195 using utf8);
char(195 using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'C3'
Warning 1300 Invalid utf8 character string: 'C3'
select char(196 using utf8);
char(196 using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'C4'
Warning 1300 Invalid utf8 character string: 'C4'
select char(2557 using utf8);
char(2557 using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FD'
Warning 1300 Invalid utf8 character string: 'FD'
select convert(char(0xff,0x8f) using utf8);
convert(char(0xff,0x8f) using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FF8F'
Warning 1300 Invalid utf8 character string: 'FF8F'
select hex(convert(char(2557 using latin1) using utf8));
hex(convert(char(2557 using latin1) using utf8))
09C3BD
@ -1815,12 +1815,12 @@ select hex(char(0xFF using utf8));
hex(char(0xFF using utf8))
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FF'
Warning 1300 Invalid utf8 character string: 'FF'
select hex(convert(0xFF using utf8));
hex(convert(0xFF using utf8))
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FF'
Warning 1300 Invalid utf8 character string: 'FF'
select hex(_utf8 0x616263FF);
ERROR HY000: Invalid utf8 character string: 'FF'
select hex(_utf8 X'616263FF');

View file

@ -89,7 +89,7 @@ select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T');
STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T')
NULL
Warnings:
Error 1411 Incorrect time value: '22.30.61' for function str_to_date
Warning 1411 Incorrect time value: '22.30.61' for function str_to_date
create table t1 (date char(30), format char(30) not null);
insert into t1 values
('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'),
@ -361,21 +361,21 @@ Tuesday 52 2001 %W %u %x NULL
7 53 1998 %w %u %Y NULL
NULL %m.%d.%Y NULL
Warnings:
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
Warning 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
Warning 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
Warning 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
Warning 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
Warning 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
Warning 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Warning 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
select date,format,concat(str_to_date(date, format),'') as con from t1;
date format con
2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL
@ -395,21 +395,21 @@ Tuesday 52 2001 %W %u %x NULL
7 53 1998 %w %u %Y NULL
NULL %m.%d.%Y NULL
Warnings:
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
Warning 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
Warning 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
Warning 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
Warning 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
Warning 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
Warning 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
Warning 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
truncate table t1;
insert into t1 values
('10:20:10AM', '%h:%i:%s'),
@ -449,7 +449,7 @@ select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'));
str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'))
NULL
Warnings:
Error 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date
Warning 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date
explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001");
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used

View file

@ -65,8 +65,8 @@ NULL
50000
NULL
Warnings:
Error 1259 ZLIB: Input data corrupted
Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
Warning 1259 ZLIB: Input data corrupted
Warning 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
drop table t1;
set @@global.max_allowed_packet=1048576*100;
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
@ -96,12 +96,12 @@ explain select * from t1 where uncompress(a) is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
Warnings:
Error 1259 ZLIB: Input data corrupted
Warning 1259 ZLIB: Input data corrupted
select * from t1 where uncompress(a) is null;
a
foo
Warnings:
Error 1259 ZLIB: Input data corrupted
Warning 1259 ZLIB: Input data corrupted
explain select *, uncompress(a) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
@ -109,13 +109,13 @@ select *, uncompress(a) from t1;
a uncompress(a)
foo NULL
Warnings:
Error 1259 ZLIB: Input data corrupted
Warning 1259 ZLIB: Input data corrupted
select *, uncompress(a), uncompress(a) is null from t1;
a uncompress(a) uncompress(a) is null
foo NULL 1
Warnings:
Error 1259 ZLIB: Input data corrupted
Error 1259 ZLIB: Input data corrupted
Warning 1259 ZLIB: Input data corrupted
Warning 1259 ZLIB: Input data corrupted
drop table t1;
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 VALUES (1), (1111), (11111);

View file

@ -124,7 +124,7 @@ select des_encrypt("hello",10);
des_encrypt("hello",10)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_encrypt'
Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(NULL);
des_encrypt(NULL)
NULL
@ -138,12 +138,12 @@ select des_encrypt(10, NULL);
des_encrypt(10, NULL)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_encrypt'
Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt("hello", NULL);
des_encrypt("hello", NULL)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_encrypt'
Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_decrypt("hello",10);
des_decrypt("hello",10)
hello
@ -177,7 +177,7 @@ select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_decrypt'
Warning 1108 Incorrect parameters to procedure 'des_decrypt'
explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden"));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used

View file

@ -2,83 +2,83 @@ select des_encrypt("test", 'akeystr');
des_encrypt("test", 'akeystr')
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 1);
des_encrypt("test", 1)
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 9);
des_encrypt("test", 9)
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 100);
des_encrypt("test", 100)
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", NULL);
des_encrypt("test", NULL)
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt(NULL, NULL);
des_encrypt(NULL, NULL)
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt("test", 'anotherkeystr');
des_decrypt("test", 'anotherkeystr')
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(1, 1);
des_decrypt(1, 1)
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("test", 'thekey'));
des_decrypt(des_encrypt("test", 'thekey'))
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_encrypt("hello")),des_decrypt(des_encrypt("hello"));
hex(des_encrypt("hello")) des_decrypt(des_encrypt("hello"))
NULL NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",4));
des_decrypt(des_encrypt("hello",4))
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",'test'),'test');
des_decrypt(des_encrypt("hello",'test'),'test')
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("hello",'default_password'));
hex(des_encrypt("hello")) hex(des_encrypt("hello",5)) hex(des_encrypt("hello",'default_password'))
NULL NULL NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello"),'default_password');
des_decrypt(des_encrypt("hello"),'default_password')
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",4),'password4');
des_decrypt(des_encrypt("hello",4),'password4')
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
SET @a=des_decrypt(des_encrypt("hello"));
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
flush des_key_file;
select @a = des_decrypt(des_encrypt("hello"));
@a = des_decrypt(des_encrypt("hello"))
@ -90,9 +90,9 @@ select hex(des_decrypt(des_encrypt("hello",4),'password2'));
hex(des_decrypt(des_encrypt("hello",4),'password2'))
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working

View file

@ -153,10 +153,10 @@ grp group_concat(c)
4
5 NULL
Warnings:
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
show warnings;
Level Code Message
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
set group_concat_max_len = 1024;
select group_concat(sum(c)) from t1 group by grp;
ERROR HY000: Invalid use of group function
@ -380,25 +380,29 @@ group_concat(b)
bb,c
BB,C
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(distinct b) from t1 group by a;
group_concat(distinct b)
bb,c
BB,C
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(b order by b) from t1 group by a;
group_concat(b order by b)
a,bb
A,BB
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
Warning 1260 Row 6 was cut by GROUP_CONCAT()
select group_concat(distinct b order by b) from t1 group by a;
group_concat(distinct b order by b)
a,bb
A,BB
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
Warning 1260 Row 6 was cut by GROUP_CONCAT()
insert into t1 values (1, concat(repeat('1', 300), '2')),
(1, concat(repeat('1', 300), '2')), (1, concat(repeat('0', 300), '1')),
(2, concat(repeat('1', 300), '2')), (2, concat(repeat('1', 300), '2')),
@ -426,25 +430,29 @@ group_concat(b)
bb,ccc,a,bb,ccc,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111
BB,CCC,A,BB,CCC,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 7 was cut by GROUP_CONCAT()
Warning 1260 Row 14 was cut by GROUP_CONCAT()
select group_concat(distinct b) from t1 group by a;
group_concat(distinct b)
bb,ccc,a,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
BB,CCC,A,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 5 was cut by GROUP_CONCAT()
Warning 1260 Row 10 was cut by GROUP_CONCAT()
select group_concat(b order by b) from t1 group by a;
group_concat(b order by b)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(distinct b order by b) from t1 group by a;
group_concat(distinct b order by b)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 4 was cut by GROUP_CONCAT()
drop table t1;
create table t1 (a varchar(255) character set cp1250 collate cp1250_general_ci,
b varchar(255) character set koi8r);
@ -751,22 +759,22 @@ SELECT GROUP_CONCAT( a ) FROM t1;
GROUP_CONCAT( a )
aaaaaaaaaa,bbbbbbbbb
Warnings:
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
GROUP_CONCAT( DISTINCT a )
aaaaaaaaaa,bbbbbbbbb
Warnings:
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
GROUP_CONCAT( a ORDER BY b )
aaaaaaaaaa,bbbbbbbbb
Warnings:
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
GROUP_CONCAT( DISTINCT a ORDER BY b )
aaaaaaaaaa,bbbbbbbbb
Warnings:
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
SET group_concat_max_len = DEFAULT;
DROP TABLE t1;
SET group_concat_max_len= 65535;
@ -979,3 +987,31 @@ GROUP BY t1.a
1
DROP TABLE t1, t2;
End of 5.0 tests
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a VARCHAR(6), b INT);
CREATE TABLE t2 (a VARCHAR(6), b INT);
INSERT INTO t1 VALUES ('111111', 1);
INSERT INTO t1 VALUES ('222222', 2);
INSERT INTO t1 VALUES ('333333', 3);
INSERT INTO t1 VALUES ('444444', 4);
INSERT INTO t1 VALUES ('555555', 5);
SET group_concat_max_len = 5;
SET @old_sql_mode = @@sql_mode, @@sql_mode = 'traditional';
SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b LIMIT 3;
GROUP_CONCAT(a) b
11111 1
22222 2
33333 3
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
ERROR HY000: Row 1 was cut by GROUP_CONCAT()
UPDATE t1 SET a = '11111' WHERE b = 1;
UPDATE t1 SET a = '22222' WHERE b = 2;
INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
ERROR HY000: Row 3 was cut by GROUP_CONCAT()
SET group_concat_max_len = DEFAULT;
SET @@sql_mode = @old_sql_mode;
DROP TABLE t1, t2;

View file

@ -225,27 +225,27 @@ select ln(-1);
ln(-1)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select log10(-1);
log10(-1)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select log2(-1);
log2(-1)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select log(2,-1);
log(2,-1)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select log(-2,1);
log(-2,1)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
set sql_mode='';
select round(111,-10);
round(111,-10)

View file

@ -1433,7 +1433,7 @@ select benchmark(-1, 1);
benchmark(-1, 1)
NULL
Warnings:
Error 1411 Incorrect count value: '-1' for function benchmark
Warning 1411 Incorrect count value: '-1' for function benchmark
set @password="password";
set @my_data="clear text to encode";
select md5(encode(@my_data, "password"));
@ -1533,7 +1533,7 @@ select locate('lo','hello',-18446744073709551615);
locate('lo','hello',-18446744073709551615)
0
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',18446744073709551615);
locate('lo','hello',18446744073709551615)
0
@ -1541,22 +1541,22 @@ select locate('lo','hello',-18446744073709551616);
locate('lo','hello',-18446744073709551616)
0
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',18446744073709551616);
locate('lo','hello',18446744073709551616)
0
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',-18446744073709551617);
locate('lo','hello',-18446744073709551617)
0
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',18446744073709551617);
locate('lo','hello',18446744073709551617)
0
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 10);
left('hello', 10)
hello
@ -1588,8 +1588,8 @@ select left('hello', -18446744073709551615);
left('hello', -18446744073709551615)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 18446744073709551615);
left('hello', 18446744073709551615)
hello
@ -1597,26 +1597,26 @@ select left('hello', -18446744073709551616);
left('hello', -18446744073709551616)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 18446744073709551616);
left('hello', 18446744073709551616)
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', -18446744073709551617);
left('hello', -18446744073709551617)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 18446744073709551617);
left('hello', 18446744073709551617)
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 10);
right('hello', 10)
hello
@ -1648,8 +1648,8 @@ select right('hello', -18446744073709551615);
right('hello', -18446744073709551615)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 18446744073709551615);
right('hello', 18446744073709551615)
hello
@ -1657,26 +1657,26 @@ select right('hello', -18446744073709551616);
right('hello', -18446744073709551616)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 18446744073709551616);
right('hello', 18446744073709551616)
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', -18446744073709551617);
right('hello', -18446744073709551617)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 18446744073709551617);
right('hello', 18446744073709551617)
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 2, -1);
substring('hello', 2, -1)
@ -1708,8 +1708,8 @@ select substring('hello', -18446744073709551615, 1);
substring('hello', -18446744073709551615, 1)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551615, 1);
substring('hello', 18446744073709551615, 1)
@ -1717,26 +1717,26 @@ select substring('hello', -18446744073709551616, 1);
substring('hello', -18446744073709551616, 1)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551616, 1);
substring('hello', 18446744073709551616, 1)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', -18446744073709551617, 1);
substring('hello', -18446744073709551617, 1)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551617, 1);
substring('hello', 18446744073709551617, 1)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, -1);
substring('hello', 1, -1)
@ -1762,8 +1762,8 @@ select substring('hello', 1, -18446744073709551615);
substring('hello', 1, -18446744073709551615)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, 18446744073709551615);
substring('hello', 1, 18446744073709551615)
hello
@ -1771,26 +1771,26 @@ select substring('hello', 1, -18446744073709551616);
substring('hello', 1, -18446744073709551616)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, 18446744073709551616);
substring('hello', 1, 18446744073709551616)
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, -18446744073709551617);
substring('hello', 1, -18446744073709551617)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, 18446744073709551617);
substring('hello', 1, 18446744073709551617)
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', -1, -1);
substring('hello', -1, -1)
@ -1816,10 +1816,10 @@ select substring('hello', -18446744073709551615, -18446744073709551615);
substring('hello', -18446744073709551615, -18446744073709551615)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551615, 18446744073709551615);
substring('hello', 18446744073709551615, 18446744073709551615)
@ -1827,34 +1827,34 @@ select substring('hello', -18446744073709551616, -18446744073709551616);
substring('hello', -18446744073709551616, -18446744073709551616)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551616, 18446744073709551616);
substring('hello', 18446744073709551616, 18446744073709551616)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', -18446744073709551617, -18446744073709551617);
substring('hello', -18446744073709551617, -18446744073709551617)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551617, 18446744073709551617);
substring('hello', 18446744073709551617, 18446744073709551617)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -1, 1, 'hi');
insert('hello', -1, 1, 'hi')
hello
@ -1880,7 +1880,7 @@ select insert('hello', -18446744073709551615, 1, 'hi');
insert('hello', -18446744073709551615, 1, 'hi')
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551615, 1, 'hi');
insert('hello', 18446744073709551615, 1, 'hi')
hello
@ -1888,22 +1888,22 @@ select insert('hello', -18446744073709551616, 1, 'hi');
insert('hello', -18446744073709551616, 1, 'hi')
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551616, 1, 'hi');
insert('hello', 18446744073709551616, 1, 'hi')
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -18446744073709551617, 1, 'hi');
insert('hello', -18446744073709551617, 1, 'hi')
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551617, 1, 'hi');
insert('hello', 18446744073709551617, 1, 'hi')
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, -1, 'hi');
insert('hello', 1, -1, 'hi')
hi
@ -1929,7 +1929,7 @@ select insert('hello', 1, -18446744073709551615, 'hi');
insert('hello', 1, -18446744073709551615, 'hi')
hi
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, 18446744073709551615, 'hi');
insert('hello', 1, 18446744073709551615, 'hi')
hi
@ -1937,22 +1937,22 @@ select insert('hello', 1, -18446744073709551616, 'hi');
insert('hello', 1, -18446744073709551616, 'hi')
hi
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, 18446744073709551616, 'hi');
insert('hello', 1, 18446744073709551616, 'hi')
hi
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, -18446744073709551617, 'hi');
insert('hello', 1, -18446744073709551617, 'hi')
hi
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, 18446744073709551617, 'hi');
insert('hello', 1, 18446744073709551617, 'hi')
hi
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -1, -1, 'hi');
insert('hello', -1, -1, 'hi')
hello
@ -1978,8 +1978,8 @@ select insert('hello', -18446744073709551615, -18446744073709551615, 'hi');
insert('hello', -18446744073709551615, -18446744073709551615, 'hi')
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551615, 18446744073709551615, 'hi');
insert('hello', 18446744073709551615, 18446744073709551615, 'hi')
hello
@ -1987,26 +1987,26 @@ select insert('hello', -18446744073709551616, -18446744073709551616, 'hi');
insert('hello', -18446744073709551616, -18446744073709551616, 'hi')
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551616, 18446744073709551616, 'hi');
insert('hello', 18446744073709551616, 18446744073709551616, 'hi')
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -18446744073709551617, -18446744073709551617, 'hi');
insert('hello', -18446744073709551617, -18446744073709551617, 'hi')
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551617, 18446744073709551617, 'hi');
insert('hello', 18446744073709551617, 18446744073709551617, 'hi')
hello
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', -1);
repeat('hello', -1)
@ -2038,8 +2038,8 @@ select repeat('hello', -18446744073709551615);
repeat('hello', -18446744073709551615)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', 18446744073709551615);
repeat('hello', 18446744073709551615)
NULL
@ -2049,27 +2049,27 @@ select repeat('hello', -18446744073709551616);
repeat('hello', -18446744073709551616)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', 18446744073709551616);
repeat('hello', 18446744073709551616)
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select repeat('hello', -18446744073709551617);
repeat('hello', -18446744073709551617)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', 18446744073709551617);
repeat('hello', 18446744073709551617)
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select space(-1);
space(-1)
@ -2102,8 +2102,8 @@ select space(-18446744073709551615);
space(-18446744073709551615)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select space(18446744073709551615);
space(18446744073709551615)
NULL
@ -2113,27 +2113,27 @@ select space(-18446744073709551616);
space(-18446744073709551616)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select space(18446744073709551616);
space(18446744073709551616)
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select space(-18446744073709551617);
space(-18446744073709551617)
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select space(18446744073709551617);
space(18446744073709551617)
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select rpad('hello', -1, '1');
rpad('hello', -1, '1')
@ -2166,8 +2166,8 @@ select rpad('hello', -18446744073709551615, '1');
rpad('hello', -18446744073709551615, '1')
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select rpad('hello', 18446744073709551615, '1');
rpad('hello', 18446744073709551615, '1')
NULL
@ -2177,27 +2177,27 @@ select rpad('hello', -18446744073709551616, '1');
rpad('hello', -18446744073709551616, '1')
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select rpad('hello', 18446744073709551616, '1');
rpad('hello', 18446744073709551616, '1')
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of rpad() was larger than max_allowed_packet (1048576) - truncated
select rpad('hello', -18446744073709551617, '1');
rpad('hello', -18446744073709551617, '1')
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select rpad('hello', 18446744073709551617, '1');
rpad('hello', 18446744073709551617, '1')
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of rpad() was larger than max_allowed_packet (1048576) - truncated
select lpad('hello', -1, '1');
lpad('hello', -1, '1')
@ -2230,8 +2230,8 @@ select lpad('hello', -18446744073709551615, '1');
lpad('hello', -18446744073709551615, '1')
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select lpad('hello', 18446744073709551615, '1');
lpad('hello', 18446744073709551615, '1')
NULL
@ -2241,27 +2241,27 @@ select lpad('hello', -18446744073709551616, '1');
lpad('hello', -18446744073709551616, '1')
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select lpad('hello', 18446744073709551616, '1');
lpad('hello', 18446744073709551616, '1')
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated
select lpad('hello', -18446744073709551617, '1');
lpad('hello', -18446744073709551617, '1')
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select lpad('hello', 18446744073709551617, '1');
lpad('hello', 18446744073709551617, '1')
NULL
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated
SET @orig_sql_mode = @@SQL_MODE;
SET SQL_MODE=traditional;
@ -2269,12 +2269,12 @@ SELECT CHAR(0xff,0x8f USING utf8);
CHAR(0xff,0x8f USING utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FF8F'
Warning 1300 Invalid utf8 character string: 'FF8F'
SELECT CHAR(0xff,0x8f USING utf8) IS NULL;
CHAR(0xff,0x8f USING utf8) IS NULL
1
Warnings:
Error 1300 Invalid utf8 character string: 'FF8F'
Warning 1300 Invalid utf8 character string: 'FF8F'
SET SQL_MODE=@orig_sql_mode;
select substring('abc', cast(2 as unsigned int));
substring('abc', cast(2 as unsigned int))

View file

@ -942,25 +942,29 @@ group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
drop table t1, t2;
set group_concat_max_len=default;
create table t1 (gid smallint(5) unsigned not null, x int(11) not null, y int(11) not null, art int(11) not null, primary key (gid,x,y));

View file

@ -914,7 +914,7 @@ SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
CHECK TABLE tm1;
Table Op Msg_type Msg_text
test.tm1 check Error Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check Warning Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check error Corrupt
ALTER TABLE t2 MODIFY a INT;

View file

@ -2,7 +2,7 @@ drop table if exists t1,t2;
create table t1 (a int) engine=myisam;
drop table if exists t1;
Warnings:
Error 2 Can't find file: 't1' (errno: 2)
Warning 2 Can't find file: 't1' (errno: 2)
create table t1 (a int) engine=myisam;
drop table t1;
Got one of the listed errors

View file

@ -1226,7 +1226,6 @@ COMMIT;
END|
CALL test.p1(12);
Warnings:
Note 1051 Unknown table 't1'
Warning 1196 Some non-transactional changed tables couldn't be rolled back
CALL test.p1(13);
Warnings:

View file

@ -2748,17 +2748,21 @@ Warnings:
Note 1051 Unknown table 't1'
call proc_1();
Level Code Message
Note 1051 Unknown table 't1'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
call proc_1();
Level Code Message
Note 1051 Unknown table 't2'
drop table if exists t1, t2;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
call proc_1();
Level Code Message
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
drop procedure proc_1;
create function func_1() returns int begin show warnings; return 1; end|
ERROR 0A000: Not allowed to return a result set from a function

View file

@ -889,7 +889,7 @@ select group_concat(a) FROM t1 group by b;
group_concat(a)
1234567890
Warnings:
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
Warning 1260 Row 1 was cut by GROUP_CONCAT()
set group_concat_max_len=1024;
select group_concat(a) FROM t1 group by b;
group_concat(a)
@ -992,19 +992,19 @@ COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 0
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid';
COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 0
Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid';
COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 0
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0

2362
mysql-test/r/signal.result Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,35 @@
use test;
drop procedure if exists signal_proc;
drop function if exists signal_func;
create procedure signal_proc()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
SIGNAL foo;
SIGNAL foo SET MESSAGE_TEXT = "This is an error message";
RESIGNAL foo;
RESIGNAL foo SET MESSAGE_TEXT = "This is an error message";
end $$
create function signal_func() returns int
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
SIGNAL foo;
SIGNAL foo SET MESSAGE_TEXT = "This is an error message";
RESIGNAL foo;
RESIGNAL foo SET MESSAGE_TEXT = "This is an error message";
return 0;
end $$
show procedure code signal_proc;
Pos Instruction
0 stmt 136 "SIGNAL foo"
1 stmt 136 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
2 stmt 137 "RESIGNAL foo"
3 stmt 137 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
drop procedure signal_proc;
show function code signal_func;
Pos Instruction
0 stmt 136 "SIGNAL foo"
1 stmt 136 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
2 stmt 137 "RESIGNAL foo"
3 stmt 137 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
4 freturn 3 0
drop function signal_func;

View file

@ -0,0 +1,270 @@
drop database if exists demo;
create database demo;
use demo;
create table ab_physical_person (
person_id integer,
first_name VARCHAR(50),
middle_initial CHAR,
last_name VARCHAR(50),
primary key (person_id));
create table ab_moral_person (
company_id integer,
name VARCHAR(100),
primary key (company_id));
create table in_inventory (
item_id integer,
descr VARCHAR(50),
stock integer,
primary key (item_id));
create table po_order (
po_id integer auto_increment,
cust_type char, /* arc relationship, see cust_id */
cust_id integer, /* FK to ab_physical_person *OR* ab_moral_person */
primary key (po_id));
create table po_order_line (
po_id integer, /* FK to po_order.po_id */
line_no integer,
item_id integer, /* FK to in_inventory.item_id */
qty integer);
#
# Schema integrity enforcement
#
create procedure check_pk_person(in person_type char, in id integer)
begin
declare x integer;
declare msg varchar(128);
/*
Test integrity constraints for an 'arc' relationship.
Based on 'person_type', 'id' points to either a
physical person, or a moral person.
*/
case person_type
when 'P' then
begin
select count(person_id) from ab_physical_person
where ab_physical_person.person_id = id
into x;
if (x != 1)
then
set msg= concat('No such physical person, PK:', id);
SIGNAL SQLSTATE '45000' SET
MESSAGE_TEXT = msg,
MYSQL_ERRNO = 10000;
end if;
end;
when 'M' then
begin
select count(company_id) from ab_moral_person
where ab_moral_person.company_id = id
into x;
if (x != 1)
then
set msg= concat('No such moral person, PK:', id);
SIGNAL SQLSTATE '45000' SET
MESSAGE_TEXT = msg,
MYSQL_ERRNO = 10000;
end if;
end;
else
begin
set msg= concat('No such person type:', person_type);
SIGNAL SQLSTATE '45000' SET
MESSAGE_TEXT = msg,
MYSQL_ERRNO = 20000;
end;
end case;
end
$$
create procedure check_pk_inventory(in id integer)
begin
declare x integer;
declare msg varchar(128);
select count(item_id) from in_inventory
where in_inventory.item_id = id
into x;
if (x != 1)
then
set msg= concat('Failed integrity constraint, table in_inventory, PK:',
id);
SIGNAL SQLSTATE '45000' SET
MESSAGE_TEXT = msg,
MYSQL_ERRNO = 10000;
end if;
end
$$
create procedure check_pk_order(in id integer)
begin
declare x integer;
declare msg varchar(128);
select count(po_id) from po_order
where po_order.po_id = id
into x;
if (x != 1)
then
set msg= concat('Failed integrity constraint, table po_order, PK:', id);
SIGNAL SQLSTATE '45000' SET
MESSAGE_TEXT = msg,
MYSQL_ERRNO = 10000;
end if;
end
$$
create trigger po_order_bi before insert on po_order
for each row
begin
call check_pk_person(NEW.cust_type, NEW.cust_id);
end
$$
create trigger po_order_bu before update on po_order
for each row
begin
call check_pk_person(NEW.cust_type, NEW.cust_id);
end
$$
create trigger po_order_line_bi before insert on po_order_line
for each row
begin
call check_pk_order(NEW.po_id);
call check_pk_inventory(NEW.item_id);
end
$$
create trigger po_order_line_bu before update on po_order_line
for each row
begin
call check_pk_order(NEW.po_id);
call check_pk_inventory(NEW.item_id);
end
$$
#
# Application helpers
#
create procedure po_create_order(
in p_cust_type char,
in p_cust_id integer,
out id integer)
begin
insert into po_order set cust_type = p_cust_type, cust_id = p_cust_id;
set id = last_insert_id();
end
$$
create procedure po_add_order_line(
in po integer,
in line integer,
in item integer,
in q integer)
begin
insert into po_order_line set
po_id = po, line_no = line, item_id = item, qty = q;
end
$$
#
# Create sample data
#
insert into ab_physical_person values
( 1, "John", "A", "Doe"),
( 2, "Marry", "B", "Smith")
;
insert into ab_moral_person values
( 3, "ACME real estate, INC"),
( 4, "Local school")
;
insert into in_inventory values
( 100, "Table, dinner", 5),
( 101, "Chair", 20),
( 200, "Table, coffee", 3),
( 300, "School table", 25),
( 301, "School chairs", 50)
;
select * from ab_physical_person order by person_id;
person_id first_name middle_initial last_name
1 John A Doe
2 Marry B Smith
select * from ab_moral_person order by company_id;
company_id name
3 ACME real estate, INC
4 Local school
select * from in_inventory order by item_id;
item_id descr stock
100 Table, dinner 5
101 Chair 20
200 Table, coffee 3
300 School table 25
301 School chairs 50
#
# Entering an order
#
set @my_po = 0;
/* John Doe wants 1 table and 4 chairs */
call po_create_order("P", 1, @my_po);
call po_add_order_line (@my_po, 1, 100, 1);
call po_add_order_line (@my_po, 2, 101, 4);
/* Marry Smith wants a coffee table */
call po_create_order("P", 2, @my_po);
call po_add_order_line (@my_po, 1, 200, 1);
#
# Entering bad data in an order
#
call po_add_order_line (@my_po, 1, 999, 1);
ERROR 45000: Failed integrity constraint, table in_inventory, PK:999
#
# Entering bad data in an unknown order
#
call po_add_order_line (99, 1, 100, 1);
ERROR 45000: Failed integrity constraint, table po_order, PK:99
#
# Entering an order for an unknown company
#
call po_create_order("M", 7, @my_po);
ERROR 45000: No such moral person, PK:7
#
# Entering an order for an unknown person type
#
call po_create_order("X", 1, @my_po);
ERROR 45000: No such person type:X
/* The local school wants 10 class tables and 20 chairs */
call po_create_order("M", 4, @my_po);
call po_add_order_line (@my_po, 1, 300, 10);
call po_add_order_line (@my_po, 2, 301, 20);
select * from po_order;
po_id cust_type cust_id
1 P 1
2 P 2
3 M 4
select * from po_order_line;
po_id line_no item_id qty
1 1 100 1
1 2 101 4
2 1 200 1
3 1 300 10
3 2 301 20
select po_id as "PO#",
( case cust_type
when "P" then concat (pp.first_name,
" ",
pp.middle_initial,
" ",
pp.last_name)
when "M" then mp.name
end ) as "Sold to"
from po_order po
left join ab_physical_person pp on po.cust_id = pp.person_id
left join ab_moral_person mp on po.cust_id = company_id
;
PO# Sold to
1 John A Doe
2 Marry B Smith
3 Local school
select po_id as "PO#",
ol.line_no as "Line",
ol.item_id as "Item",
inv.descr as "Description",
ol.qty as "Quantity"
from po_order_line ol, in_inventory inv
where inv.item_id = ol.item_id
order by ol.item_id, ol.line_no;
PO# Line Item Description Quantity
1 1 100 Table, dinner 1
1 2 101 Chair 4
2 1 200 Table, coffee 1
3 1 300 School table 10
3 2 301 School chairs 20
drop database demo;

View file

@ -0,0 +1,197 @@
drop database if exists demo;
create database demo;
use demo;
create procedure proc_top_a(p1 integer)
begin
## DECLARE CONTINUE HANDLER for SQLEXCEPTION, NOT FOUND
begin
end;
select "Starting ...";
call proc_middle_a(p1);
select "The end";
end
$$
create procedure proc_middle_a(p1 integer)
begin
DECLARE l integer;
# without RESIGNAL:
# Should be: DECLARE EXIT HANDLER for SQLEXCEPTION, NOT FOUND
DECLARE EXIT HANDLER for 1 /* not sure how to handle exceptions */
begin
select "Oops ... now what ?";
end;
select "In prod_middle()";
create temporary table t1(a integer, b integer);
select GET_LOCK("user_mutex", 10) into l;
insert into t1 set a = p1, b = p1;
call proc_bottom_a(p1);
select RELEASE_LOCK("user_mutex") into l;
drop temporary table t1;
end
$$
create procedure proc_bottom_a(p1 integer)
begin
select "In proc_bottom()";
if (p1 = 1) then
begin
select "Doing something that works ...";
select * from t1;
end;
end if;
if (p1 = 2) then
begin
select "Doing something that fail (simulate an error) ...";
drop table no_such_table;
end;
end if;
if (p1 = 3) then
begin
select "Doing something that *SHOULD* works ...";
select * from t1;
end;
end if;
end
$$
call proc_top_a(1);
Starting ...
Starting ...
In prod_middle()
In prod_middle()
In proc_bottom()
In proc_bottom()
Doing something that works ...
Doing something that works ...
a b
1 1
The end
The end
call proc_top_a(2);
Starting ...
Starting ...
In prod_middle()
In prod_middle()
In proc_bottom()
In proc_bottom()
Doing something that fail (simulate an error) ...
Doing something that fail (simulate an error) ...
ERROR 42S02: Unknown table 'no_such_table'
call proc_top_a(3);
Starting ...
Starting ...
In prod_middle()
In prod_middle()
ERROR 42S01: Table 't1' already exists
call proc_top_a(1);
Starting ...
Starting ...
In prod_middle()
In prod_middle()
ERROR 42S01: Table 't1' already exists
drop temporary table if exists t1;
create procedure proc_top_b(p1 integer)
begin
select "Starting ...";
call proc_middle_b(p1);
select "The end";
end
$$
create procedure proc_middle_b(p1 integer)
begin
DECLARE l integer;
DECLARE EXIT HANDLER for SQLEXCEPTION, NOT FOUND
begin
begin
DECLARE CONTINUE HANDLER for SQLEXCEPTION, NOT FOUND
begin
/* Ignore errors from the cleanup code */
end;
select "Doing cleanup !";
select RELEASE_LOCK("user_mutex") into l;
drop temporary table t1;
end;
RESIGNAL;
end;
select "In prod_middle()";
create temporary table t1(a integer, b integer);
select GET_LOCK("user_mutex", 10) into l;
insert into t1 set a = p1, b = p1;
call proc_bottom_b(p1);
select RELEASE_LOCK("user_mutex") into l;
drop temporary table t1;
end
$$
create procedure proc_bottom_b(p1 integer)
begin
select "In proc_bottom()";
if (p1 = 1) then
begin
select "Doing something that works ...";
select * from t1;
end;
end if;
if (p1 = 2) then
begin
select "Doing something that fail (simulate an error) ...";
drop table no_such_table;
end;
end if;
if (p1 = 3) then
begin
select "Doing something that *SHOULD* works ...";
select * from t1;
end;
end if;
end
$$
call proc_top_b(1);
Starting ...
Starting ...
In prod_middle()
In prod_middle()
In proc_bottom()
In proc_bottom()
Doing something that works ...
Doing something that works ...
a b
1 1
The end
The end
call proc_top_b(2);
Starting ...
Starting ...
In prod_middle()
In prod_middle()
In proc_bottom()
In proc_bottom()
Doing something that fail (simulate an error) ...
Doing something that fail (simulate an error) ...
Doing cleanup !
Doing cleanup !
ERROR 42S02: Unknown table 'no_such_table'
call proc_top_b(3);
Starting ...
Starting ...
In prod_middle()
In prod_middle()
In proc_bottom()
In proc_bottom()
Doing something that *SHOULD* works ...
Doing something that *SHOULD* works ...
a b
3 3
The end
The end
call proc_top_b(1);
Starting ...
Starting ...
In prod_middle()
In prod_middle()
In proc_bottom()
In proc_bottom()
Doing something that works ...
Doing something that works ...
a b
1 1
The end
The end
drop database demo;

View file

@ -0,0 +1,143 @@
SET @start_global_value = @@global.max_error_count;
SELECT @start_global_value;
@start_global_value
64
SET @start_session_value = @@session.max_error_count;
SELECT @start_session_value;
@start_session_value
64
drop database if exists demo;
create database demo;
use demo;
create procedure proc_1()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_1';
call proc_2();
end
$$
create procedure proc_2()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_2';
call proc_3();
end
$$
create procedure proc_3()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_3';
call proc_4();
end
$$
create procedure proc_4()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_4';
call proc_5();
end
$$
create procedure proc_5()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_5';
call proc_6();
end
$$
create procedure proc_6()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_6';
call proc_7();
end
$$
create procedure proc_7()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_7';
call proc_8();
end
$$
create procedure proc_8()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_8';
call proc_9();
end
$$
create procedure proc_9()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_9';
## Do something that fails, to see how errors are reported
drop table oops_it_is_not_here;
end
$$
call proc_1();
ERROR 45000: Oops in proc_1
show warnings;
Level Code Message
Error 1051 Unknown table 'oops_it_is_not_here'
Error 1642 Oops in proc_9
Error 1642 Oops in proc_8
Error 1642 Oops in proc_7
Error 1642 Oops in proc_6
Error 1642 Oops in proc_5
Error 1642 Oops in proc_4
Error 1642 Oops in proc_3
Error 1642 Oops in proc_2
Error 1642 Oops in proc_1
SET @@session.max_error_count = 5;
SELECT @@session.max_error_count;
@@session.max_error_count
5
call proc_1();
ERROR 45000: Oops in proc_1
show warnings;
Level Code Message
Error 1642 Oops in proc_5
Error 1642 Oops in proc_4
Error 1642 Oops in proc_3
Error 1642 Oops in proc_2
Error 1642 Oops in proc_1
SET @@session.max_error_count = 7;
SELECT @@session.max_error_count;
@@session.max_error_count
7
call proc_1();
ERROR 45000: Oops in proc_1
show warnings;
Level Code Message
Error 1642 Oops in proc_7
Error 1642 Oops in proc_6
Error 1642 Oops in proc_5
Error 1642 Oops in proc_4
Error 1642 Oops in proc_3
Error 1642 Oops in proc_2
Error 1642 Oops in proc_1
SET @@session.max_error_count = 9;
SELECT @@session.max_error_count;
@@session.max_error_count
9
call proc_1();
ERROR 45000: Oops in proc_1
show warnings;
Level Code Message
Error 1642 Oops in proc_9
Error 1642 Oops in proc_8
Error 1642 Oops in proc_7
Error 1642 Oops in proc_6
Error 1642 Oops in proc_5
Error 1642 Oops in proc_4
Error 1642 Oops in proc_3
Error 1642 Oops in proc_2
Error 1642 Oops in proc_1
drop database demo;
SET @@global.max_error_count = @start_global_value;
SELECT @@global.max_error_count;
@@global.max_error_count
64
SET @@session.max_error_count = @start_session_value;
SELECT @@session.max_error_count;
@@session.max_error_count
64

View file

@ -0,0 +1,86 @@
SET @save_sql_mode=@@sql_mode;
SET sql_mode='';
drop procedure if exists p;
drop procedure if exists p2;
drop procedure if exists p3;
create procedure p()
begin
declare utf8_var VARCHAR(128) CHARACTER SET UTF8;
set utf8_var = concat(repeat('A', 128), 'X');
select length(utf8_var), utf8_var;
end
$$
create procedure p2()
begin
declare msg VARCHAR(129) CHARACTER SET UTF8;
set msg = concat(repeat('A', 128), 'X');
select length(msg), msg;
signal sqlstate '55555' set message_text = msg;
end
$$
create procedure p3()
begin
declare name VARCHAR(65) CHARACTER SET UTF8;
set name = concat(repeat('A', 64), 'X');
select length(name), name;
signal sqlstate '55555' set
message_text = 'Message',
table_name = name;
end
$$
call p;
length(utf8_var) utf8_var
128 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Warnings:
Warning 1265 Data truncated for column 'utf8_var' at row 1
call p2;
length(msg) msg
129 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
ERROR 55555: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
call p3;
length(name) name
65 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
ERROR 55555: Message
drop procedure p;
drop procedure p2;
drop procedure p3;
SET sql_mode='STRICT_ALL_TABLES';
create procedure p()
begin
declare utf8_var VARCHAR(128) CHARACTER SET UTF8;
set utf8_var = concat(repeat('A', 128), 'X');
select length(utf8_var), utf8_var;
end
$$
create procedure p2()
begin
declare msg VARCHAR(129) CHARACTER SET UTF8;
set msg = concat(repeat('A', 128), 'X');
select length(msg), msg;
signal sqlstate '55555' set message_text = msg;
end
$$
create procedure p3()
begin
declare name VARCHAR(65) CHARACTER SET UTF8;
set name = concat(repeat('A', 64), 'X');
select length(name), name;
signal sqlstate '55555' set
message_text = 'Message',
table_name = name;
end
$$
call p;
ERROR 22001: Data too long for column 'utf8_var' at row 1
call p2;
length(msg) msg
129 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
ERROR HY000: Data too long for condition item 'MESSAGE_TEXT'
call p3;
length(name) name
65 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
ERROR HY000: Data too long for condition item 'TABLE_NAME'
drop procedure p;
drop procedure p2;
drop procedure p3;
SET @@sql_mode=@save_sql_mode;

View file

@ -97,8 +97,6 @@ end|
call p1()|
a
1
Warnings:
Note 1051 Unknown table 't1'
call p1()|
a
1
@ -371,9 +369,6 @@ call p1(@a)|
create table t1 (a int)
@rsql
create table t2 (a int)
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
select @a|
@a
0
@ -382,9 +377,6 @@ call p1(@a)|
create table t1 (a int)
@rsql
create table t2 (a int)
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
select @a|
@a
0

View file

@ -110,24 +110,6 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
v17 v18 v19 v20
12.00 12.12 12.00 12.12
Warnings:
Warning 1264 Out of range value for column 'v1' at row 1
Warning 1264 Out of range value for column 'v1u' at row 1
Warning 1264 Out of range value for column 'v2' at row 1
Warning 1264 Out of range value for column 'v2u' at row 1
Warning 1264 Out of range value for column 'v3' at row 1
Warning 1264 Out of range value for column 'v3u' at row 1
Warning 1264 Out of range value for column 'v4' at row 1
Warning 1264 Out of range value for column 'v4u' at row 1
Warning 1264 Out of range value for column 'v5' at row 1
Warning 1264 Out of range value for column 'v5u' at row 1
Warning 1264 Out of range value for column 'v6' at row 1
Warning 1264 Out of range value for column 'v6u' at row 1
Warning 1366 Incorrect integer value: 'String 10 ' for column 'v10' at row 1
Warning 1366 Incorrect integer value: 'String10' for column 'v11' at row 1
Warning 1265 Data truncated for column 'v12' at row 1
Warning 1265 Data truncated for column 'v13' at row 1
Warning 1366 Incorrect integer value: 'Hello, world' for column 'v16' at row 1
Note 1265 Data truncated for column 'v18' at row 1
Note 1265 Data truncated for column 'v20' at row 1
CALL sp_vars_check_assignment();
i1 i2 i3 i4
@ -143,21 +125,6 @@ d1 d2 d3
d1 d2 d3
1234.00 1234.12 1234.12
Warnings:
Warning 1264 Out of range value for column 'i1' at row 1
Warning 1264 Out of range value for column 'i2' at row 1
Warning 1264 Out of range value for column 'i3' at row 1
Warning 1264 Out of range value for column 'i4' at row 1
Warning 1264 Out of range value for column 'i1' at row 1
Warning 1264 Out of range value for column 'i2' at row 1
Warning 1264 Out of range value for column 'i3' at row 1
Warning 1264 Out of range value for column 'i4' at row 1
Warning 1264 Out of range value for column 'u1' at row 1
Warning 1264 Out of range value for column 'u2' at row 1
Warning 1264 Out of range value for column 'u3' at row 1
Warning 1264 Out of range value for column 'u4' at row 1
Warning 1264 Out of range value for column 'u1' at row 1
Warning 1264 Out of range value for column 'u2' at row 1
Note 1265 Data truncated for column 'd3' at row 1
Note 1265 Data truncated for column 'd3' at row 1
SELECT sp_vars_check_ret1();
sp_vars_check_ret1()
@ -198,24 +165,6 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
v17 v18 v19 v20
12.00 12.12 12.00 12.12
Warnings:
Warning 1264 Out of range value for column 'v1' at row 1
Warning 1264 Out of range value for column 'v1u' at row 1
Warning 1264 Out of range value for column 'v2' at row 1
Warning 1264 Out of range value for column 'v2u' at row 1
Warning 1264 Out of range value for column 'v3' at row 1
Warning 1264 Out of range value for column 'v3u' at row 1
Warning 1264 Out of range value for column 'v4' at row 1
Warning 1264 Out of range value for column 'v4u' at row 1
Warning 1264 Out of range value for column 'v5' at row 1
Warning 1264 Out of range value for column 'v5u' at row 1
Warning 1264 Out of range value for column 'v6' at row 1
Warning 1264 Out of range value for column 'v6u' at row 1
Warning 1366 Incorrect integer value: 'String 10 ' for column 'v10' at row 1
Warning 1366 Incorrect integer value: 'String10' for column 'v11' at row 1
Warning 1265 Data truncated for column 'v12' at row 1
Warning 1265 Data truncated for column 'v13' at row 1
Warning 1366 Incorrect integer value: 'Hello, world' for column 'v16' at row 1
Note 1265 Data truncated for column 'v18' at row 1
Note 1265 Data truncated for column 'v20' at row 1
CALL sp_vars_check_assignment();
i1 i2 i3 i4
@ -231,21 +180,6 @@ d1 d2 d3
d1 d2 d3
1234.00 1234.12 1234.12
Warnings:
Warning 1264 Out of range value for column 'i1' at row 1
Warning 1264 Out of range value for column 'i2' at row 1
Warning 1264 Out of range value for column 'i3' at row 1
Warning 1264 Out of range value for column 'i4' at row 1
Warning 1264 Out of range value for column 'i1' at row 1
Warning 1264 Out of range value for column 'i2' at row 1
Warning 1264 Out of range value for column 'i3' at row 1
Warning 1264 Out of range value for column 'i4' at row 1
Warning 1264 Out of range value for column 'u1' at row 1
Warning 1264 Out of range value for column 'u2' at row 1
Warning 1264 Out of range value for column 'u3' at row 1
Warning 1264 Out of range value for column 'u4' at row 1
Warning 1264 Out of range value for column 'u1' at row 1
Warning 1264 Out of range value for column 'u2' at row 1
Note 1265 Data truncated for column 'd3' at row 1
Note 1265 Data truncated for column 'd3' at row 1
SELECT sp_vars_check_ret1();
sp_vars_check_ret1()
@ -451,10 +385,6 @@ FF
HEX(v10)
FF
Warnings:
Warning 1264 Out of range value for column 'v8' at row 1
Warning 1264 Out of range value for column 'v9' at row 1
Warning 1264 Out of range value for column 'v10' at row 1
Warning 1264 Out of range value for column 'v1' at row 1
Warning 1264 Out of range value for column 'v5' at row 1
DROP PROCEDURE p1;

View file

@ -526,8 +526,6 @@ end|
delete from t1|
create table t3 ( s char(16), d int)|
call into_test4()|
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
select * from t3|
s d
into4 NULL
@ -1120,8 +1118,6 @@ end|
select f9()|
f9()
6
Warnings:
Note 1051 Unknown table 't3'
select f9() from t1 limit 1|
f9()
6
@ -1162,8 +1158,6 @@ drop temporary table t3|
select f12_1()|
f12_1()
3
Warnings:
Note 1051 Unknown table 't3'
select f12_1() from t1 limit 1|
f12_1()
3
@ -2069,12 +2063,7 @@ end if;
insert into t4 values (2, rc, t3);
end|
call bug1863(10)|
Warnings:
Note 1051 Unknown table 'temp_t1'
Warning 1329 No data - zero rows fetched, selected, or processed
call bug1863(10)|
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
select * from t4|
f1 rc t3
2 0 NULL
@ -2339,11 +2328,7 @@ begin
end|
call bug4579_1()|
call bug4579_1()|
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
call bug4579_1()|
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
drop procedure bug4579_1|
drop procedure bug4579_2|
drop table t3|
@ -3736,9 +3721,6 @@ Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
`spv1` decimal(3,3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Warnings:
Warning 1264 Out of range value for column 'spv1' at row 1
Warning 1366 Incorrect decimal value: 'test' for column 'spv1' at row 1
call bug12589_2()|
Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
@ -6106,35 +6088,6 @@ bug5274_f2()
x
Warnings:
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
DROP FUNCTION bug5274_f1|
DROP FUNCTION bug5274_f2|
drop procedure if exists proc_21513|
@ -6229,20 +6182,17 @@ f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
Warning 1329 No data - zero rows fetched, selected, or processed
PREPARE s1 FROM 'SELECT f1(2)';
EXECUTE s1;
f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
Warning 1329 No data - zero rows fetched, selected, or processed
EXECUTE s1;
f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
Warning 1329 No data - zero rows fetched, selected, or processed
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP FUNCTION f1;
@ -6254,6 +6204,7 @@ create procedure mysqltest_db1.sp_bug28551() begin end;
call mysqltest_db1.sp_bug28551();
show warnings;
Level Code Message
Note 1008 Can't drop database 'mysqltest_db1'; database doesn't exist
drop database mysqltest_db1;
drop database if exists mysqltest_db1;
drop table if exists test.t1;

View file

@ -21,9 +21,11 @@ end|
call bug4902_2()|
show warnings|
Level Code Message
Note 1305 PROCEDURE bug4902_2 does not exist
call bug4902_2()|
show warnings|
Level Code Message
Note 1305 PROCEDURE bug4902_2 does not exist
drop procedure bug4902_2|
drop table if exists t1|
create table t1 (

View file

@ -315,8 +315,8 @@ MOD(col1,0)
NULL
NULL
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
INSERT INTO t1 (col1) VALUES(-129);
ERROR 22003: Out of range value for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(128);
@ -343,7 +343,7 @@ SELECT MOD(col1,0) FROM t1 WHERE col1 > 0 LIMIT 1;
MOD(col1,0)
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
UPDATE t1 SET col1 = col1 - 50 WHERE col1 < 0;
ERROR 22003: Out of range value for column 'col1' at row 1
UPDATE t1 SET col2=col2 + 50 WHERE col2 > 0;
@ -353,16 +353,16 @@ ERROR 22012: Division by 0
set @@sql_mode='ERROR_FOR_DIVISION_BY_ZERO';
INSERT INTO t1 values (1/0,1/0);
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
set @@sql_mode='ansi,traditional';
SELECT MOD(col1,0) FROM t1 WHERE col1 > 0 LIMIT 2;
MOD(col1,0)
NULL
NULL
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
INSERT INTO t1 (col1) VALUES ('');
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES ('a59b');
@ -374,8 +374,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
set @@sql_mode='ansi';
INSERT INTO t1 values (1/0,1/0);
set @@sql_mode='ansi,traditional';
@ -457,8 +457,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(-32769,-1),(32768,65536);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@ -541,8 +541,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(-8388609,-1),(8388608,16777216);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@ -625,8 +625,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
INSERT IGNORE INTO t1 values (-2147483649, -1),(2147643648,4294967296);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@ -707,8 +707,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(-9223372036854775809,-1),(9223372036854775808,18446744073709551616);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@ -794,7 +794,7 @@ Warnings:
Note 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0);
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(1000),(-1000);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@ -861,7 +861,7 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 (col1) VALUES (1/0);
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES (+3.4E+39,-3.4E+39);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@ -910,7 +910,7 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 (col1) values (1/0);
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES (+1.9E+309,-1.9E+309);
ERROR 22007: Illegal double '1.9E+309' value found during parsing
INSERT IGNORE INTO t1 VALUES ('+2.0E+309','-2.0E+309');
@ -1080,13 +1080,13 @@ Warnings:
Warning 1292 Truncated incorrect datetime value: '31.10.2004 15.30 abc'
insert into t1 values(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
Warnings:
Error 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
Warning 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
insert into t1 values(STR_TO_DATE('2004.12.12 22:22:33 AM','%Y.%m.%d %r'));
Warnings:
Error 1411 Incorrect time value: '22:22:33 AM' for function str_to_date
Warning 1411 Incorrect time value: '22:22:33 AM' for function str_to_date
insert into t1 values(STR_TO_DATE('2004.12.12 abc','%Y.%m.%d %T'));
Warnings:
Error 1411 Incorrect time value: 'abc' for function str_to_date
Warning 1411 Incorrect time value: 'abc' for function str_to_date
insert into t1 values(STR_TO_DATE('31.10.2004 15.30','%d.%m.%Y %H.%i'));
insert into t1 values(STR_TO_DATE('2004.12.12 11:22:33 AM','%Y.%m.%d %r'));
insert into t1 values(STR_TO_DATE('2004.12.12 10:22:59','%Y.%m.%d %T'));
@ -1104,9 +1104,9 @@ select count(*) from t1 where STR_TO_DATE('2004.12.12 10:22:61','%Y.%m.%d %T') I
count(*)
7
Warnings:
Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
drop table t1;
create table t1 (col1 char(3), col2 integer);
insert into t1 (col1) values (cast(1000 as char(3)));

View file

@ -1073,7 +1073,7 @@ NULL
SET @x=2;
UPDATE t1 SET i1 = @x;
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
SELECT @x;
@x
NULL
@ -1086,8 +1086,8 @@ NULL
SET @x=4;
UPDATE t1 SET i1 = @x;
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
SELECT @x;
@x
NULL
@ -1190,16 +1190,16 @@ create trigger t4_bu before update on t4 for each row set @t4_bu_called:=1|
insert into t1 values(10, 10)|
set @a:=1/0|
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select 1/0 from t1|
1/0
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
create trigger t1_bi before insert on t1 for each row set @a:=1/0|
insert into t1 values(20, 20)|
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
drop trigger t1_bi|
create trigger t1_bi before insert on t1 for each row
begin
@ -1219,7 +1219,7 @@ end|
set @check=0, @t4_bi_called=0, @t4_bu_called=0|
insert into t1 values(30, 30)|
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select @check, @t4_bi_called, @t4_bu_called|
@check @t4_bi_called @t4_bu_called
2 1 1

View file

@ -185,7 +185,7 @@ select 1e10/0e0;
1e10/0e0
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
create table wl1612 (col1 int, col2 decimal(38,10), col3 numeric(38,10));
insert into wl1612 values(1,12345678901234567890.1234567890,12345678901234567890.1234567890);
select * from wl1612;
@ -205,27 +205,27 @@ NULL
NULL
NULL
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
select col2/0 from wl1612;
col2/0
NULL
NULL
NULL
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
select col3/0 from wl1612;
col3/0
NULL
NULL
NULL
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
insert into wl1612 values(5,5000.0005,5000.0005);
insert into wl1612 values(6,5000.0005,5000.0005);
select sum(col2),sum(col3) from wl1612;
@ -788,12 +788,12 @@ select 1 / 1E-500;
1 / 1E-500
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
select 1 / 0;
1 / 0
NULL
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
set sql_mode='ansi,traditional';
CREATE TABLE Sow6_2f (col1 NUMERIC(4,2));
INSERT INTO Sow6_2f VALUES (10.55);
@ -819,11 +819,11 @@ NULL
NULL
NULL
Warnings:
Error 1365 Division by 0
Error 1365 Division by 0
Error 1365 Division by 0
Error 1365 Division by 0
Error 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
Warning 1365 Division by 0
INSERT INTO Sow6_2f VALUES ('a59b');
ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1
drop table Sow6_2f;
@ -838,12 +838,12 @@ select 9999999999999999999999999999999999999999999999999999999999999999999999999
x
99999999999999999999999999999999999999999999999999999999999999999
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x;
x
100000000000000000000000000000000000000000000000000000000000000000
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
select 0.190287977636363637 + 0.040372670 * 0 - 0;
0.190287977636363637 + 0.040372670 * 0 - 0
0.190287977636363637
@ -1380,15 +1380,15 @@ create table t1 (c1 decimal(64));
insert into t1 values(
89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'c1' at row 1
insert into t1 values(
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 *
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'c1' at row 1
insert into t1 values(1e100);
Warnings:
@ -1432,7 +1432,7 @@ select cast(19999999999999999999 as unsigned);
cast(19999999999999999999 as unsigned)
18446744073709551615
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
create table t1(a decimal(18));
insert into t1 values(123456789012345678);
alter table t1 modify column a decimal(19);
@ -1444,12 +1444,12 @@ select cast(11.1234 as DECIMAL(3,2));
cast(11.1234 as DECIMAL(3,2))
9.99
Warnings:
Error 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
Warning 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
select * from (select cast(11.1234 as DECIMAL(3,2))) t;
cast(11.1234 as DECIMAL(3,2))
9.99
Warnings:
Error 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
Warning 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
select cast(a as DECIMAL(3,2))
from (select 11.1233 as a
UNION select 11.1234
@ -1460,9 +1460,9 @@ cast(a as DECIMAL(3,2))
9.99
9.99
Warnings:
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
select cast(a as DECIMAL(3,2)), count(*)
from (select 11.1233 as a
UNION select 11.1234
@ -1471,10 +1471,10 @@ UNION select 12.1234
cast(a as DECIMAL(3,2)) count(*)
9.99 3
Warnings:
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
create table t1 (s varchar(100));
insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
drop table t1;
@ -1560,7 +1560,7 @@ select cast(143.481 as decimal(2,1));
cast(143.481 as decimal(2,1))
9.9
Warnings:
Error 1264 Out of range value for column 'cast(143.481 as decimal(2,1))' at row 1
Warning 1264 Out of range value for column 'cast(143.481 as decimal(2,1))' at row 1
select cast(-3.4 as decimal(2,1));
cast(-3.4 as decimal(2,1))
-3.4
@ -1568,12 +1568,12 @@ select cast(99.6 as decimal(2,0));
cast(99.6 as decimal(2,0))
99
Warnings:
Error 1264 Out of range value for column 'cast(99.6 as decimal(2,0))' at row 1
Warning 1264 Out of range value for column 'cast(99.6 as decimal(2,0))' at row 1
select cast(-13.4 as decimal(2,1));
cast(-13.4 as decimal(2,1))
-9.9
Warnings:
Error 1264 Out of range value for column 'cast(-13.4 as decimal(2,1))' at row 1
Warning 1264 Out of range value for column 'cast(-13.4 as decimal(2,1))' at row 1
select cast(98.6 as decimal(2,0));
cast(98.6 as decimal(2,0))
99
@ -1674,7 +1674,7 @@ CREATE TABLE t1 SELECT
/* 82 */ 1000000000000000000000000000000000000000000000000000000000000000000000000000000001
AS c1;
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DESC t1;
Field Type Null Key Default Extra
c1 decimal(65,0) NO 0
@ -1797,7 +1797,7 @@ CREATE TABLE t1 (a DECIMAL(30,30));
INSERT INTO t1 VALUES (0.1),(0.2),(0.3);
CREATE TABLE t2 SELECT MIN(a + 0.0000000000000000000000000000001) AS c1 FROM t1;
Warnings:
Note 1265 Data truncated for column 'c1' at row 3
Note 1265 Data truncated for column 'c1' at row 4
DESC t2;
Field Type Null Key Default Extra
c1 decimal(32,30) YES NULL

View file

@ -1111,8 +1111,8 @@ insert into v1 values(3);
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (2),(3),(0);
Warnings:
Error 1369 CHECK OPTION failed 'test.v1'
Error 1369 CHECK OPTION failed 'test.v1'
Warning 1369 CHECK OPTION failed 'test.v1'
Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a
1
@ -1125,8 +1125,8 @@ create table t2 (a int);
insert into t2 values (2),(3),(0);
insert ignore into v1 SELECT a from t2;
Warnings:
Error 1369 CHECK OPTION failed 'test.v1'
Error 1369 CHECK OPTION failed 'test.v1'
Warning 1369 CHECK OPTION failed 'test.v1'
Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1 order by a desc;
a
1
@ -1148,7 +1148,7 @@ a
update v1 set a=a+1;
update ignore v1,t2 set v1.a=v1.a+1 where v1.a=t2.a;
Warnings:
Error 1369 CHECK OPTION failed 'test.v1'
Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a
1
@ -1182,7 +1182,7 @@ insert into v1 values (1) on duplicate key update a=2;
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (1) on duplicate key update a=2;
Warnings:
Error 1369 CHECK OPTION failed 'test.v1'
Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a
1
@ -1283,7 +1283,7 @@ insert ignore into v1 values (6);
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (6),(3);
Warnings:
Error 1369 CHECK OPTION failed 'test.v1'
Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
s1
3
@ -1328,9 +1328,9 @@ delete from t1;
load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
Error 1369 CHECK OPTION failed 'test.v1'
Warning 1369 CHECK OPTION failed 'test.v1'
Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 4
Error 1369 CHECK OPTION failed 'test.v1'
Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1 order by a,b;
a b
1 row 1
@ -1354,7 +1354,7 @@ concat('|',a,'|') concat('|',b,'|')
delete from t1;
load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
Warnings:
Error 1369 CHECK OPTION failed 'test.v1'
Warning 1369 CHECK OPTION failed 'test.v1'
Warning 1261 Row 2 doesn't contain data for all columns
select concat('|',a,'|'), concat('|',b,'|') from t1;
concat('|',a,'|') concat('|',b,'|')

View file

@ -34,7 +34,7 @@ purge binary logs TO 'master-bin.000002';
ERROR HY000: Fatal error during log purge
show warnings;
Level Code Message
Error 1377 a problem with deleting master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files
Warning 1377 a problem with deleting master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files
Error 1377 Fatal error during log purge
reset master;
End of tests

View file

@ -43,12 +43,6 @@ END|
CALL proc();
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
---- Insert from stored function ----
CREATE FUNCTION func()
RETURNS INT
@ -67,12 +61,6 @@ func()
0
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
---- Insert from trigger ----
CREATE TRIGGER trig
BEFORE INSERT ON trigger_table
@ -90,12 +78,6 @@ INSERT INTO trigger_table VALUES ('bye.');
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
---- Insert from prepared statement ----
PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)';
PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)';
@ -155,12 +137,6 @@ func5()
0
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
==== Variables that should *not* be unsafe ====
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
@ -215,9 +191,6 @@ END|
CALL p1();
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;

View file

@ -945,8 +945,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÃö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÃö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -960,8 +960,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -2587,9 +2587,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -2603,9 +2603,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -2955,8 +2955,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -2970,8 +2970,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -3282,10 +3282,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3300,10 +3300,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
@ -3372,9 +3372,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3389,9 +3389,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
@ -3408,11 +3408,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
@ -3430,11 +3430,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
@ -3454,9 +3454,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3471,9 +3471,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
@ -3490,11 +3490,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
@ -3510,11 +3510,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;

View file

@ -550,9 +550,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
Warnings:
Note 1051 Unknown table 'tqq'
Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()

View file

@ -946,8 +946,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÃö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÃö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -961,8 +961,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -2588,9 +2588,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -2604,9 +2604,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -2956,8 +2956,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -2971,8 +2971,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -3283,10 +3283,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3301,10 +3301,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
@ -3373,9 +3373,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3390,9 +3390,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
@ -3409,11 +3409,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
@ -3431,11 +3431,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
@ -3455,9 +3455,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3472,9 +3472,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
@ -3491,11 +3491,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
@ -3511,11 +3511,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;

View file

@ -551,9 +551,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
Warnings:
Note 1051 Unknown table 'tqq'
Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()

View file

@ -946,8 +946,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÃö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÃö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -961,8 +961,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -2588,9 +2588,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -2604,9 +2604,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -2956,8 +2956,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -2971,8 +2971,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -3283,10 +3283,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3301,10 +3301,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
@ -3373,9 +3373,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3390,9 +3390,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
@ -3409,11 +3409,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
@ -3431,11 +3431,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
@ -3455,9 +3455,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3472,9 +3472,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
@ -3491,11 +3491,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
@ -3511,11 +3511,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;

View file

@ -551,9 +551,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
Warnings:
Note 1051 Unknown table 'tqq'
Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()

View file

@ -945,8 +945,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÃö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÃö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -960,8 +960,8 @@ AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999
0.000000000000000000000000000000 4
-1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -2587,9 +2587,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -2603,9 +2603,9 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
0 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -2955,8 +2955,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -2970,8 +2970,8 @@ NULL NULL 1
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: ''
DROP VIEW v1;
@ -3282,10 +3282,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3300,10 +3300,10 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 30
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
@ -3372,9 +3372,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3389,9 +3389,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 29
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
@ -3408,11 +3408,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
@ -3430,11 +3430,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 28
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
@ -3454,9 +3454,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
@ -3471,9 +3471,9 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 27
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
@ -3490,11 +3490,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
@ -3510,11 +3510,11 @@ NULL NULL 1
-1.00 -1 5
-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
DROP VIEW v1;

View file

@ -550,9 +550,6 @@ exit handler 2
exit handler 2
exit handler 1
exit handler 1
Warnings:
Note 1051 Unknown table 'tqq'
Note 1051 Unknown table 'tqq'
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE PROCEDURE h1 ()

View file

@ -7128,8 +7128,6 @@ CALL sp1();
x y z
000 000 000
Warnings:
Warning 1264 Out of range value for column 'x' at row 1
Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7168,8 +7166,6 @@ CALL sp1();
x y z
00000 00000 00000
Warnings:
Warning 1264 Out of range value for column 'x' at row 1
Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7208,8 +7204,6 @@ CALL sp1();
x y z
00000000 00000000 00000000
Warnings:
Warning 1264 Out of range value for column 'x' at row 1
Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7248,8 +7242,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
Warning 1264 Out of range value for column 'x' at row 1
Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7288,8 +7280,6 @@ CALL sp1();
x y z
00000000000000000000 00000000000000000000 00000000000000000000
Warnings:
Warning 1264 Out of range value for column 'x' at row 1
Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7310,8 +7300,6 @@ CALL sp1();
x y z
-9999999999 -9999999999 -9999999999
Warnings:
Warning 1264 Out of range value for column 'x' at row 1
Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7323,8 +7311,6 @@ CALL sp1();
x y z
0 0 0
Warnings:
Note 1265 Data truncated for column 'x' at row 1
Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7336,8 +7322,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
Warning 1264 Out of range value for column 'x' at row 1
Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7349,8 +7333,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
Note 1265 Data truncated for column 'x' at row 1
Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7362,8 +7344,6 @@ CALL sp1();
x y z
0 0 0
Warnings:
Note 1265 Data truncated for column 'x' at row 1
Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7375,8 +7355,6 @@ CALL sp1();
x y z
0 0 0
Warnings:
Note 1265 Data truncated for column 'x' at row 1
Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7388,8 +7366,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
Note 1265 Data truncated for column 'x' at row 1
Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -7401,8 +7377,6 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
Note 1265 Data truncated for column 'x' at row 1
Note 1265 Data truncated for column 'y' at row 1
Note 1265 Data truncated for column 'z' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
@ -13782,9 +13756,6 @@ END//
CALL sp1();
x y @x
NULL a 3
Warnings:
Warning 1265 Data truncated for column 'y' at row 3
Warning 1265 Data truncated for column 'y' at row 1
SELECT @v1, @v2;
@v1 @v2
4 a
@ -15465,14 +15436,6 @@ count done
10 1
Warnings:
Warning 1265 Data truncated for column 'name' at row 1
Warning 1265 Data truncated for column 'name' at row 2
Warning 1265 Data truncated for column 'name' at row 3
Warning 1265 Data truncated for column 'name' at row 4
Warning 1265 Data truncated for column 'name' at row 5
Warning 1265 Data truncated for column 'name' at row 6
Warning 1265 Data truncated for column 'name' at row 7
Warning 1265 Data truncated for column 'name' at row 8
Warning 1265 Data truncated for column 'name' at row 9
DROP PROCEDURE sp3;
drop table res_t3_itisalongname_1381742_itsaverylongname_1381742;
@ -16387,7 +16350,6 @@ fn7(99999999999)
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn8;
CREATE FUNCTION fn8( f1 decimal (0) unsigned zerofill) returns decimal (0) unsigned zerofill
@ -16432,7 +16394,6 @@ fn11(99999999999)
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn12;
CREATE FUNCTION fn12( f1 decimal (0, 0) unsigned zerofill) returns decimal (0, 0) unsigned zerofill
@ -16533,7 +16494,6 @@ SELECT fn21_d_z(1.00e+00);
fn21_d_z(1.00e+00)
0000000000000000000000000000000000000000000000000000000000000010
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn22;
CREATE FUNCTION fn22( f1 decimal unsigned) returns decimal unsigned
@ -16545,7 +16505,6 @@ SELECT fn22(1.00e+00);
fn22(1.00e+00)
10
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn23;
CREATE FUNCTION fn23( f1 decimal unsigned zerofill) returns decimal unsigned zerofill
@ -16557,7 +16516,6 @@ SELECT fn23(1.00e+00);
fn23(1.00e+00)
0000000010
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn24;
CREATE FUNCTION fn24( f1 decimal zerofill) returns decimal zerofill
@ -16903,7 +16861,6 @@ fn56(-8388601)
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn57;
CREATE FUNCTION fn57( f1 numeric) returns numeric
BEGIN
@ -16936,7 +16893,6 @@ SELECT fn59(9999999999);
fn59(9999999999)
9999999999
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn60;
CREATE FUNCTION fn60( f1 numeric (0) unsigned zerofill) returns numeric (0) unsigned zerofill
@ -16982,7 +16938,6 @@ SELECT fn63(9999999999);
fn63(9999999999)
9999999999
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn64;
CREATE FUNCTION fn64( f1 numeric (0, 0) unsigned zerofill) returns numeric (0, 0) unsigned zerofill
@ -17018,8 +16973,6 @@ fn66(-1e+36)
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn67;
CREATE FUNCTION fn67( f1 numeric (63, 30) unsigned) returns numeric (63, 30) unsigned
@ -17032,7 +16985,6 @@ fn67(1e+36)
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn68;
CREATE FUNCTION fn68( f1 numeric (63, 30) unsigned zerofill) returns numeric (63, 30) unsigned zerofill
@ -17045,7 +16997,6 @@ fn68(1e+36)
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn69;
CREATE FUNCTION fn69( f1 numeric (63, 30) zerofill) returns numeric (63, 30) zerofill
@ -17213,7 +17164,6 @@ fn84(-32601)
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn85;
CREATE FUNCTION fn85( f1 tinyint) returns tinyint
BEGIN
@ -17253,7 +17203,6 @@ fn88(-101)
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP FUNCTION IF EXISTS fn89;
CREATE FUNCTION fn89( f1 enum('1enum', '2enum')) returns enum('1enum', '2enum')
BEGIN
@ -17511,7 +17460,6 @@ f1
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp8;
CREATE PROCEDURE sp8( f1 decimal (0) unsigned zerofill)
@ -17556,7 +17504,6 @@ f1
9999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp12;
CREATE PROCEDURE sp12( f1 decimal (0, 0) unsigned zerofill)
@ -17678,7 +17625,6 @@ CALL sp21(1.00e+00);
f1
0000000000000000000000000000000000000000000000000000000000000010
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp22;
CREATE PROCEDURE sp22( f1 decimal unsigned)
@ -17690,7 +17636,6 @@ CALL sp22(1.00e+00);
f1
10
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp23;
CREATE PROCEDURE sp23( f1 decimal unsigned zerofill)
@ -17702,7 +17647,6 @@ CALL sp23(1.00e+00);
f1
0000000010
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp24;
CREATE PROCEDURE sp24( f1 decimal zerofill)
@ -18048,7 +17992,6 @@ f1
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp57;
CREATE PROCEDURE sp57( f1 numeric)
BEGIN
@ -18081,7 +18024,6 @@ CALL sp59(9999999999);
f1
9999999999
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp60;
CREATE PROCEDURE sp60( f1 numeric (0) unsigned zerofill)
@ -18127,7 +18069,6 @@ CALL sp63(9999999999);
f1
9999999999
Warnings:
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp64;
CREATE PROCEDURE sp64( f1 numeric (0, 0) unsigned zerofill)
@ -18163,16 +18104,12 @@ f1
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
CALL sp66_n( -1000000000000000000000000000000000000 );
f1
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp67_nu;
CREATE PROCEDURE sp67_nu( f1 numeric (63, 30) unsigned)
@ -18185,14 +18122,12 @@ f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
CALL sp67_nu( 1000000000000000000000000000000000000 );
f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp68_nuz;
CREATE PROCEDURE sp68_nuz( f1 numeric (63, 30) unsigned zerofill)
@ -18205,14 +18140,12 @@ f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
CALL sp68_nuz( 1000000000000000000000000000000000000 );
f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Note 1265 Data truncated for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp69_n_z;
CREATE PROCEDURE sp69_n_z( f1 numeric (63, 30) zerofill)
@ -18395,7 +18328,6 @@ f1
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp85;
CREATE PROCEDURE sp85( f1 tinyint)
BEGIN
@ -18435,7 +18367,6 @@ f1
Warnings:
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 1
DROP PROCEDURE IF EXISTS sp89;
CREATE PROCEDURE sp89( f1 enum('1enum', '2enum'))
BEGIN
@ -22263,9 +22194,9 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
set @@sql_mode='';
CALL sp4();
Level Code Message
Error 1365 Division by 0
Warning 1365 Division by 0
Warnings:
Error 1365 Division by 0
Warning 1365 Division by 0
DROP PROCEDURE sp4;
set @@sql_mode='';

View file

@ -198,13 +198,11 @@ create table t1 (id int primary key) engine = innodb key_block_size = 0;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 0. Valid values are [1, 2, 4, 8, 16]
Error 1005 Can't create table 'test.t1' (errno: 1478)
create table t2 (id int primary key) engine = innodb key_block_size = 9;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1005 Can't create table 'test.t2' (errno: 1478)
create table t3 (id int primary key) engine = innodb key_block_size = 1;
create table t4 (id int primary key) engine = innodb key_block_size = 2;
@ -235,28 +233,24 @@ key_block_size = 8 row_format = redundant;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t2' (errno: 1478)
create table t3 (id int primary key) engine = innodb
key_block_size = 8 row_format = compact;
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t3' (errno: 1478)
create table t4 (id int primary key) engine = innodb
key_block_size = 8 row_format = dynamic;
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t5' (errno: 1478)
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
@ -268,24 +262,18 @@ key_block_size = 9 row_format = redundant;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t1' (errno: 1478)
create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = compact;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t2' (errno: 1478)
create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = dynamic;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Error 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t2' (errno: 1478)
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
@ -295,43 +283,36 @@ create table t1 (id int primary key) engine = innodb key_block_size = 1;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table 'test.t1' (errno: 1478)
create table t2 (id int primary key) engine = innodb key_block_size = 2;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table 'test.t2' (errno: 1478)
create table t3 (id int primary key) engine = innodb key_block_size = 4;
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table 'test.t3' (errno: 1478)
create table t4 (id int primary key) engine = innodb key_block_size = 8;
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb key_block_size = 16;
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table 'test.t5' (errno: 1478)
create table t6 (id int primary key) engine = innodb row_format = compressed;
ERROR HY000: Can't create table 'test.t6' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
Error 1005 Can't create table 'test.t6' (errno: 1478)
create table t7 (id int primary key) engine = innodb row_format = dynamic;
ERROR HY000: Can't create table 'test.t7' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
@ -347,43 +328,36 @@ create table t1 (id int primary key) engine = innodb key_block_size = 1;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t1' (errno: 1478)
create table t2 (id int primary key) engine = innodb key_block_size = 2;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t2' (errno: 1478)
create table t3 (id int primary key) engine = innodb key_block_size = 4;
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t3' (errno: 1478)
create table t4 (id int primary key) engine = innodb key_block_size = 8;
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb key_block_size = 16;
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t5' (errno: 1478)
create table t6 (id int primary key) engine = innodb row_format = compressed;
ERROR HY000: Can't create table 'test.t6' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t6' (errno: 1478)
create table t7 (id int primary key) engine = innodb row_format = dynamic;
ERROR HY000: Can't create table 'test.t7' (errno: 1478)
show errors;
Level Code Message
Error 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;

View file

@ -204,7 +204,7 @@ b int
ERROR HY000: Can't create table 'test.t1' (errno: 906)
show warnings;
Level Code Message
Error 1296 Got error 906 'Unsupported attribute type in index' from NDB
Warning 1296 Got error 906 'Unsupported attribute type in index' from NDB
Error 1005 Can't create table 'test.t1' (errno: 906)
create table t1 (
pk1 int not null primary key,
@ -214,7 +214,7 @@ key(b)
ERROR HY000: Can't create table 'test.t1' (errno: 906)
show warnings;
Level Code Message
Error 1296 Got error 906 'Unsupported attribute type in index' from NDB
Warning 1296 Got error 906 'Unsupported attribute type in index' from NDB
Error 1005 Can't create table 'test.t1' (errno: 906)
create table t1 (
pk1 int primary key,

View file

@ -8,20 +8,20 @@ INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=MYISAM;
Warnings:
Error 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=XYZ;
Warnings:
Warning 1286 Unknown table engine 'XYZ'
Error 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M;
Warnings:
Error 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
set storage_engine=ndb;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'

View file

@ -15,7 +15,7 @@ ENGINE NDB;
ERROR HY000: Failed to create LOGFILE GROUP
SHOW WARNINGS;
Level Code Message
Error 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB
Warning 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB
Error 1528 Failed to create LOGFILE GROUP
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'

View file

@ -463,7 +463,7 @@ drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
Warnings:
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
@ -1013,7 +1013,7 @@ drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
Warnings:
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));

View file

@ -63,6 +63,6 @@ t4
drop table t1, t2, t3, t4;
drop table if exists t1, t3, t4;
Warnings:
Error 155 Table 'test.t1' doesn't exist
Error 155 Table 'test.t3' doesn't exist
Error 155 Table 'test.t4' doesn't exist
Warning 155 Table 'test.t1' doesn't exist
Warning 155 Table 'test.t3' doesn't exist
Warning 155 Table 'test.t4' doesn't exist

View file

@ -14,7 +14,7 @@ partition x3 values less than (20) nodegroup 14);
ERROR HY000: Can't create table 'test.t1' (errno: 140)
show warnings;
Level Code Message
Error 1296 Got error 771 'Given NODEGROUP doesn't exist in this cluster' from NDB
Warning 1296 Got error 771 'Given NODEGROUP doesn't exist in this cluster' from NDB
Error 1005 Can't create table 'test.t1' (errno: 140)
CREATE TABLE t1 (
a int not null,

View file

@ -8,7 +8,7 @@ ENGINE=NDB;
ERROR HY000: Can't create table 'test.t1' (errno: 138)
SHOW WARNINGS;
Level Code Message
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute'
Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute'
Error 1005 Can't create table 'test.t1' (errno: 138)
CREATE TABLE t1
( a INT KEY,

View file

@ -9,7 +9,7 @@ ENGINE=NDB;
ERROR HY000: Failed to create LOGFILE GROUP
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1528 Failed to create LOGFILE GROUP
create table t1 (a int key, b int unique, c int) engine ndb;
CREATE LOGFILE GROUP lg1
@ -25,14 +25,14 @@ ENGINE NDB;
ERROR HY000: Failed to create TABLESPACE
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1528 Failed to create TABLESPACE
DROP LOGFILE GROUP lg1
ENGINE =NDB;
ERROR HY000: Failed to drop LOGFILE GROUP
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1529 Failed to drop LOGFILE GROUP
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
@ -45,7 +45,7 @@ ENGINE NDB;
ERROR HY000: Failed to alter: DROP DATAFILE
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1533 Failed to alter: DROP DATAFILE
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
@ -55,7 +55,7 @@ ENGINE NDB;
ERROR HY000: Failed to drop TABLESPACE
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1529 Failed to drop TABLESPACE
DROP TABLESPACE ts1
ENGINE NDB;

View file

@ -8,4 +8,4 @@ create table t1 (a int) engine=myisam;
flush tables;
drop table if exists t1;
Warnings:
Error 2 Can't find file: 't1' (errno: 2)
Warning 2 Can't find file: 't1' (errno: 2)

View file

@ -22,8 +22,6 @@ END|
< ---- Master selects-- >
-------------------------
CALL test.p1(12);
Warnings:
Note 1051 Unknown table 't1'
SELECT * FROM test.t1;
num
12

View file

@ -694,3 +694,35 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN
DROP TABLE t1, t2;
--echo End of 5.0 tests
#
# Bug#36785: Wrong error message when group_concat() exceeds max length
#
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
CREATE TABLE t1 (a VARCHAR(6), b INT);
CREATE TABLE t2 (a VARCHAR(6), b INT);
INSERT INTO t1 VALUES ('111111', 1);
INSERT INTO t1 VALUES ('222222', 2);
INSERT INTO t1 VALUES ('333333', 3);
INSERT INTO t1 VALUES ('444444', 4);
INSERT INTO t1 VALUES ('555555', 5);
SET group_concat_max_len = 5;
SET @old_sql_mode = @@sql_mode, @@sql_mode = 'traditional';
SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b LIMIT 3;
--error ER_CUT_VALUE_GROUP_CONCAT
INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
UPDATE t1 SET a = '11111' WHERE b = 1;
UPDATE t1 SET a = '22222' WHERE b = 2;
--error ER_CUT_VALUE_GROUP_CONCAT
INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
SET group_concat_max_len = DEFAULT;
SET @@sql_mode = @old_sql_mode;
DROP TABLE t1, t2;

2685
mysql-test/t/signal.test Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,57 @@
# Copyright (C) 2008 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for SIGNAL and RESIGNAL
-- source include/have_debug.inc
use test;
--disable_warnings
drop procedure if exists signal_proc;
drop function if exists signal_func;
--enable_warnings
delimiter $$;
create procedure signal_proc()
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
SIGNAL foo;
SIGNAL foo SET MESSAGE_TEXT = "This is an error message";
RESIGNAL foo;
RESIGNAL foo SET MESSAGE_TEXT = "This is an error message";
end $$
create function signal_func() returns int
begin
DECLARE foo CONDITION FOR SQLSTATE '12345';
SIGNAL foo;
SIGNAL foo SET MESSAGE_TEXT = "This is an error message";
RESIGNAL foo;
RESIGNAL foo SET MESSAGE_TEXT = "This is an error message";
return 0;
end $$
delimiter ;$$
show procedure code signal_proc;
drop procedure signal_proc;
show function code signal_func;
drop function signal_func;

View file

@ -0,0 +1,345 @@
# Copyright (C) 2008 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Demonstrate how SIGNAL can be used to enforce integrity constraints.
#
# Naming:
# - PO: Purchase Order
# - AB: Address Book
# - IN: Inventory
# Simplified schema:
#
# Relation 1:
# PO_ORDER (PK: po_id) 1:1 <---> 0:N (FK: po_id) PO_ORDER_LINE
#
# Relation 2:
# IN_INVENTORY (PK: item_id) 1:1 <---> 0:N (FK: item_id) PO_ORDER_LINE
#
# Relation 3:
# +--> 0:1 (PK: person_id) AB_PHYSICAL_PERSON
# PO_ORDER (FK: cust_id) 1:1 <--|
# +--> 0:1 (PK: company_id) AB_MORAL_PERSON
# This is an 'arc' relationship :)
#
--disable_warnings
drop database if exists demo;
--enable_warnings
create database demo;
use demo;
create table ab_physical_person (
person_id integer,
first_name VARCHAR(50),
middle_initial CHAR,
last_name VARCHAR(50),
primary key (person_id));
create table ab_moral_person (
company_id integer,
name VARCHAR(100),
primary key (company_id));
create table in_inventory (
item_id integer,
descr VARCHAR(50),
stock integer,
primary key (item_id));
create table po_order (
po_id integer auto_increment,
cust_type char, /* arc relationship, see cust_id */
cust_id integer, /* FK to ab_physical_person *OR* ab_moral_person */
primary key (po_id));
create table po_order_line (
po_id integer, /* FK to po_order.po_id */
line_no integer,
item_id integer, /* FK to in_inventory.item_id */
qty integer);
delimiter $$;
--echo #
--echo # Schema integrity enforcement
--echo #
create procedure check_pk_person(in person_type char, in id integer)
begin
declare x integer;
declare msg varchar(128);
/*
Test integrity constraints for an 'arc' relationship.
Based on 'person_type', 'id' points to either a
physical person, or a moral person.
*/
case person_type
when 'P' then
begin
select count(person_id) from ab_physical_person
where ab_physical_person.person_id = id
into x;
if (x != 1)
then
set msg= concat('No such physical person, PK:', id);
SIGNAL SQLSTATE '45000' SET
MESSAGE_TEXT = msg,
MYSQL_ERRNO = 10000;
end if;
end;
when 'M' then
begin
select count(company_id) from ab_moral_person
where ab_moral_person.company_id = id
into x;
if (x != 1)
then
set msg= concat('No such moral person, PK:', id);
SIGNAL SQLSTATE '45000' SET
MESSAGE_TEXT = msg,
MYSQL_ERRNO = 10000;
end if;
end;
else
begin
set msg= concat('No such person type:', person_type);
SIGNAL SQLSTATE '45000' SET
MESSAGE_TEXT = msg,
MYSQL_ERRNO = 20000;
end;
end case;
end
$$
create procedure check_pk_inventory(in id integer)
begin
declare x integer;
declare msg varchar(128);
select count(item_id) from in_inventory
where in_inventory.item_id = id
into x;
if (x != 1)
then
set msg= concat('Failed integrity constraint, table in_inventory, PK:',
id);
SIGNAL SQLSTATE '45000' SET
MESSAGE_TEXT = msg,
MYSQL_ERRNO = 10000;
end if;
end
$$
create procedure check_pk_order(in id integer)
begin
declare x integer;
declare msg varchar(128);
select count(po_id) from po_order
where po_order.po_id = id
into x;
if (x != 1)
then
set msg= concat('Failed integrity constraint, table po_order, PK:', id);
SIGNAL SQLSTATE '45000' SET
MESSAGE_TEXT = msg,
MYSQL_ERRNO = 10000;
end if;
end
$$
create trigger po_order_bi before insert on po_order
for each row
begin
call check_pk_person(NEW.cust_type, NEW.cust_id);
end
$$
create trigger po_order_bu before update on po_order
for each row
begin
call check_pk_person(NEW.cust_type, NEW.cust_id);
end
$$
create trigger po_order_line_bi before insert on po_order_line
for each row
begin
call check_pk_order(NEW.po_id);
call check_pk_inventory(NEW.item_id);
end
$$
create trigger po_order_line_bu before update on po_order_line
for each row
begin
call check_pk_order(NEW.po_id);
call check_pk_inventory(NEW.item_id);
end
$$
--echo #
--echo # Application helpers
--echo #
create procedure po_create_order(
in p_cust_type char,
in p_cust_id integer,
out id integer)
begin
insert into po_order set cust_type = p_cust_type, cust_id = p_cust_id;
set id = last_insert_id();
end
$$
create procedure po_add_order_line(
in po integer,
in line integer,
in item integer,
in q integer)
begin
insert into po_order_line set
po_id = po, line_no = line, item_id = item, qty = q;
end
$$
delimiter ;$$
--echo #
--echo # Create sample data
--echo #
insert into ab_physical_person values
( 1, "John", "A", "Doe"),
( 2, "Marry", "B", "Smith")
;
insert into ab_moral_person values
( 3, "ACME real estate, INC"),
( 4, "Local school")
;
insert into in_inventory values
( 100, "Table, dinner", 5),
( 101, "Chair", 20),
( 200, "Table, coffee", 3),
( 300, "School table", 25),
( 301, "School chairs", 50)
;
select * from ab_physical_person order by person_id;
select * from ab_moral_person order by company_id;
select * from in_inventory order by item_id;
--echo #
--echo # Entering an order
--echo #
set @my_po = 0;
/* John Doe wants 1 table and 4 chairs */
call po_create_order("P", 1, @my_po);
call po_add_order_line (@my_po, 1, 100, 1);
call po_add_order_line (@my_po, 2, 101, 4);
/* Marry Smith wants a coffee table */
call po_create_order("P", 2, @my_po);
call po_add_order_line (@my_po, 1, 200, 1);
--echo #
--echo # Entering bad data in an order
--echo #
# There is no item 999 in in_inventory
--error 10000
call po_add_order_line (@my_po, 1, 999, 1);
--echo #
--echo # Entering bad data in an unknown order
--echo #
# There is no order 99 in po_order
--error 10000
call po_add_order_line (99, 1, 100, 1);
--echo #
--echo # Entering an order for an unknown company
--echo #
# There is no moral person of id 7
--error 10000
call po_create_order("M", 7, @my_po);
--echo #
--echo # Entering an order for an unknown person type
--echo #
# There is no person of type X
--error 20000
call po_create_order("X", 1, @my_po);
/* The local school wants 10 class tables and 20 chairs */
call po_create_order("M", 4, @my_po);
call po_add_order_line (@my_po, 1, 300, 10);
call po_add_order_line (@my_po, 2, 301, 20);
# Raw data
select * from po_order;
select * from po_order_line;
# Creative reporting ...
select po_id as "PO#",
( case cust_type
when "P" then concat (pp.first_name,
" ",
pp.middle_initial,
" ",
pp.last_name)
when "M" then mp.name
end ) as "Sold to"
from po_order po
left join ab_physical_person pp on po.cust_id = pp.person_id
left join ab_moral_person mp on po.cust_id = company_id
;
select po_id as "PO#",
ol.line_no as "Line",
ol.item_id as "Item",
inv.descr as "Description",
ol.qty as "Quantity"
from po_order_line ol, in_inventory inv
where inv.item_id = ol.item_id
order by ol.item_id, ol.line_no;
drop database demo;

View file

@ -0,0 +1,207 @@
# Copyright (C) 2008 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Demonstrate how RESIGNAL can be used to 'catch' and 're-throw' an error
#
--disable_warnings
drop database if exists demo;
--enable_warnings
create database demo;
use demo;
delimiter $$;
create procedure proc_top_a(p1 integer)
begin
## DECLARE CONTINUE HANDLER for SQLEXCEPTION, NOT FOUND
begin
end;
select "Starting ...";
call proc_middle_a(p1);
select "The end";
end
$$
create procedure proc_middle_a(p1 integer)
begin
DECLARE l integer;
# without RESIGNAL:
# Should be: DECLARE EXIT HANDLER for SQLEXCEPTION, NOT FOUND
DECLARE EXIT HANDLER for 1 /* not sure how to handle exceptions */
begin
select "Oops ... now what ?";
end;
select "In prod_middle()";
create temporary table t1(a integer, b integer);
select GET_LOCK("user_mutex", 10) into l;
insert into t1 set a = p1, b = p1;
call proc_bottom_a(p1);
select RELEASE_LOCK("user_mutex") into l;
drop temporary table t1;
end
$$
create procedure proc_bottom_a(p1 integer)
begin
select "In proc_bottom()";
if (p1 = 1) then
begin
select "Doing something that works ...";
select * from t1;
end;
end if;
if (p1 = 2) then
begin
select "Doing something that fail (simulate an error) ...";
drop table no_such_table;
end;
end if;
if (p1 = 3) then
begin
select "Doing something that *SHOULD* works ...";
select * from t1;
end;
end if;
end
$$
delimiter ;$$
#
# Code without RESIGNAL:
# errors are apparent to the caller,
# but there is no cleanup code,
# so that the environment (get_lock(), temporary table) is polluted ...
#
call proc_top_a(1);
# Expected
--error ER_BAD_TABLE_ERROR
call proc_top_a(2);
# Dirty state
--error ER_TABLE_EXISTS_ERROR
call proc_top_a(3);
# Dirty state
--error ER_TABLE_EXISTS_ERROR
call proc_top_a(1);
drop temporary table if exists t1;
delimiter $$;
create procedure proc_top_b(p1 integer)
begin
select "Starting ...";
call proc_middle_b(p1);
select "The end";
end
$$
create procedure proc_middle_b(p1 integer)
begin
DECLARE l integer;
DECLARE EXIT HANDLER for SQLEXCEPTION, NOT FOUND
begin
begin
DECLARE CONTINUE HANDLER for SQLEXCEPTION, NOT FOUND
begin
/* Ignore errors from the cleanup code */
end;
select "Doing cleanup !";
select RELEASE_LOCK("user_mutex") into l;
drop temporary table t1;
end;
RESIGNAL;
end;
select "In prod_middle()";
create temporary table t1(a integer, b integer);
select GET_LOCK("user_mutex", 10) into l;
insert into t1 set a = p1, b = p1;
call proc_bottom_b(p1);
select RELEASE_LOCK("user_mutex") into l;
drop temporary table t1;
end
$$
create procedure proc_bottom_b(p1 integer)
begin
select "In proc_bottom()";
if (p1 = 1) then
begin
select "Doing something that works ...";
select * from t1;
end;
end if;
if (p1 = 2) then
begin
select "Doing something that fail (simulate an error) ...";
drop table no_such_table;
end;
end if;
if (p1 = 3) then
begin
select "Doing something that *SHOULD* works ...";
select * from t1;
end;
end if;
end
$$
delimiter ;$$
#
# Code with RESIGNAL:
# errors are apparent to the caller,
# the but cleanup code did get a chance to act ...
#
call proc_top_b(1);
--error ER_BAD_TABLE_ERROR
call proc_top_b(2);
call proc_top_b(3);
call proc_top_b(1);
drop database demo;

View file

@ -0,0 +1,159 @@
# Copyright (C) 2008 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Demonstrate how RESIGNAL can be used to print a stack trace
#
# Save defaults
SET @start_global_value = @@global.max_error_count;
SELECT @start_global_value;
SET @start_session_value = @@session.max_error_count;
SELECT @start_session_value;
--disable_warnings
drop database if exists demo;
--enable_warnings
create database demo;
use demo;
delimiter $$;
create procedure proc_1()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_1';
call proc_2();
end
$$
create procedure proc_2()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_2';
call proc_3();
end
$$
create procedure proc_3()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_3';
call proc_4();
end
$$
create procedure proc_4()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_4';
call proc_5();
end
$$
create procedure proc_5()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_5';
call proc_6();
end
$$
create procedure proc_6()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_6';
call proc_7();
end
$$
create procedure proc_7()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_7';
call proc_8();
end
$$
create procedure proc_8()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_8';
call proc_9();
end
$$
create procedure proc_9()
begin
declare exit handler for sqlexception
resignal sqlstate '45000' set message_text='Oops in proc_9';
## Do something that fails, to see how errors are reported
drop table oops_it_is_not_here;
end
$$
delimiter ;$$
-- error ER_SIGNAL_EXCEPTION
call proc_1();
# This is the interesting part:
# the complete call stack from the origin of failure (proc_9)
# to the top level caller (proc_1) is available ...
show warnings;
SET @@session.max_error_count = 5;
SELECT @@session.max_error_count;
-- error ER_SIGNAL_EXCEPTION
call proc_1();
show warnings;
SET @@session.max_error_count = 7;
SELECT @@session.max_error_count;
-- error ER_SIGNAL_EXCEPTION
call proc_1();
show warnings;
SET @@session.max_error_count = 9;
SELECT @@session.max_error_count;
-- error ER_SIGNAL_EXCEPTION
call proc_1();
show warnings;
drop database demo;
# Restore defaults
SET @@global.max_error_count = @start_global_value;
SELECT @@global.max_error_count;
SET @@session.max_error_count = @start_session_value;
SELECT @@session.max_error_count;

View file

@ -0,0 +1,123 @@
# Copyright (C) 2008 Sun Microsystems, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Tests for SIGNAL, RESIGNAL and GET DIAGNOSTICS
SET @save_sql_mode=@@sql_mode;
SET sql_mode='';
--disable_warnings
drop procedure if exists p;
drop procedure if exists p2;
drop procedure if exists p3;
--enable_warnings
delimiter $$;
create procedure p()
begin
declare utf8_var VARCHAR(128) CHARACTER SET UTF8;
set utf8_var = concat(repeat('A', 128), 'X');
select length(utf8_var), utf8_var;
end
$$
create procedure p2()
begin
declare msg VARCHAR(129) CHARACTER SET UTF8;
set msg = concat(repeat('A', 128), 'X');
select length(msg), msg;
signal sqlstate '55555' set message_text = msg;
end
$$
create procedure p3()
begin
declare name VARCHAR(65) CHARACTER SET UTF8;
set name = concat(repeat('A', 64), 'X');
select length(name), name;
signal sqlstate '55555' set
message_text = 'Message',
table_name = name;
end
$$
delimiter ;$$
call p;
--error ER_SIGNAL_EXCEPTION
call p2;
--error ER_SIGNAL_EXCEPTION
call p3;
drop procedure p;
drop procedure p2;
drop procedure p3;
SET sql_mode='STRICT_ALL_TABLES';
delimiter $$;
create procedure p()
begin
declare utf8_var VARCHAR(128) CHARACTER SET UTF8;
set utf8_var = concat(repeat('A', 128), 'X');
select length(utf8_var), utf8_var;
end
$$
create procedure p2()
begin
declare msg VARCHAR(129) CHARACTER SET UTF8;
set msg = concat(repeat('A', 128), 'X');
select length(msg), msg;
signal sqlstate '55555' set message_text = msg;
end
$$
create procedure p3()
begin
declare name VARCHAR(65) CHARACTER SET UTF8;
set name = concat(repeat('A', 64), 'X');
select length(name), name;
signal sqlstate '55555' set
message_text = 'Message',
table_name = name;
end
$$
delimiter ;$$
--error ER_DATA_TOO_LONG
call p;
--error ER_COND_ITEM_TOO_LONG
call p2;
--error ER_COND_ITEM_TOO_LONG
call p3;
drop procedure p;
drop procedure p2;
drop procedure p3;
SET @@sql_mode=@save_sql_mode;

View file

@ -22,7 +22,6 @@
/* Max length of a error message. Should be kept in sync with MYSQL_ERRMSG_SIZE. */
#define ERRMSGSIZE (512)
/* Define some external variables for error handling */
/*
@ -67,12 +66,9 @@ static struct my_err_head *my_errmsgs_list= &my_errmsgs_globerrs;
MyFlags Flags
... variable list
RETURN
What (*error_handler_hook)() returns:
0 OK
*/
int my_error(int nr, myf MyFlags, ...)
void my_error(int nr, myf MyFlags, ...)
{
const char *format;
struct my_err_head *meh_p;
@ -96,7 +92,8 @@ int my_error(int nr, myf MyFlags, ...)
(void) my_vsnprintf (ebuff, sizeof(ebuff), format, args);
va_end(args);
}
DBUG_RETURN((*error_handler_hook)(nr, ebuff, MyFlags));
(*error_handler_hook)(nr, ebuff, MyFlags);
DBUG_VOID_RETURN;
}
@ -111,7 +108,7 @@ int my_error(int nr, myf MyFlags, ...)
... variable list
*/
int my_printf_error(uint error, const char *format, myf MyFlags, ...)
void my_printf_error(uint error, const char *format, myf MyFlags, ...)
{
va_list args;
char ebuff[ERRMSGSIZE];
@ -122,7 +119,8 @@ int my_printf_error(uint error, const char *format, myf MyFlags, ...)
va_start(args,MyFlags);
(void) my_vsnprintf (ebuff, sizeof(ebuff), format, args);
va_end(args);
DBUG_RETURN((*error_handler_hook)(error, ebuff, MyFlags));
(*error_handler_hook)(error, ebuff, MyFlags);
DBUG_VOID_RETURN;
}
/*
@ -135,9 +133,9 @@ int my_printf_error(uint error, const char *format, myf MyFlags, ...)
MyFlags Flags
*/
int my_message(uint error, const char *str, register myf MyFlags)
void my_message(uint error, const char *str, register myf MyFlags)
{
return (*error_handler_hook)(error, str, MyFlags);
(*error_handler_hook)(error, str, MyFlags);
}

View file

@ -15,8 +15,8 @@
#include "mysys_priv.h"
int my_message_no_curses(uint error __attribute__((unused)),
const char *str, myf MyFlags)
void my_message_no_curses(uint error __attribute__((unused)),
const char *str, myf MyFlags)
{
DBUG_ENTER("my_message_no_curses");
DBUG_PRINT("enter",("message: %s",str));
@ -34,5 +34,5 @@ int my_message_no_curses(uint error __attribute__((unused)),
(void)fputs(str,stderr);
(void)fputc('\n',stderr);
(void)fflush(stderr);
DBUG_RETURN(0);
DBUG_VOID_RETURN;
}

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -87,9 +87,9 @@ ulong my_time_to_wait_for_lock=2; /* In seconds */
char * NEAR globerrs[GLOBERRS]; /* my_error_messages is here */
#endif
void (*my_abort_hook)(int) = (void(*)(int)) exit;
int (*error_handler_hook)(uint error,const char *str,myf MyFlags)=
void (*error_handler_hook)(uint error,const char *str,myf MyFlags)=
my_message_no_curses;
int (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)=
void (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)=
my_message_no_curses;
#ifdef __WIN__

View file

@ -75,6 +75,7 @@ SET (SQL_SOURCE
rpl_rli.cc rpl_mi.cc sql_servers.cc
sql_connect.cc scheduler.cc
sql_profile.cc event_parse_data.cc
sql_signal.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h

View file

@ -110,7 +110,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
sql_plugin.h authors.h event_parse_data.h \
event_data_objects.h event_scheduler.h \
sql_partition.h partition_info.h partition_element.h \
contributors.h sql_servers.h
contributors.h sql_servers.h sql_signal.h
mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
item.cc item_sum.cc item_buff.cc item_func.cc \
@ -154,7 +154,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
event_queue.cc event_db_repository.cc events.cc \
sql_plugin.cc sql_binlog.cc \
sql_builtin.cc sql_tablespace.cc partition_info.cc \
sql_servers.cc event_parse_data.cc
sql_servers.cc event_parse_data.cc sql_signal.cc
nodist_mysqld_SOURCES = mini_client_errors.c pack.c client.c my_time.c my_user.c

View file

@ -36,6 +36,7 @@ struct show_table_authors_st {
struct show_table_authors_st show_table_authors[]= {
{ "Brian (Krow) Aker", "Seattle, WA, USA",
"Architecture, archive, federated, bunch of little stuff :)" },
{ "Marc Alff", "Denver, CO, USA", "Signal, Resignal" },
{ "Venu Anuganti", "", "Client/server protocol (4.1)" },
{ "David Axmark", "Uppsala, Sweden",
"Small stuff long time ago, Monty ripped it out!" },

View file

@ -74,7 +74,7 @@ Event_worker_thread::print_warnings(THD *thd, Event_job_data *et)
{
MYSQL_ERROR *err;
DBUG_ENTER("evex_print_warnings");
if (!thd->warn_list.elements)
if (thd->warning_info->is_empty())
DBUG_VOID_RETURN;
char msg_buf[10 * STRING_BUFFER_USUAL_SIZE];
@ -90,17 +90,18 @@ Event_worker_thread::print_warnings(THD *thd, Event_job_data *et)
prefix.append(et->name.str, et->name.length, system_charset_info);
prefix.append("] ", 2);
List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
while ((err= it++))
{
String err_msg(msg_buf, sizeof(msg_buf), system_charset_info);
/* set it to 0 or we start adding at the end. That's the trick ;) */
err_msg.length(0);
err_msg.append(prefix);
err_msg.append(err->msg, strlen(err->msg), system_charset_info);
DBUG_ASSERT(err->level < 3);
(sql_print_message_handlers[err->level])("%*s", err_msg.length(),
err_msg.c_ptr());
err_msg.append(err->get_message_text(),
err->get_message_octet_length(), system_charset_info);
DBUG_ASSERT(err->get_level() < 3);
(sql_print_message_handlers[err->get_level()])("%*s", err_msg.length(),
err_msg.c_ptr());
}
DBUG_VOID_RETURN;
}

View file

@ -1116,7 +1116,7 @@ int Field_num::check_int(CHARSET_INFO *cs, const char *str, int length,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
"integer", tmp.c_ptr(), field_name,
(ulong) table->in_use->row_count);
(ulong) table->in_use->warning_info->current_row_for_warning());
return 1;
}
/* Test if we have garbage at the end of the given string. */
@ -2678,11 +2678,11 @@ int Field_new_decimal::store(const char *from, uint length,
String from_as_str;
from_as_str.copy(from, length, &my_charset_bin);
push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
"decimal", from_as_str.c_ptr(), field_name,
(ulong) table->in_use->row_count);
(ulong) table->in_use->warning_info->current_row_for_warning());
DBUG_RETURN(err);
}
@ -2705,7 +2705,7 @@ int Field_new_decimal::store(const char *from, uint length,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
"decimal", from_as_str.c_ptr(), field_name,
(ulong) table->in_use->row_count);
(ulong) table->in_use->warning_info->current_row_for_warning());
my_decimal_set_zero(&decimal_value);
break;
@ -5358,7 +5358,7 @@ bool Field_time::get_date(MYSQL_TIME *ltime, uint fuzzydate)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE,
ER(ER_WARN_DATA_OUT_OF_RANGE), field_name,
thd->row_count);
thd->warning_info->current_row_for_warning());
return 1;
}
tmp=(long) sint3korr(ptr);
@ -6352,21 +6352,20 @@ check_string_copy_error(Field_str *field,
{
const char *pos;
char tmp[32];
THD *thd= field->table->in_use;
if (!(pos= well_formed_error_pos) &&
!(pos= cannot_convert_error_pos))
return FALSE;
convert_to_printable(tmp, sizeof(tmp), pos, (end - pos), cs, 6);
push_warning_printf(field->table->in_use,
field->table->in_use->abort_on_warning ?
MYSQL_ERROR::WARN_LEVEL_ERROR :
push_warning_printf(thd,
MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
"string", tmp, field->field_name,
(ulong) field->table->in_use->row_count);
thd->warning_info->current_row_for_warning());
return TRUE;
}
@ -6400,7 +6399,7 @@ Field_longstr::report_if_important_data(const char *ptr, const char *end,
if (test_if_important_data(field_charset, ptr, end))
{
if (table->in_use->abort_on_warning)
set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1);
else
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
return 2;
@ -9030,7 +9029,7 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs)
set_rec_bits((1 << bit_len) - 1, bit_ptr, bit_ofs, bit_len);
memset(ptr, 0xff, bytes_in_rec);
if (table->in_use->really_abort_on_warning())
set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1);
else
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
return 1;
@ -9441,7 +9440,7 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs)
if (bits)
*ptr&= ((1 << bits) - 1); /* set first uchar */
if (table->in_use->really_abort_on_warning())
set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_DATA_TOO_LONG, 1);
else
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
return 1;
@ -10314,7 +10313,7 @@ Field::set_warning(MYSQL_ERROR::enum_warning_level level, uint code,
{
thd->cuted_fields+= cuted_increment;
push_warning_printf(thd, level, code, ER(code), field_name,
thd->row_count);
thd->warning_info->current_row_for_warning());
return 0;
}
return level >= MYSQL_ERROR::WARN_LEVEL_WARN;

View file

@ -265,11 +265,11 @@ static int ndb_to_mysql_error(const NdbError *ndberr)
- Used by replication to see if the error was temporary
*/
if (ndberr->status == NdbError::TemporaryError)
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_TEMPORARY_ERRMSG, ER(ER_GET_TEMPORARY_ERRMSG),
ndberr->code, ndberr->message, "NDB");
else
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
ndberr->code, ndberr->message, "NDB");
return error;
@ -536,7 +536,7 @@ static void set_ndb_err(THD *thd, const NdbError &err)
{
char buf[FN_REFLEN];
ndb_error_string(thd_ndb->m_error_code, buf, sizeof(buf));
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
thd_ndb->m_error_code, buf, "NDB");
}
@ -5308,7 +5308,7 @@ int ha_ndbcluster::create(const char *name,
{
if (create_info->storage_media == HA_SM_MEMORY)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
@ -5363,7 +5363,7 @@ int ha_ndbcluster::create(const char *name,
case ROW_TYPE_FIXED:
if (field_type_forces_var_part(field->type()))
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
@ -5703,7 +5703,7 @@ int ha_ndbcluster::create_index(const char *name, KEY *key_info,
case ORDERED_INDEX:
if (key_info->algorithm == HA_KEY_ALG_HASH)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
@ -9606,11 +9606,11 @@ char* ha_ndbcluster::get_tablespace_name(THD *thd, char* name, uint name_len)
}
err:
if (ndberr.status == NdbError::TemporaryError)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_TEMPORARY_ERRMSG, ER(ER_GET_TEMPORARY_ERRMSG),
ndberr.code, ndberr.message, "NDB");
else
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
ndberr.code, ndberr.message, "NDB");
return 0;
@ -9904,7 +9904,7 @@ uint ha_ndbcluster::set_up_partition_info(partition_info *part_info,
{
if (!current_thd->variables.new_mode)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,

View file

@ -272,13 +272,13 @@ static void run_query(THD *thd, char *buf, char *end,
Thd_ndb *thd_ndb= get_thd_ndb(thd);
for (i= 0; no_print_error[i]; i++)
if ((thd_ndb->m_error_code == no_print_error[i]) ||
(thd->main_da.sql_errno() == (unsigned) no_print_error[i]))
(thd->stmt_da->sql_errno() == (unsigned) no_print_error[i]))
break;
if (!no_print_error[i])
sql_print_error("NDB: %s: error %s %d(ndb: %d) %d %d",
buf,
thd->main_da.message(),
thd->main_da.sql_errno(),
thd->stmt_da->message(),
thd->stmt_da->sql_errno(),
thd_ndb->m_error_code,
(int) thd->is_error(), thd->is_slave_error);
}
@ -293,7 +293,7 @@ static void run_query(THD *thd, char *buf, char *end,
is called from ndbcluster_reset_logs(), which is called from
mysql_flush().
*/
thd->main_da.reset_diagnostics_area();
thd->stmt_da->reset_diagnostics_area();
thd->options= save_thd_options;
thd->set_query(save_thd_query, save_thd_query_length);
@ -963,6 +963,21 @@ struct Cluster_schema
uint32 any_value;
};
static void print_could_not_discover_error(THD *thd,
const Cluster_schema *schema)
{
sql_print_error("NDB Binlog: Could not discover table '%s.%s' from "
"binlog schema event '%s' from node %d. "
"my_errno: %d",
schema->db, schema->name, schema->query,
schema->node_id, my_errno);
List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
MYSQL_ERROR *err;
while ((err= it++))
sql_print_warning("NDB Binlog: (%d)%s", err->get_sql_errno(),
err->get_message_text());
}
/*
Transfer schema table data into corresponding struct
*/
@ -1198,7 +1213,7 @@ ndbcluster_update_slock(THD *thd,
}
if (ndb_error)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
ndb_error->code,
ndb_error->message,
@ -1521,7 +1536,7 @@ err:
}
end:
if (ndb_error)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
ndb_error->code,
ndb_error->message,
@ -1971,15 +1986,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
}
else if (ndb_create_table_from_engine(thd, schema->db, schema->name))
{
sql_print_error("NDB Binlog: Could not discover table '%s.%s' from "
"binlog schema event '%s' from node %d. "
"my_errno: %d",
schema->db, schema->name, schema->query,
schema->node_id, my_errno);
List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
MYSQL_ERROR *err;
while ((err= it++))
sql_print_warning("NDB Binlog: (%d)%s", err->code, err->msg);
print_could_not_discover_error(thd, schema);
}
pthread_mutex_unlock(&LOCK_open);
log_query= 1;
@ -2262,14 +2269,7 @@ ndb_binlog_thread_handle_schema_event_post_epoch(THD *thd,
}
else if (ndb_create_table_from_engine(thd, schema->db, schema->name))
{
sql_print_error("NDB Binlog: Could not discover table '%s.%s' from "
"binlog schema event '%s' from node %d. my_errno: %d",
schema->db, schema->name, schema->query,
schema->node_id, my_errno);
List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
MYSQL_ERROR *err;
while ((err= it++))
sql_print_warning("NDB Binlog: (%d)%s", err->code, err->msg);
print_could_not_discover_error(thd, schema);
}
pthread_mutex_unlock(&LOCK_open);
}
@ -2344,8 +2344,8 @@ static int open_ndb_binlog_index(THD *thd, TABLE_LIST *tables,
sql_print_error("NDB Binlog: Opening ndb_binlog_index: killed");
else
sql_print_error("NDB Binlog: Opening ndb_binlog_index: %d, '%s'",
thd->main_da.sql_errno(),
thd->main_da.message());
thd->stmt_da->sql_errno(),
thd->stmt_da->message());
thd->proc_info= save_proc_info;
return -1;
}
@ -2741,7 +2741,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
"with BLOB attribute and no PK is not supported",
share->key);
if (push_warning)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
@ -2785,7 +2785,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
failed, print a warning
*/
if (push_warning > 1)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
dict->getNdbError().message, "NDB");
@ -2813,7 +2813,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
dict->dropEvent(my_event.getName()))
{
if (push_warning > 1)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
dict->getNdbError().message, "NDB");
@ -2832,7 +2832,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
if (dict->createEvent(my_event))
{
if (push_warning > 1)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
dict->getNdbError().message, "NDB");
@ -2845,7 +2845,7 @@ ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
DBUG_RETURN(-1);
}
#ifdef NDB_BINLOG_EXTRA_WARNINGS
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
0, "NDB Binlog: Removed trailing event",
"NDB");
@ -2956,7 +2956,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
{
sql_print_error("NDB Binlog: Creating NdbEventOperation failed for"
" %s",event_name);
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
ndb->getNdbError().code,
ndb->getNdbError().message,
@ -3005,7 +3005,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
sql_print_error("NDB Binlog: Creating NdbEventOperation"
" blob field %u handles failed (code=%d) for %s",
j, op->getNdbError().code, event_name);
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
op->getNdbError().code,
op->getNdbError().message,
@ -3044,7 +3044,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
retries= 0;
if (retries == 0)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
op->getNdbError().code, op->getNdbError().message,
"NDB");
@ -3112,7 +3112,7 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
if (dict->getNdbError().code != 4710)
{
/* drop event failed for some reason, issue a warning */
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
dict->getNdbError().code,
dict->getNdbError().message, "NDB");

View file

@ -1313,7 +1313,7 @@ int ha_rollback_trans(THD *thd, bool all)
trans->ha_list= 0;
trans->no_2pc=0;
if (is_real_trans && thd->transaction_rollback_request)
thd->transaction.xid_state.rm_error= thd->main_da.sql_errno();
thd->transaction.xid_state.rm_error= thd->stmt_da->sql_errno();
if (all)
thd->variables.tx_isolation=thd->session_tx_isolation;
}
@ -1944,23 +1944,28 @@ const char *get_canonical_filename(handler *file, const char *path,
struct Ha_delete_table_error_handler: public Internal_error_handler
{
public:
virtual bool handle_error(uint sql_errno,
const char *message,
MYSQL_ERROR::enum_warning_level level,
THD *thd);
virtual bool handle_condition(THD *thd,
uint sql_errno,
const char* sqlstate,
MYSQL_ERROR::enum_warning_level level,
const char* msg,
MYSQL_ERROR ** cond_hdl);
char buff[MYSQL_ERRMSG_SIZE];
};
bool
Ha_delete_table_error_handler::
handle_error(uint sql_errno,
const char *message,
MYSQL_ERROR::enum_warning_level level,
THD *thd)
handle_condition(THD *,
uint,
const char*,
MYSQL_ERROR::enum_warning_level,
const char* msg,
MYSQL_ERROR ** cond_hdl)
{
*cond_hdl= NULL;
/* Grab the error message */
strmake(buff, message, sizeof(buff)-1);
strmake(buff, msg, sizeof(buff)-1);
return TRUE;
}
@ -2019,7 +2024,7 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
XXX: should we convert *all* errors to warnings here?
What if the error is fatal?
*/
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error,
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, error,
ha_delete_table_error_handler.buff);
}
delete file;

View file

@ -4782,7 +4782,6 @@ String *Item::check_well_formed_result(String *str, bool send_error)
{
THD *thd= current_thd;
char hexbuf[7];
enum MYSQL_ERROR::enum_warning_level level;
uint diff= str->length() - wlen;
set_if_smaller(diff, 3);
octet2hex(hexbuf, str->ptr() + wlen, diff);
@ -4795,16 +4794,14 @@ String *Item::check_well_formed_result(String *str, bool send_error)
if ((thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
level= MYSQL_ERROR::WARN_LEVEL_ERROR;
null_value= 1;
str= 0;
}
else
{
level= MYSQL_ERROR::WARN_LEVEL_WARN;
str->length(wlen);
}
push_warning_printf(thd, level, ER_INVALID_CHARACTER_STRING,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_INVALID_CHARACTER_STRING,
ER(ER_INVALID_CHARACTER_STRING), cs->csname, hexbuf);
}
return str;

View file

@ -599,7 +599,7 @@ void Item_func::signal_divide_by_null()
{
THD *thd= current_thd;
if (thd->variables.sql_mode & MODE_ERROR_FOR_DIVISION_BY_ZERO)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DIVISION_BY_ZERO,
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_DIVISION_BY_ZERO,
ER(ER_DIVISION_BY_ZERO));
null_value= 1;
}
@ -1054,7 +1054,7 @@ my_decimal *Item_decimal_typecast::val_decimal(my_decimal *dec)
return dec;
err:
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE,
ER(ER_WARN_DATA_OUT_OF_RANGE),
name, 1);
@ -3667,7 +3667,7 @@ longlong Item_func_benchmark::val_int()
{
char buff[22];
llstr(((longlong) loop_count), buff);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WRONG_VALUE_FOR_TYPE, ER(ER_WRONG_VALUE_FOR_TYPE),
"count", buff, "benchmark");
}
@ -5810,12 +5810,12 @@ Item_func_sp::func_name() const
}
int my_missing_function_error(const LEX_STRING &token, const char *func_name)
void my_missing_function_error(const LEX_STRING &token, const char *func_name)
{
if (token.length && is_lex_native_function (&token))
return my_error(ER_FUNC_INEXISTENT_NAME_COLLISION, MYF(0), func_name);
my_error(ER_FUNC_INEXISTENT_NAME_COLLISION, MYF(0), func_name);
else
return my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", func_name);
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", func_name);
}

View file

@ -528,11 +528,11 @@ String *Item_func_des_encrypt::val_str(String *str)
return &tmp_value;
error:
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
code, ER(code),
"des_encrypt");
#else
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_FEATURE_DISABLED, ER(ER_FEATURE_DISABLED),
"des_encrypt","--with-openssl");
#endif /* HAVE_OPENSSL */
@ -605,12 +605,12 @@ String *Item_func_des_decrypt::val_str(String *str)
return &tmp_value;
error:
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
code, ER(code),
"des_decrypt");
wrong_key:
#else
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_FEATURE_DISABLED, ER(ER_FEATURE_DISABLED),
"des_decrypt","--with-openssl");
#endif /* HAVE_OPENSSL */
@ -3237,7 +3237,7 @@ longlong Item_func_uncompressed_length::val_int()
*/
if (res->length() <= 4)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ZLIB_Z_DATA_ERROR,
ER(ER_ZLIB_Z_DATA_ERROR));
null_value= 1;
@ -3314,7 +3314,7 @@ String *Item_func_compress::val_str(String *str)
(const Bytef*)res->ptr(), res->length())) != Z_OK)
{
code= err==Z_MEM_ERROR ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_BUF_ERROR;
push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,code,ER(code));
push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,code,ER(code));
null_value= 1;
return 0;
}
@ -3352,7 +3352,7 @@ String *Item_func_uncompress::val_str(String *str)
/* If length is less than 4 bytes, data is corrupt */
if (res->length() <= 4)
{
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ZLIB_Z_DATA_ERROR,
ER(ER_ZLIB_Z_DATA_ERROR));
goto err;
@ -3362,7 +3362,7 @@ String *Item_func_uncompress::val_str(String *str)
new_size= uint4korr(res->ptr()) & 0x3FFFFFFF;
if (new_size > current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_BIG_FOR_UNCOMPRESS,
ER(ER_TOO_BIG_FOR_UNCOMPRESS),
current_thd->variables.max_allowed_packet);
@ -3380,7 +3380,7 @@ String *Item_func_uncompress::val_str(String *str)
code= ((err == Z_BUF_ERROR) ? ER_ZLIB_Z_BUF_ERROR :
((err == Z_MEM_ERROR) ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_DATA_ERROR));
push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,code,ER(code));
push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,code,ER(code));
err:
null_value= 1;

View file

@ -3102,6 +3102,8 @@ int dump_leaf_key(uchar* key, element_count count __attribute__((unused)),
result->append(*res);
}
item->row_count++;
/* stop if length of result more than max_length */
if (result->length() > item->max_length)
{
@ -3120,8 +3122,11 @@ int dump_leaf_key(uchar* key, element_count count __attribute__((unused)),
result->length(),
&well_formed_error);
result->length(old_length + add_length);
item->count_cut_values++;
item->warning_for_row= TRUE;
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_CUT_VALUE_GROUP_CONCAT, ER(ER_CUT_VALUE_GROUP_CONCAT),
item->row_count);
return 1;
}
return 0;
@ -3141,12 +3146,12 @@ Item_func_group_concat::
Item_func_group_concat(Name_resolution_context *context_arg,
bool distinct_arg, List<Item> *select_list,
SQL_LIST *order_list, String *separator_arg)
:tmp_table_param(0), warning(0),
separator(separator_arg), tree(0), unique_filter(NULL), table(0),
:tmp_table_param(0), separator(separator_arg), tree(0),
unique_filter(NULL), table(0),
order(0), context(context_arg),
arg_count_order(order_list ? order_list->elements : 0),
arg_count_field(select_list->elements),
count_cut_values(0),
row_count(0),
distinct(distinct_arg),
warning_for_row(FALSE),
force_copy_fields(0), original(0)
@ -3200,7 +3205,6 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
Item_func_group_concat *item)
:Item_sum(thd, item),
tmp_table_param(item->tmp_table_param),
warning(item->warning),
separator(item->separator),
tree(item->tree),
unique_filter(item->unique_filter),
@ -3209,7 +3213,7 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
context(item->context),
arg_count_order(item->arg_count_order),
arg_count_field(item->arg_count_field),
count_cut_values(item->count_cut_values),
row_count(item->row_count),
distinct(item->distinct),
warning_for_row(item->warning_for_row),
always_null(item->always_null),
@ -3227,15 +3231,6 @@ void Item_func_group_concat::cleanup()
DBUG_ENTER("Item_func_group_concat::cleanup");
Item_sum::cleanup();
/* Adjust warning message to include total number of cut values */
if (warning)
{
char warn_buff[MYSQL_ERRMSG_SIZE];
sprintf(warn_buff, ER(ER_CUT_VALUE_GROUP_CONCAT), count_cut_values);
warning->set_msg(current_thd, warn_buff);
warning= 0;
}
/*
Free table and tree if they belong to this item (if item have not pointer
to original item from which was made copy => it own its objects )
@ -3259,15 +3254,8 @@ void Item_func_group_concat::cleanup()
delete unique_filter;
unique_filter= NULL;
}
if (warning)
{
char warn_buff[MYSQL_ERRMSG_SIZE];
sprintf(warn_buff, ER(ER_CUT_VALUE_GROUP_CONCAT), count_cut_values);
warning->set_msg(thd, warn_buff);
warning= 0;
}
}
DBUG_ASSERT(tree == 0 && warning == 0);
DBUG_ASSERT(tree == 0);
}
DBUG_VOID_RETURN;
}
@ -3556,17 +3544,6 @@ String* Item_func_group_concat::val_str(String* str)
/* Tree is used for sorting as in ORDER BY */
tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this,
left_root_right);
if (count_cut_values && !warning)
{
/*
ER_CUT_VALUE_GROUP_CONCAT needs an argument, but this gets set in
Item_func_group_concat::cleanup().
*/
DBUG_ASSERT(table);
warning= push_warning(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_CUT_VALUE_GROUP_CONCAT,
ER(ER_CUT_VALUE_GROUP_CONCAT));
}
return &result;
}

View file

@ -1181,12 +1181,9 @@ public:
#endif /* HAVE_DLOPEN */
class MYSQL_ERROR;
class Item_func_group_concat : public Item_sum
{
TMP_TABLE_PARAM *tmp_table_param;
MYSQL_ERROR *warning;
String result;
String *separator;
TREE tree_base;
@ -1207,7 +1204,7 @@ class Item_func_group_concat : public Item_sum
uint arg_count_order;
/** The number of selected items, aka the expr list. */
uint arg_count_field;
uint count_cut_values;
uint row_count;
bool distinct;
bool warning_for_row;
bool always_null;

View file

@ -602,7 +602,7 @@ err:
{
char buff[128];
strmake(buff, val_begin, min(length, sizeof(buff)-1));
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WRONG_VALUE_FOR_TYPE, ER(ER_WRONG_VALUE_FOR_TYPE),
date_time_type, buff, "str_to_date");
}

View file

@ -96,6 +96,7 @@ static SYMBOL symbols[] = {
{ "CASCADE", SYM(CASCADE)},
{ "CASCADED", SYM(CASCADED)},
{ "CASE", SYM(CASE_SYM)},
{ "CATALOG_NAME", SYM(CATALOG_NAME_SYM)},
{ "CHAIN", SYM(CHAIN_SYM)},
{ "CHANGE", SYM(CHANGE)},
{ "CHANGED", SYM(CHANGED)},
@ -105,6 +106,7 @@ static SYMBOL symbols[] = {
{ "CHECK", SYM(CHECK_SYM)},
{ "CHECKSUM", SYM(CHECKSUM_SYM)},
{ "CIPHER", SYM(CIPHER_SYM)},
{ "CLASS_ORIGIN", SYM(CLASS_ORIGIN_SYM)},
{ "CLIENT", SYM(CLIENT_SYM)},
{ "CLOSE", SYM(CLOSE_SYM)},
{ "COALESCE", SYM(COALESCE)},
@ -112,6 +114,7 @@ static SYMBOL symbols[] = {
{ "COLLATE", SYM(COLLATE_SYM)},
{ "COLLATION", SYM(COLLATION_SYM)},
{ "COLUMN", SYM(COLUMN_SYM)},
{ "COLUMN_NAME", SYM(COLUMN_NAME_SYM)},
{ "COLUMNS", SYM(COLUMNS)},
{ "COMMENT", SYM(COMMENT_SYM)},
{ "COMMIT", SYM(COMMIT_SYM)},
@ -124,6 +127,9 @@ static SYMBOL symbols[] = {
{ "CONNECTION", SYM(CONNECTION_SYM)},
{ "CONSISTENT", SYM(CONSISTENT_SYM)},
{ "CONSTRAINT", SYM(CONSTRAINT)},
{ "CONSTRAINT_CATALOG", SYM(CONSTRAINT_CATALOG_SYM)},
{ "CONSTRAINT_NAME", SYM(CONSTRAINT_NAME_SYM)},
{ "CONSTRAINT_SCHEMA", SYM(CONSTRAINT_SCHEMA_SYM)},
{ "CONTAINS", SYM(CONTAINS_SYM)},
{ "CONTEXT", SYM(CONTEXT_SYM)},
{ "CONTINUE", SYM(CONTINUE_SYM)},
@ -138,6 +144,7 @@ static SYMBOL symbols[] = {
{ "CURRENT_TIMESTAMP", SYM(NOW_SYM)},
{ "CURRENT_USER", SYM(CURRENT_USER)},
{ "CURSOR", SYM(CURSOR_SYM)},
{ "CURSOR_NAME", SYM(CURSOR_NAME_SYM)},
{ "DATA", SYM(DATA_SYM)},
{ "DATABASE", SYM(DATABASE)},
{ "DATABASES", SYM(DATABASES)},
@ -334,6 +341,7 @@ static SYMBOL symbols[] = {
{ "MEDIUMTEXT", SYM(MEDIUMTEXT)},
{ "MEMORY", SYM(MEMORY_SYM)},
{ "MERGE", SYM(MERGE_SYM)},
{ "MESSAGE_TEXT", SYM(MESSAGE_TEXT_SYM)},
{ "MICROSECOND", SYM(MICROSECOND_SYM)},
{ "MIDDLEINT", SYM(MEDIUMINT)}, /* For powerbuilder */
{ "MIGRATE", SYM(MIGRATE_SYM)},
@ -350,6 +358,7 @@ static SYMBOL symbols[] = {
{ "MULTIPOINT", SYM(MULTIPOINT)},
{ "MULTIPOLYGON", SYM(MULTIPOLYGON)},
{ "MUTEX", SYM(MUTEX_SYM)},
{ "MYSQL_ERRNO", SYM(MYSQL_ERRNO_SYM)},
{ "NAME", SYM(NAME_SYM)},
{ "NAMES", SYM(NAMES_SYM)},
{ "NATIONAL", SYM(NATIONAL_SYM)},
@ -441,6 +450,7 @@ static SYMBOL symbols[] = {
{ "REPEAT", SYM(REPEAT_SYM)},
{ "REQUIRE", SYM(REQUIRE_SYM)},
{ "RESET", SYM(RESET_SYM)},
{ "RESIGNAL", SYM(RESIGNAL_SYM)},
{ "RESTORE", SYM(RESTORE_SYM)},
{ "RESTRICT", SYM(RESTRICT)},
{ "RESUME", SYM(RESUME_SYM)},
@ -459,6 +469,7 @@ static SYMBOL symbols[] = {
{ "SAVEPOINT", SYM(SAVEPOINT_SYM)},
{ "SCHEDULE", SYM(SCHEDULE_SYM)},
{ "SCHEMA", SYM(DATABASE)},
{ "SCHEMA_NAME", SYM(SCHEMA_NAME_SYM)},
{ "SCHEMAS", SYM(DATABASES)},
{ "SECOND", SYM(SECOND_SYM)},
{ "SECOND_MICROSECOND", SYM(SECOND_MICROSECOND_SYM)},
@ -474,6 +485,7 @@ static SYMBOL symbols[] = {
{ "SHARE", SYM(SHARE_SYM)},
{ "SHOW", SYM(SHOW)},
{ "SHUTDOWN", SYM(SHUTDOWN)},
{ "SIGNAL", SYM(SIGNAL_SYM)},
{ "SIGNED", SYM(SIGNED_SYM)},
{ "SIMPLE", SYM(SIMPLE_SYM)},
{ "SLAVE", SYM(SLAVE)},
@ -515,6 +527,7 @@ static SYMBOL symbols[] = {
{ "STORAGE", SYM(STORAGE_SYM)},
{ "STRAIGHT_JOIN", SYM(STRAIGHT_JOIN)},
{ "STRING", SYM(STRING_SYM)},
{ "SUBCLASS_ORIGIN", SYM(SUBCLASS_ORIGIN_SYM)},
{ "SUBJECT", SYM(SUBJECT_SYM)},
{ "SUBPARTITION", SYM(SUBPARTITION_SYM)},
{ "SUBPARTITIONS", SYM(SUBPARTITIONS_SYM)},
@ -523,6 +536,7 @@ static SYMBOL symbols[] = {
{ "SWAPS", SYM(SWAPS_SYM)},
{ "SWITCHES", SYM(SWITCHES_SYM)},
{ "TABLE", SYM(TABLE_SYM)},
{ "TABLE_NAME", SYM(TABLE_NAME_SYM)},
{ "TABLES", SYM(TABLES)},
{ "TABLESPACE", SYM(TABLESPACE)},
{ "TABLE_CHECKSUM", SYM(TABLE_CHECKSUM_SYM)},

View file

@ -80,23 +80,28 @@ public:
virtual ~Silence_log_table_errors() {}
virtual bool handle_error(uint sql_errno, const char *message,
MYSQL_ERROR::enum_warning_level level,
THD *thd);
virtual bool handle_condition(THD *thd,
uint sql_errno,
const char* sql_state,
MYSQL_ERROR::enum_warning_level level,
const char* msg,
MYSQL_ERROR ** cond_hdl);
const char *message() const { return m_message; }
};
bool
Silence_log_table_errors::handle_error(uint /* sql_errno */,
const char *message_arg,
MYSQL_ERROR::enum_warning_level /* level */,
THD * /* thd */)
Silence_log_table_errors::handle_condition(THD *,
uint,
const char*,
MYSQL_ERROR::enum_warning_level,
const char* msg,
MYSQL_ERROR ** cond_hdl)
{
strmake(m_message, message_arg, sizeof(m_message)-1);
*cond_hdl= NULL;
strmake(m_message, msg, sizeof(m_message)-1);
return TRUE;
}
sql_print_message_func sql_print_message_handlers[3] =
{
sql_print_information,
@ -1661,7 +1666,7 @@ bool MYSQL_BIN_LOG::check_write_error(THD *thd)
if (!thd->is_error())
DBUG_RETURN(checked);
switch (thd->main_da.sql_errno())
switch (thd->stmt_da->sql_errno())
{
case ER_TRANS_CACHE_FULL:
case ER_ERROR_ON_WRITE:
@ -2917,7 +2922,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
}
else
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_PURGE_FATAL_ERR,
"a problem with deleting %s; "
"consider examining correspondence "
@ -2948,7 +2953,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
}
else
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_PURGE_FATAL_ERR,
"a problem with deleting %s; "
"consider examining correspondence "
@ -3279,7 +3284,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
*/
if (thd)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_PURGE_FATAL_ERR,
"a problem with getting info on being purged %s; "
"consider examining correspondence "
@ -3325,7 +3330,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
{
if (thd)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_PURGE_FATAL_ERR,
"a problem with deleting %s; "
"consider examining correspondence "
@ -3424,7 +3429,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
*/
if (thd)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_PURGE_FATAL_ERR,
"a problem with getting info on being purged %s; "
"consider examining correspondence "
@ -4435,9 +4440,9 @@ int query_error_code(THD *thd, bool not_killed)
if (not_killed)
{
error= thd->is_error() ? thd->main_da.sql_errno() : 0;
error= thd->is_error() ? thd->stmt_da->sql_errno() : 0;
/* thd->main_da.sql_errno() might be ER_SERVER_SHUTDOWN or
/* thd->stmt_da->sql_errno() might be ER_SERVER_SHUTDOWN or
ER_QUERY_INTERRUPTED, So here we need to make sure that error
is not set to these errors when specified not_killed by the
caller.

View file

@ -134,7 +134,7 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
char buff[MAX_SLAVE_ERRMSG], *slider;
const char *buff_end= buff + sizeof(buff);
uint len;
List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
MYSQL_ERROR *err;
buff[0]= 0;
@ -142,10 +142,11 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
slider += len, err= it++)
{
len= my_snprintf(slider, buff_end - slider,
" %s, Error_code: %d;", err->msg, err->code);
" %s, Error_code: %d;", err->get_message_text(),
err->get_sql_errno());
}
rli->report(level, thd->is_error()? thd->main_da.sql_errno() : 0,
rli->report(level, thd->is_error()? thd->stmt_da->sql_errno() : 0,
"Could not execute %s event on table %s.%s;"
"%s handler error %s; "
"the event's master log %s, end_log_pos %lu",
@ -353,13 +354,13 @@ inline int ignored_error_code(int err_code)
*/
int convert_handler_error(int error, THD* thd, TABLE *table)
{
uint actual_error= (thd->is_error() ? thd->main_da.sql_errno() :
uint actual_error= (thd->is_error() ? thd->stmt_da->sql_errno() :
0);
if (actual_error == 0)
{
table->file->print_error(error, MYF(0));
actual_error= (thd->is_error() ? thd->main_da.sql_errno() :
actual_error= (thd->is_error() ? thd->stmt_da->sql_errno() :
ER_UNKNOWN_ERROR);
if (actual_error == ER_UNKNOWN_ERROR)
if (global_system_variables.log_warnings)
@ -3162,7 +3163,7 @@ START SLAVE; . Query: '%s'", expected_error, thd->query);
}
/* If the query was not ignored, it is printed to the general log */
if (!thd->is_error() || thd->main_da.sql_errno() != ER_SLAVE_IGNORED_TABLE)
if (!thd->is_error() || thd->stmt_da->sql_errno() != ER_SLAVE_IGNORED_TABLE)
general_log_write(thd, COM_QUERY, thd->query, thd->query_length);
compare_errors:
@ -3171,7 +3172,7 @@ compare_errors:
If we expected a non-zero error code, and we don't get the same error
code, and it should be ignored or is related to a concurrency issue.
*/
actual_error= thd->is_error() ? thd->main_da.sql_errno() : 0;
actual_error= thd->is_error() ? thd->stmt_da->sql_errno() : 0;
DBUG_PRINT("info",("expected_error: %d sql_errno: %d",
expected_error, actual_error));
if ((expected_error && expected_error != actual_error &&
@ -3186,7 +3187,7 @@ Error on master: '%s' (%d), Error on slave: '%s' (%d). \
Default database: '%s'. Query: '%s'",
ER_SAFE(expected_error),
expected_error,
actual_error ? thd->main_da.message() : "no error",
actual_error ? thd->stmt_da->message() : "no error",
actual_error,
print_slave_db_safe(db), query_arg);
thd->is_slave_error= 1;
@ -3227,7 +3228,7 @@ Default database: '%s'. Query: '%s'",
{
rli->report(ERROR_LEVEL, actual_error,
"Error '%s' on query. Default database: '%s'. Query: '%s'",
(actual_error ? thd->main_da.message() :
(actual_error ? thd->stmt_da->message() :
"unexpected success or fatal error"),
print_slave_db_safe(thd->db), query_arg);
thd->is_slave_error= 1;
@ -4534,13 +4535,7 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli,
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id = next_query_id();
VOID(pthread_mutex_unlock(&LOCK_thread_count));
/*
Initing thd->row_count is not necessary in theory as this variable has no
influence in the case of the slave SQL thread (it is used to generate a
"data truncated" warning but which is absorbed and never gets to the
error log); still we init it to avoid a Valgrind message.
*/
mysql_reset_errors(thd, 0);
thd->warning_info->opt_clear_warning_info(thd->query_id);
TABLE_LIST tables;
bzero((char*) &tables,sizeof(tables));
@ -4701,8 +4696,8 @@ error:
int sql_errno;
if (thd->is_error())
{
err= thd->main_da.message();
sql_errno= thd->main_da.sql_errno();
err= thd->stmt_da->message();
sql_errno= thd->stmt_da->sql_errno();
}
else
{
@ -7265,7 +7260,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
if (simple_open_n_lock_tables(thd, rli->tables_to_lock))
{
uint actual_error= thd->main_da.sql_errno();
uint actual_error= thd->stmt_da->sql_errno();
if (thd->is_slave_error || thd->is_fatal_error)
{
/*
@ -7276,7 +7271,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
*/
rli->report(ERROR_LEVEL, actual_error,
"Error '%s' on opening tables",
(actual_error ? thd->main_da.message() :
(actual_error ? thd->stmt_da->message() :
"unexpected success or fatal error"));
thd->is_slave_error= 1;
}

View file

@ -78,7 +78,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
if (simple_open_n_lock_tables(thd, rli->tables_to_lock))
{
uint actual_error= thd->main_da.sql_errno();
uint actual_error= thd->stmt_da->sql_errno();
if (thd->is_slave_error || thd->is_fatal_error)
{
/*
@ -87,7 +87,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
*/
rli->report(ERROR_LEVEL, actual_error,
"Error '%s' on opening tables",
(actual_error ? thd->main_da.message() :
(actual_error ? thd->stmt_da->message() :
"unexpected success or fatal error"));
thd->is_slave_error= 1;
}
@ -216,10 +216,10 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
break;
default:
rli->report(ERROR_LEVEL, thd->main_da.sql_errno(),
rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(),
"Error in %s event: row application failed. %s",
ev->get_type_str(),
thd->is_error() ? thd->main_da.message() : "");
thd->is_error() ? thd->stmt_da->message() : "");
thd->is_slave_error= 1;
break;
}
@ -245,12 +245,12 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
if (error)
{ /* error has occured during the transaction */
rli->report(ERROR_LEVEL, thd->main_da.sql_errno(),
rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(),
"Error in %s event: error during transaction execution "
"on table %s.%s. %s",
ev->get_type_str(), table->s->db.str,
table->s->table_name.str,
thd->is_error() ? thd->main_da.message() : "");
thd->is_error() ? thd->stmt_da->message() : "");
/*
If one day we honour --skip-slave-errors in row-based replication, and

View file

@ -41,17 +41,17 @@ int decimal_operation_results(int result)
"", (long)-1);
break;
case E_DEC_OVERFLOW:
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE),
"DECIMAL", "");
break;
case E_DEC_DIV_ZERO:
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_DIVISION_BY_ZERO, ER(ER_DIVISION_BY_ZERO));
break;
case E_DEC_BAD_NUM:
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
"decimal", "", "", (long)-1);

View file

@ -128,6 +128,10 @@ extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *files_charset_info ;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *national_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *table_alias_charset;
/**
Character set of the buildin error messages loaded from errmsg.sys.
*/
extern CHARSET_INFO *error_message_charset_info;
enum Derivation
{

View file

@ -628,6 +628,7 @@ MY_BITMAP temp_pool;
CHARSET_INFO *system_charset_info, *files_charset_info ;
CHARSET_INFO *national_charset_info, *table_alias_charset;
CHARSET_INFO *character_set_filesystem;
CHARSET_INFO *error_message_charset_info;
MY_LOCALE *my_default_lc_time_names;
@ -1808,7 +1809,8 @@ void close_connection(THD *thd, uint errcode, bool lock)
if ((vio= thd->net.vio) != 0)
{
if (errcode)
net_send_error(thd, errcode, ER(errcode)); /* purecov: inspected */
net_send_error(thd, errcode,
ER(errcode), NULL); /* purecov: inspected */
vio_close(vio); /* vio is freed in delete thd */
}
if (lock)
@ -2853,11 +2855,11 @@ static void check_data_home(const char *path)
for the client.
*/
/* ARGSUSED */
extern "C" int my_message_sql(uint error, const char *str, myf MyFlags);
extern "C" void my_message_sql(uint error, const char *str, myf MyFlags);
int my_message_sql(uint error, const char *str, myf MyFlags)
void my_message_sql(uint error, const char *str, myf MyFlags)
{
THD *thd;
THD *thd= current_thd;
DBUG_ENTER("my_message_sql");
DBUG_PRINT("error", ("error: %u message: '%s'", error, str));
@ -2879,70 +2881,18 @@ int my_message_sql(uint error, const char *str, myf MyFlags)
error= ER_UNKNOWN_ERROR;
}
if ((thd= current_thd))
if (thd)
{
/*
TODO: There are two exceptions mechanism (THD and sp_rcontext),
this could be improved by having a common stack of handlers.
*/
if (thd->handle_error(error, str,
MYSQL_ERROR::WARN_LEVEL_ERROR))
DBUG_RETURN(0);
thd->is_slave_error= 1; // needed to catch query errors during replication
/*
thd->lex->current_select == 0 if lex structure is not inited
(not query command (COM_QUERY))
*/
if (thd->lex->current_select &&
thd->lex->current_select->no_error && !thd->is_fatal_error)
{
DBUG_PRINT("error",
("Error converted to warning: current_select: no_error %d "
"fatal_error: %d",
(thd->lex->current_select ?
thd->lex->current_select->no_error : 0),
(int) thd->is_fatal_error));
}
else
{
if (! thd->main_da.is_error()) // Return only first message
{
thd->main_da.set_error_status(thd, error, str);
}
query_cache_abort(&thd->net);
}
/*
If a continue handler is found, the error message will be cleared
by the stored procedures code.
*/
if (thd->spcont &&
! (MyFlags & ME_NO_SP_HANDLER) &&
thd->spcont->handle_error(error, MYSQL_ERROR::WARN_LEVEL_ERROR, thd))
{
/*
Do not push any warnings, a handled error must be completely
silenced.
*/
DBUG_RETURN(0);
}
if (!thd->no_warnings_for_error &&
!(MyFlags & ME_NO_WARNING_FOR_ERROR))
{
/*
Suppress infinite recursion if there a memory allocation error
inside push_warning.
*/
thd->no_warnings_for_error= TRUE;
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str);
thd->no_warnings_for_error= FALSE;
}
if (MyFlags & ME_FATALERROR)
thd->is_fatal_error= 1;
(void) thd->raise_condition(error,
NULL,
MYSQL_ERROR::WARN_LEVEL_ERROR,
str);
}
if (!thd || MyFlags & ME_NOREFRESH)
sql_print_error("%s: %s",my_progname,str); /* purecov: inspected */
DBUG_RETURN(0);
DBUG_VOID_RETURN;
}
@ -3106,6 +3056,7 @@ SHOW_VAR com_status_vars[]= {
{"replace", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPLACE]), SHOW_LONG_STATUS},
{"replace_select", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPLACE_SELECT]), SHOW_LONG_STATUS},
{"reset", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESET]), SHOW_LONG_STATUS},
{"resignal", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESIGNAL]), SHOW_LONG_STATUS},
{"restore_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESTORE_TABLE]), SHOW_LONG_STATUS},
{"revoke", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REVOKE]), SHOW_LONG_STATUS},
{"revoke_all", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REVOKE_ALL]), SHOW_LONG_STATUS},
@ -3114,6 +3065,7 @@ SHOW_VAR com_status_vars[]= {
{"savepoint", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SAVEPOINT]), SHOW_LONG_STATUS},
{"select", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SELECT]), SHOW_LONG_STATUS},
{"set_option", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SET_OPTION]), SHOW_LONG_STATUS},
{"signal", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SIGNAL]), SHOW_LONG_STATUS},
{"show_authors", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_AUTHORS]), SHOW_LONG_STATUS},
{"show_binlog_events", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOG_EVENTS]), SHOW_LONG_STATUS},
{"show_binlogs", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOGS]), SHOW_LONG_STATUS},
@ -4938,7 +4890,7 @@ void create_thread_to_handle_connection(THD *thd)
/* Can't use my_error() since store_globals has not been called. */
my_snprintf(error_message_buff, sizeof(error_message_buff),
ER(ER_CANT_CREATE_THREAD), error);
net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff);
net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff, NULL);
(void) pthread_mutex_lock(&LOCK_thread_count);
close_connection(thd,0,0);
delete thd;

View file

@ -28,13 +28,13 @@
#include <stdarg.h>
static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024;
bool net_send_error_packet(THD *, uint, const char *, const char *);
/* Declared non-static only because of the embedded library. */
bool net_send_error_packet(THD *thd, uint sql_errno, const char *err);
bool net_send_ok(THD *, uint, uint, ha_rows, ulonglong, const char *);
bool net_send_eof(THD *thd, uint server_status, uint total_warn_count);
bool net_send_ok(THD *, uint, uint, ulonglong, ulonglong, const char *);
/* Declared non-static only because of the embedded library. */
bool net_send_eof(THD *thd, uint server_status, uint statement_warn_count);
#ifndef EMBEDDED_LIBRARY
static bool write_eof_packet(THD *thd, NET *net,
uint server_status, uint total_warn_count);
static bool write_eof_packet(THD *, NET *, uint, uint);
#endif
#ifndef EMBEDDED_LIBRARY
@ -80,29 +80,33 @@ bool Protocol_binary::net_store_data(const uchar *from, size_t length)
@retval TRUE An error occurred and the message wasn't sent properly
*/
bool net_send_error(THD *thd, uint sql_errno, const char *err)
bool net_send_error(THD *thd, uint sql_errno, const char *err,
const char* sqlstate)
{
DBUG_ENTER("net_send_error");
DBUG_ASSERT(!thd->spcont);
DBUG_ASSERT(sql_errno);
DBUG_ASSERT(err && err[0]);
DBUG_ASSERT(err);
DBUG_PRINT("enter",("sql_errno: %d err: %s", sql_errno, err));
bool error;
if (sqlstate == NULL)
sqlstate= mysql_errno_to_sqlstate(sql_errno);
/*
It's one case when we can push an error even though there
is an OK or EOF already.
*/
thd->main_da.can_overwrite_status= TRUE;
thd->stmt_da->can_overwrite_status= TRUE;
/* Abort multi-result sets */
thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
error= net_send_error_packet(thd, sql_errno, err);
error= net_send_error_packet(thd, sql_errno, err, sqlstate);
thd->main_da.can_overwrite_status= FALSE;
thd->stmt_da->can_overwrite_status= FALSE;
DBUG_RETURN(error);
}
@ -124,7 +128,7 @@ bool net_send_error(THD *thd, uint sql_errno, const char *err)
@param thd Thread handler
@param server_status The server status
@param total_warn_count Total number of warnings
@param statement_warn_count Total number of warnings
@param affected_rows Number of rows changed by statement
@param id Auto_increment id for first row (if used)
@param message Message to send to the client (Used by mysql_status)
@ -138,8 +142,8 @@ bool net_send_error(THD *thd, uint sql_errno, const char *err)
#ifndef EMBEDDED_LIBRARY
bool
net_send_ok(THD *thd,
uint server_status, uint total_warn_count,
ha_rows affected_rows, ulonglong id, const char *message)
uint server_status, uint statement_warn_count,
ulonglong affected_rows, ulonglong id, const char *message)
{
NET *net= &thd->net;
uchar buff[MYSQL_ERRMSG_SIZE+10],*pos;
@ -162,12 +166,12 @@ net_send_ok(THD *thd,
(ulong) affected_rows,
(ulong) id,
(uint) (server_status & 0xffff),
(uint) total_warn_count));
(uint) statement_warn_count));
int2store(pos, server_status);
pos+=2;
/* We can only return up to 65535 warnings in two bytes */
uint tmp= min(total_warn_count, 65535);
uint tmp= min(statement_warn_count, 65535);
int2store(pos, tmp);
pos+= 2;
}
@ -176,7 +180,7 @@ net_send_ok(THD *thd,
int2store(pos, server_status);
pos+=2;
}
thd->main_da.can_overwrite_status= TRUE;
thd->stmt_da->can_overwrite_status= TRUE;
if (message && message[0])
pos= net_store_data(pos, (uchar*) message, strlen(message));
@ -184,7 +188,7 @@ net_send_ok(THD *thd,
if (!error)
error= net_flush(net);
thd->main_da.can_overwrite_status= FALSE;
thd->stmt_da->can_overwrite_status= FALSE;
DBUG_PRINT("info", ("OK sent, so no more error sending allowed"));
DBUG_RETURN(error);
@ -208,7 +212,7 @@ static uchar eof_buff[1]= { (uchar) 254 }; /* Marker for end of fields */
@param thd Thread handler
@param server_status The server status
@param total_warn_count Total number of warnings
@param statement_warn_count Total number of warnings
@return
@retval FALSE The message was successfully sent
@ -216,7 +220,7 @@ static uchar eof_buff[1]= { (uchar) 254 }; /* Marker for end of fields */
*/
bool
net_send_eof(THD *thd, uint server_status, uint total_warn_count)
net_send_eof(THD *thd, uint server_status, uint statement_warn_count)
{
NET *net= &thd->net;
bool error= FALSE;
@ -224,11 +228,11 @@ net_send_eof(THD *thd, uint server_status, uint total_warn_count)
/* Set to TRUE if no active vio, to work well in case of --init-file */
if (net->vio != 0)
{
thd->main_da.can_overwrite_status= TRUE;
error= write_eof_packet(thd, net, server_status, total_warn_count);
thd->stmt_da->can_overwrite_status= TRUE;
error= write_eof_packet(thd, net, server_status, statement_warn_count);
if (!error)
error= net_flush(net);
thd->main_da.can_overwrite_status= FALSE;
thd->stmt_da->can_overwrite_status= FALSE;
DBUG_PRINT("info", ("EOF sent, so no more error sending allowed"));
}
DBUG_RETURN(error);
@ -242,7 +246,7 @@ net_send_eof(THD *thd, uint server_status, uint total_warn_count)
@param thd The thread handler
@param net The network handler
@param server_status The server status
@param total_warn_count The number of warnings
@param statement_warn_count The number of warnings
@return
@ -252,7 +256,7 @@ net_send_eof(THD *thd, uint server_status, uint total_warn_count)
static bool write_eof_packet(THD *thd, NET *net,
uint server_status,
uint total_warn_count)
uint statement_warn_count)
{
bool error;
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
@ -262,7 +266,7 @@ static bool write_eof_packet(THD *thd, NET *net,
Don't send warn count during SP execution, as the warn_list
is cleared between substatements, and mysqltest gets confused
*/
uint tmp= min(total_warn_count, 65535);
uint tmp= min(statement_warn_count, 65535);
buff[0]= 254;
int2store(buff+1, tmp);
/*
@ -309,7 +313,9 @@ bool send_old_password_request(THD *thd)
@retval TRUE An error occurred and the messages wasn't sent properly
*/
bool net_send_error_packet(THD *thd, uint sql_errno, const char *err)
bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
const char* sqlstate)
{
NET *net= &thd->net;
uint length;
@ -338,7 +344,7 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err)
{
/* The first # is to make the protocol backward compatible */
buff[2]= '#';
pos= (uchar*) strmov((char*) buff+3, mysql_errno_to_sqlstate(sql_errno));
pos= (uchar*) strmov((char*) buff+3, sqlstate);
}
length= (uint) (strmake((char*) pos, err, MYSQL_ERRMSG_SIZE-1) -
(char*) buff);
@ -430,45 +436,45 @@ static uchar *net_store_length_fast(uchar *packet, uint length)
void net_end_statement(THD *thd)
{
DBUG_ASSERT(! thd->main_da.is_sent);
DBUG_ASSERT(! thd->stmt_da->is_sent);
/* Can not be true, but do not take chances in production. */
if (thd->main_da.is_sent)
if (thd->stmt_da->is_sent)
return;
bool error= FALSE;
switch (thd->main_da.status()) {
switch (thd->stmt_da->status()) {
case Diagnostics_area::DA_ERROR:
/* The query failed, send error to log and abort bootstrap. */
error= net_send_error(thd,
thd->main_da.sql_errno(),
thd->main_da.message());
thd->stmt_da->sql_errno(),
thd->stmt_da->message(),
thd->stmt_da->get_sqlstate());
break;
case Diagnostics_area::DA_EOF:
error= net_send_eof(thd,
thd->main_da.server_status(),
thd->main_da.total_warn_count());
thd->stmt_da->server_status(),
thd->stmt_da->statement_warn_count());
break;
case Diagnostics_area::DA_OK:
error= net_send_ok(thd,
thd->main_da.server_status(),
thd->main_da.total_warn_count(),
thd->main_da.affected_rows(),
thd->main_da.last_insert_id(),
thd->main_da.message());
thd->stmt_da->server_status(),
thd->stmt_da->statement_warn_count(),
thd->stmt_da->affected_rows(),
thd->stmt_da->last_insert_id(),
thd->stmt_da->message());
break;
case Diagnostics_area::DA_DISABLED:
break;
case Diagnostics_area::DA_EMPTY:
default:
DBUG_ASSERT(0);
error= net_send_ok(thd, thd->server_status, thd->total_warn_count,
0, 0, NULL);
error= net_send_ok(thd, thd->server_status, 0, 0, 0, NULL);
break;
}
if (!error)
thd->main_da.is_sent= TRUE;
thd->stmt_da->is_sent= TRUE;
}
@ -711,7 +717,8 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
to show that there is no cursor.
Send no warning information, as it will be sent at statement end.
*/
write_eof_packet(thd, &thd->net, thd->server_status, thd->total_warn_count);
write_eof_packet(thd, &thd->net, thd->server_status,
thd->warning_info->statement_warn_count());
}
DBUG_RETURN(prepare_for_send(list));

View file

@ -17,6 +17,7 @@
#pragma interface /* gcc class implementation */
#endif
#include "sql_error.h"
class i_string;
class THD;
@ -173,7 +174,8 @@ public:
};
void send_warning(THD *thd, uint sql_errno, const char *err=0);
bool net_send_error(THD *thd, uint sql_errno=0, const char *err=0);
bool net_send_error(THD *thd, uint sql_errno, const char *err,
const char* sqlstate);
void net_end_statement(THD *thd);
bool send_old_password_request(THD *thd);
uchar *net_store_data(uchar *to,const uchar *from, size_t length);

View file

@ -913,7 +913,7 @@ bool load_master_data(THD* thd)
goto err;
}
/* Clear the result of mysql_create_db(). */
thd->main_da.reset_diagnostics_area();
thd->stmt_da->reset_diagnostics_area();
if (mysql_select_db(&mysql, db) ||
mysql_real_query(&mysql, STRING_WITH_LEN("SHOW TABLES")) ||

View file

@ -183,7 +183,7 @@ int init_relay_log_info(Relay_log_info* rli,
{
sql_print_error("Failed to create a new relay log info file (\
file '%s', errno %d)", fname, my_errno);
msg= current_thd->main_da.message();
msg= current_thd->stmt_da->message();
goto err;
}
if (init_io_cache(&rli->info_file, info_fd, IO_SIZE*2, READ_CACHE, 0L,0,
@ -191,7 +191,7 @@ file '%s', errno %d)", fname, my_errno);
{
sql_print_error("Failed to create a cache on relay log info file '%s'",
fname);
msg= current_thd->main_da.message();
msg= current_thd->stmt_da->message();
goto err;
}

View file

@ -3133,17 +3133,13 @@ static int check_pseudo_thread_id(THD *thd, set_var *var)
static uchar *get_warning_count(THD *thd)
{
thd->sys_var_tmp.long_value=
(thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_NOTE] +
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR] +
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_WARN]);
thd->sys_var_tmp.long_value= thd->warning_info->warn_count();
return (uchar*) &thd->sys_var_tmp.long_value;
}
static uchar *get_error_count(THD *thd)
{
thd->sys_var_tmp.long_value=
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR];
thd->sys_var_tmp.long_value= thd->warning_info->error_count();
return (uchar*) &thd->sys_var_tmp.long_value;
}

View file

@ -4879,13 +4879,7 @@ ER_ZLIB_Z_DATA_ERROR
por "ZLIB: Dados de entrada está corrupto"
spa "ZLIB: Dato de entrada fué corrompido para zlib"
ER_CUT_VALUE_GROUP_CONCAT
eng "%d line(s) were cut by GROUP_CONCAT()"
ger "%d Zeile(n) durch GROUP_CONCAT() abgeschnitten"
nla "%d regel(s) door GROUP_CONCAT() ingekort"
por "%d linha(s) foram cortada(s) por GROUP_CONCAT()"
spa "%d línea(s) fue(fueron) cortadas por group_concat()"
swe "%d rad(er) kapades av group_concat()"
ukr "%d line(s) was(were) cut by group_concat()"
eng "Row %u was cut by GROUP_CONCAT()"
ER_WARN_TOO_FEW_RECORDS 01000
eng "Row %ld doesn't contain data for all columns"
ger "Zeile %ld enthält nicht für alle Felder Daten"
@ -6206,3 +6200,31 @@ ER_TOO_MANY_CONCURRENT_TRXS
WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
eng "Non-ASCII separator arguments are not fully supported"
ER_DUP_SIGNAL_SET 42000
eng "Duplicate condition information item '%s'"
# Note that the SQLSTATE is not 01000, it is provided by SIGNAL/RESIGNAL
ER_SIGNAL_WARN 01000
eng "Unhandled user-defined warning condition"
# Note that the SQLSTATE is not 02000, it is provided by SIGNAL/RESIGNAL
ER_SIGNAL_NOT_FOUND 02000
eng "Unhandled user-defined not found condition"
# Note that the SQLSTATE is not HY000, it is provided by SIGNAL/RESIGNAL
ER_SIGNAL_EXCEPTION HY000
eng "Unhandled user-defined exception condition"
ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER 0K000
eng "RESIGNAL when handler not active"
ER_SIGNAL_BAD_CONDITION_TYPE
eng "SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE"
WARN_COND_ITEM_TRUNCATED
eng "Data truncated for condition item '%s'"
ER_COND_ITEM_TOO_LONG
eng "Data too long for condition item '%s'"

View file

@ -1274,7 +1274,7 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
else
{
/* Clear the OK result of mysql_rm_table(). */
thd->main_da.reset_diagnostics_area();
thd->stmt_da->reset_diagnostics_area();
}
}
@ -1297,7 +1297,7 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
goto err; // mysql_parse took care of the error send
thd_proc_info(thd, "Opening master dump table");
thd->main_da.reset_diagnostics_area(); /* cleanup from CREATE_TABLE */
thd->stmt_da->reset_diagnostics_area(); /* cleanup from CREATE_TABLE */
/*
Note: If this function starts to fail for MERGE tables,
change the next two lines to these:
@ -2011,7 +2011,7 @@ static int has_temporary_error(THD *thd)
DBUG_ENTER("has_temporary_error");
DBUG_EXECUTE_IF("all_errors_are_temporary_errors",
if (thd->main_da.is_error())
if (thd->stmt_da->is_error())
{
thd->clear_error();
my_error(ER_LOCK_DEADLOCK, MYF(0));
@ -2030,20 +2030,21 @@ static int has_temporary_error(THD *thd)
currently, InnoDB deadlock detected by InnoDB or lock
wait timeout (innodb_lock_wait_timeout exceeded
*/
if (thd->main_da.sql_errno() == ER_LOCK_DEADLOCK ||
thd->main_da.sql_errno() == ER_LOCK_WAIT_TIMEOUT)
if (thd->stmt_da->sql_errno() == ER_LOCK_DEADLOCK ||
thd->stmt_da->sql_errno() == ER_LOCK_WAIT_TIMEOUT)
DBUG_RETURN(1);
#ifdef HAVE_NDB_BINLOG
/*
currently temporary error set in ndbcluster
*/
List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
MYSQL_ERROR *err;
while ((err= it++))
{
DBUG_PRINT("info", ("has warning %d %s", err->code, err->msg));
switch (err->code)
DBUG_PRINT("info", ("has condition %d %s", err->get_sql_errno(),
err->get_message_text()));
switch (err->get_sql_errno())
{
case ER_GET_TEMPORARY_ERRMSG:
DBUG_RETURN(1);
@ -2977,9 +2978,9 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
if (check_temp_dir(rli->slave_patternload_file))
{
rli->report(ERROR_LEVEL, thd->main_da.sql_errno(),
rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(),
"Unable to use slave's temporary directory %s - %s",
slave_load_tmpdir, thd->main_da.message());
slave_load_tmpdir, thd->stmt_da->message());
goto err;
}
@ -2989,7 +2990,7 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
execute_init_command(thd, &sys_init_slave, &LOCK_sys_init_slave);
if (thd->is_slave_error)
{
rli->report(ERROR_LEVEL, thd->main_da.sql_errno(),
rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(),
"Slave SQL thread aborted. Can't execute init_slave query");
goto err;
}
@ -3033,20 +3034,20 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
if (thd->is_error())
{
char const *const errmsg= thd->main_da.message();
char const *const errmsg= thd->stmt_da->message();
DBUG_PRINT("info",
("thd->main_da.sql_errno()=%d; rli->last_error.number=%d",
thd->main_da.sql_errno(), last_errno));
("thd->stmt_da->sql_errno()=%d; rli->last_error.number=%d",
thd->stmt_da->sql_errno(), last_errno));
if (last_errno == 0)
{
/*
This function is reporting an error which was not reported
while executing exec_relay_log_event().
*/
rli->report(ERROR_LEVEL, thd->main_da.sql_errno(), errmsg);
rli->report(ERROR_LEVEL, thd->stmt_da->sql_errno(), errmsg);
}
else if (last_errno != thd->main_da.sql_errno())
else if (last_errno != thd->stmt_da->sql_errno())
{
/*
* An error was reported while executing exec_relay_log_event()
@ -3055,12 +3056,12 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
* what caused the problem.
*/
sql_print_error("Slave (additional info): %s Error_code: %d",
errmsg, thd->main_da.sql_errno());
errmsg, thd->stmt_da->sql_errno());
}
}
/* Print any warnings issued */
List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
List_iterator_fast<MYSQL_ERROR> it(thd->warning_info->warn_list());
MYSQL_ERROR *err;
/*
Added controlled slave thread cancel for replication
@ -3069,9 +3070,9 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
bool udf_error = false;
while ((err= it++))
{
if (err->code == ER_CANT_OPEN_LIBRARY)
if (err->get_sql_errno() == ER_CANT_OPEN_LIBRARY)
udf_error = true;
sql_print_warning("Slave: %s Error_code: %d",err->msg, err->code);
sql_print_warning("Slave: %s Error_code: %d", err->get_message_text(), err->get_sql_errno());
}
if (udf_error)
sql_print_error("Error loading user-defined library, slave SQL "

View file

@ -522,16 +522,24 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
struct Silence_deprecated_warning : public Internal_error_handler
{
public:
virtual bool handle_error(uint sql_errno, const char *message,
MYSQL_ERROR::enum_warning_level level,
THD *thd);
virtual bool handle_condition(THD *thd,
uint sql_errno,
const char* sqlstate,
MYSQL_ERROR::enum_warning_level level,
const char* msg,
MYSQL_ERROR ** cond_hdl);
};
bool
Silence_deprecated_warning::handle_error(uint sql_errno, const char *message,
MYSQL_ERROR::enum_warning_level level,
THD *thd)
Silence_deprecated_warning::handle_condition(
THD *,
uint sql_errno,
const char*,
MYSQL_ERROR::enum_warning_level level,
const char*,
MYSQL_ERROR ** cond_hdl)
{
*cond_hdl= NULL;
if (sql_errno == ER_WARN_DEPRECATED_SYNTAX &&
level == MYSQL_ERROR::WARN_LEVEL_WARN)
return TRUE;
@ -1336,7 +1344,7 @@ sp_exist_routines(THD *thd, TABLE_LIST *routines, bool any)
&thd->sp_proc_cache, FALSE) != NULL ||
sp_find_routine(thd, TYPE_ENUM_FUNCTION, name,
&thd->sp_func_cache, FALSE) != NULL;
mysql_reset_errors(thd, TRUE);
thd->warning_info->clear_warning_info(thd->query_id);
if (sp_object_found)
{
if (any)

View file

@ -1083,6 +1083,7 @@ sp_head::execute(THD *thd)
Reprepare_observer *save_reprepare_observer= thd->m_reprepare_observer;
Object_creation_ctx *saved_creation_ctx;
Warning_info *saved_warning_info, warning_info(thd->warning_info->warn_id());
/* Use some extra margin for possible SP recursion and functions */
if (check_stack_overrun(thd, 8 * STACK_MIN_SIZE, (uchar*)&old_packet))
@ -1131,6 +1132,11 @@ sp_head::execute(THD *thd)
thd->is_slave_error= 0;
old_arena= thd->stmt_arena;
/* Push a new warning information area. */
warning_info.append_warning_info(thd, thd->warning_info);
saved_warning_info= thd->warning_info;
thd->warning_info= &warning_info;
/*
Switch query context. This has to be done early as this is sometimes
allocated trough sql_alloc
@ -1278,29 +1284,33 @@ sp_head::execute(THD *thd)
*/
if (ctx)
{
uint hf;
uint handler_index;
switch (ctx->found_handler(&hip, &hf)) {
switch (ctx->found_handler(& hip, & handler_index)) {
case SP_HANDLER_NONE:
break;
case SP_HANDLER_CONTINUE:
thd->restore_active_arena(&execute_arena, &backup_arena);
thd->set_n_backup_active_arena(&execute_arena, &backup_arena);
ctx->push_hstack(i->get_cont_dest());
// Fall through
/* Fall through */
default:
if (ctx->end_partial_result_set)
thd->protocol->end_partial_result_set(thd);
ip= hip;
err_status= FALSE;
ctx->clear_handler();
ctx->enter_handler(hip);
ctx->enter_handler(hip, handler_index);
thd->clear_error();
thd->is_fatal_error= 0;
thd->killed= THD::NOT_KILLED;
thd->mysys_var->abort= 0;
continue;
}
ctx->end_partial_result_set= FALSE;
}
} while (!err_status && !thd->killed);
} while (!err_status && !thd->killed && !thd->is_fatal_error);
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
thd->profiling.finish_current_query();
@ -1334,6 +1344,10 @@ sp_head::execute(THD *thd)
thd->stmt_arena= old_arena;
state= EXECUTED;
/* Restore the caller's original warning information area. */
saved_warning_info->merge_with_routine_info(thd, thd->warning_info);
thd->warning_info= saved_warning_info;
done:
DBUG_PRINT("info", ("err_status: %d killed: %d is_slave_error: %d report_error: %d",
err_status, thd->killed, thd->is_slave_error,
@ -2523,7 +2537,8 @@ void sp_head::optimize()
else
{
if (src != dst)
{ // Move the instruction and update prev. jumps
{
/* Move the instruction and update prev. jumps */
sp_instr *ibp;
List_iterator_fast<sp_instr> li(bp);
@ -2848,7 +2863,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
{
res= m_lex_keeper.reset_lex_and_exec_core(thd, nextp, FALSE, this);
if (thd->main_da.is_eof())
if (thd->stmt_da->is_eof())
net_end_statement(thd);
query_cache_end_of_result(thd);
@ -2862,7 +2877,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
thd->query_name_consts= 0;
if (!thd->is_error())
thd->main_da.reset_diagnostics_area();
thd->stmt_da->reset_diagnostics_area();
}
DBUG_RETURN(res || thd->is_error());
}
@ -3238,7 +3253,7 @@ sp_instr_hpush_jump::execute(THD *thd, uint *nextp)
sp_cond_type_t *p;
while ((p= li++))
thd->spcont->push_handler(p, m_ip+1, m_type, m_frame);
thd->spcont->push_handler(p, m_ip+1, m_type);
*nextp= m_dest;
DBUG_RETURN(0);

View file

@ -51,7 +51,8 @@ sp_cond_check(LEX_STRING *sqlstate)
(c < 'A' || 'Z' < c))
return FALSE;
}
if (strcmp(sqlstate->str, "00000") == 0)
/* SQLSTATE class '00' : completion condition */
if (strncmp(sqlstate->str, "00", 2) == 0)
return FALSE;
return TRUE;
}

Some files were not shown because too many files have changed in this diff Show more