mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Merge with dynamic column code
This commit is contained in:
commit
f09f1c7c7d
81 changed files with 8049 additions and 733 deletions
|
@ -6696,6 +6696,7 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
|
|||
my_bool *is_null;
|
||||
ulong *length;
|
||||
uint i;
|
||||
int error;
|
||||
|
||||
/* Allocate array with bind structs, lengths and NULL flags */
|
||||
my_bind= (MYSQL_BIND*) my_malloc(num_fields * sizeof(MYSQL_BIND),
|
||||
|
@ -6723,7 +6724,7 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
|
|||
die("mysql_stmt_bind_result failed: %d: %s",
|
||||
mysql_stmt_errno(stmt), mysql_stmt_error(stmt));
|
||||
|
||||
while (mysql_stmt_fetch(stmt) == 0)
|
||||
while ((error=mysql_stmt_fetch(stmt)) == 0)
|
||||
{
|
||||
for (i= 0; i < num_fields; i++)
|
||||
append_field(ds, i, &fields[i], (char*)my_bind[i].buffer,
|
||||
|
@ -6732,8 +6733,11 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
|
|||
dynstr_append_mem(ds, "\n", 1);
|
||||
}
|
||||
|
||||
if (error != MYSQL_NO_DATA)
|
||||
die("mysql_fetch didn't end with MYSQL_NO_DATA from statement: error: %d",
|
||||
error);
|
||||
if (mysql_stmt_fetch(stmt) != MYSQL_NO_DATA)
|
||||
die("fetch didn't end with MYSQL_NO_DATA from statement: %d %s",
|
||||
die("mysql_fetch didn't end with MYSQL_NO_DATA from statement: %d %s",
|
||||
mysql_stmt_errno(stmt), mysql_stmt_error(stmt));
|
||||
|
||||
for (i= 0; i < num_fields; i++)
|
||||
|
|
|
@ -30,6 +30,7 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
|
|||
my_getopt.h sslopt-longopts.h my_dir.h \
|
||||
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
|
||||
m_ctype.h my_attribute.h my_compiler.h \
|
||||
my_decimal_limits.h ma_dyncol.h \
|
||||
$(HEADERS_GEN_CONFIGURE) \
|
||||
$(HEADERS_GEN_MAKE)
|
||||
|
||||
|
|
|
@ -29,17 +29,17 @@ typedef struct st_decimal_t {
|
|||
|
||||
int internal_str2dec(const char *from, decimal_t *to, char **end,
|
||||
my_bool fixed);
|
||||
int decimal2string(decimal_t *from, char *to, int *to_len,
|
||||
int decimal2string(const decimal_t *from, char *to, int *to_len,
|
||||
int fixed_precision, int fixed_decimals,
|
||||
char filler);
|
||||
int decimal2ulonglong(decimal_t *from, ulonglong *to);
|
||||
int decimal2ulonglong(const decimal_t *from, ulonglong *to);
|
||||
int ulonglong2decimal(ulonglong from, decimal_t *to);
|
||||
int decimal2longlong(decimal_t *from, longlong *to);
|
||||
int decimal2longlong(const decimal_t *from, longlong *to);
|
||||
int longlong2decimal(longlong from, decimal_t *to);
|
||||
int decimal2double(decimal_t *from, double *to);
|
||||
int decimal2double(const decimal_t *from, double *to);
|
||||
int double2decimal(double from, decimal_t *to);
|
||||
int decimal_actual_fraction(decimal_t *from);
|
||||
int decimal2bin(decimal_t *from, uchar *to, int precision, int scale);
|
||||
int decimal2bin(const decimal_t *from, uchar *to, int precision, int scale);
|
||||
int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale);
|
||||
|
||||
int decimal_size(int precision, int scale);
|
||||
|
@ -55,7 +55,7 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to);
|
|||
int decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to,
|
||||
int scale_incr);
|
||||
int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to);
|
||||
int decimal_round(decimal_t *from, decimal_t *to, int new_scale,
|
||||
int decimal_round(const decimal_t *from, decimal_t *to, int new_scale,
|
||||
decimal_round_mode mode);
|
||||
int decimal_is_zero(decimal_t *from);
|
||||
void max_decimal(int precision, int frac, decimal_t *to);
|
||||
|
|
147
include/ma_dyncol.h
Normal file
147
include/ma_dyncol.h
Normal file
|
@ -0,0 +1,147 @@
|
|||
/* Copyright (c) 2011, Monty Program Ab
|
||||
Copyright (c) 2011, Oleksandr Byelkin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef ma_dyncol_h
|
||||
#define ma_dyncol_h
|
||||
|
||||
#include <decimal.h>
|
||||
#include <my_decimal_limits.h>
|
||||
#include <mysql_time.h>
|
||||
|
||||
/*
|
||||
Max length for data in a dynamic colums. This comes from how the
|
||||
how the offset are stored.
|
||||
*/
|
||||
#define MAX_DYNAMIC_COLUMN_LENGTH 0X1FFFFFFFL
|
||||
|
||||
/* NO and OK is the same used just to show semantics */
|
||||
#define ER_DYNCOL_NO ER_DYNCOL_OK
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
{
|
||||
ER_DYNCOL_OK= 0,
|
||||
ER_DYNCOL_YES= 1, /* For functions returning 0/1 */
|
||||
ER_DYNCOL_FORMAT= -1, /* Wrong format of the encoded string */
|
||||
ER_DYNCOL_LIMIT= -2, /* Some limit reached */
|
||||
ER_DYNCOL_RESOURCE= -3, /* Out of resourses */
|
||||
ER_DYNCOL_DATA= -4, /* Incorrect input data */
|
||||
ER_DYNCOL_UNKNOWN_CHARSET= -5 /* Unknown character set */
|
||||
};
|
||||
|
||||
typedef DYNAMIC_STRING DYNAMIC_COLUMN;
|
||||
|
||||
enum enum_dynamic_column_type
|
||||
{
|
||||
DYN_COL_NULL= 0,
|
||||
DYN_COL_INT,
|
||||
DYN_COL_UINT,
|
||||
DYN_COL_DOUBLE,
|
||||
DYN_COL_STRING,
|
||||
DYN_COL_DECIMAL,
|
||||
DYN_COL_DATETIME,
|
||||
DYN_COL_DATE,
|
||||
DYN_COL_TIME
|
||||
};
|
||||
|
||||
typedef enum enum_dynamic_column_type DYNAMIC_COLUMN_TYPE;
|
||||
|
||||
struct st_dynamic_column_value
|
||||
{
|
||||
DYNAMIC_COLUMN_TYPE type;
|
||||
union
|
||||
{
|
||||
long long long_value;
|
||||
unsigned long long ulong_value;
|
||||
double double_value;
|
||||
struct {
|
||||
LEX_STRING string_value;
|
||||
CHARSET_INFO *charset;
|
||||
};
|
||||
struct {
|
||||
decimal_digit_t decimal_buffer[DECIMAL_BUFF_LENGTH];
|
||||
decimal_t decimal_value;
|
||||
};
|
||||
MYSQL_TIME time_value;
|
||||
};
|
||||
};
|
||||
|
||||
typedef struct st_dynamic_column_value DYNAMIC_COLUMN_VALUE;
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_create(DYNAMIC_COLUMN *str,
|
||||
uint column_nr, DYNAMIC_COLUMN_VALUE *value);
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_create_many(DYNAMIC_COLUMN *str,
|
||||
uint column_count,
|
||||
uint *column_numbers,
|
||||
DYNAMIC_COLUMN_VALUE *values);
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_update(DYNAMIC_COLUMN *org, uint column_nr,
|
||||
DYNAMIC_COLUMN_VALUE *value);
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_update_many(DYNAMIC_COLUMN *str,
|
||||
uint add_column_count,
|
||||
uint *column_numbers,
|
||||
DYNAMIC_COLUMN_VALUE *values);
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_delete(DYNAMIC_COLUMN *org, uint column_nr);
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_exists(DYNAMIC_COLUMN *org, uint column_nr);
|
||||
|
||||
/* List of not NULL columns */
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_list(DYNAMIC_COLUMN *org, DYNAMIC_ARRAY *array_of_uint);
|
||||
|
||||
/*
|
||||
if the column do not exists it is NULL
|
||||
*/
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_get(DYNAMIC_COLUMN *org, uint column_nr,
|
||||
DYNAMIC_COLUMN_VALUE *store_it_here);
|
||||
|
||||
#define dynamic_column_initialize(A) memset((A), 0, sizeof(*(A)))
|
||||
#define dynamic_column_column_free(V) dynstr_free(V)
|
||||
|
||||
/***************************************************************************
|
||||
Internal functions, don't use if you don't know what you are doing...
|
||||
***************************************************************************/
|
||||
|
||||
#define dynamic_column_reassociate(V,P,L, A) dynstr_reassociate((V),(P),(L),(A))
|
||||
|
||||
#define dynamic_column_value_init(V) (V)->type= DYN_COL_NULL
|
||||
|
||||
/*
|
||||
Prepare value for using as decimal
|
||||
*/
|
||||
void dynamic_column_prepare_decimal(DYNAMIC_COLUMN_VALUE *value);
|
||||
|
||||
#endif
|
31
include/my_decimal_limits.h
Normal file
31
include/my_decimal_limits.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#ifndef my_decimal_limits_h
|
||||
#define my_decimal_limits_h
|
||||
|
||||
#define DECIMAL_LONGLONG_DIGITS 22
|
||||
#define DECIMAL_LONG_DIGITS 10
|
||||
#define DECIMAL_LONG3_DIGITS 8
|
||||
|
||||
/** maximum length of buffer in our big digits (uint32). */
|
||||
#define DECIMAL_BUFF_LENGTH 9
|
||||
|
||||
/* the number of digits that my_decimal can possibly contain */
|
||||
#define DECIMAL_MAX_POSSIBLE_PRECISION (DECIMAL_BUFF_LENGTH * 9)
|
||||
|
||||
|
||||
/**
|
||||
maximum guaranteed precision of number in decimal digits (number of our
|
||||
digits * number of decimal digits in one our big digit - number of decimal
|
||||
digits in one our big digit decreased by 1 (because we always put decimal
|
||||
point on the border of our big digits))
|
||||
*/
|
||||
#define DECIMAL_MAX_PRECISION (DECIMAL_MAX_POSSIBLE_PRECISION - 8*2)
|
||||
#define DECIMAL_MAX_SCALE 30
|
||||
#define DECIMAL_NOT_SPECIFIED 31
|
||||
|
||||
/**
|
||||
maximum length of string representation (number of maximum decimal
|
||||
digits + 1 position for sign + 1 position for decimal point)
|
||||
*/
|
||||
#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_POSSIBLE_PRECISION + 2)
|
||||
|
||||
#endif
|
|
@ -863,6 +863,8 @@ extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
|
|||
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size);
|
||||
extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
|
||||
extern void dynstr_free(DYNAMIC_STRING *str);
|
||||
extern void dynstr_reassociate(DYNAMIC_STRING *str, char **res, size_t *length,
|
||||
size_t *alloc_length);
|
||||
#ifdef HAVE_MLOCK
|
||||
extern void *my_malloc_lock(size_t length,myf flags);
|
||||
extern void my_free_lock(void *ptr,myf flags);
|
||||
|
|
|
@ -85,6 +85,7 @@ typedef long my_time_t;
|
|||
TIME_MAX_SECOND)
|
||||
#define TIME_MAX_VALUE_SECONDS (TIME_MAX_HOUR * 3600L + \
|
||||
TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND)
|
||||
#define TIME_SUBSECOND_RANGE 1000000
|
||||
|
||||
my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
|
||||
ulong flags, int *was_cut);
|
||||
|
@ -93,6 +94,8 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
|
|||
uint flags, int *was_cut);
|
||||
longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
|
||||
uint flags, int *was_cut);
|
||||
my_bool double_to_datetime(double nr, MYSQL_TIME *time_res,
|
||||
uint flags);
|
||||
ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *);
|
||||
ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *);
|
||||
ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *);
|
||||
|
@ -100,7 +103,7 @@ ulonglong TIME_to_ulonglong(const MYSQL_TIME *);
|
|||
|
||||
|
||||
my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time,
|
||||
int *warning);
|
||||
ulong flag,int *warning);
|
||||
|
||||
int check_time_range(struct st_mysql_time *, int *warning);
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
|
|||
../strings/ctype-simple.c ../strings/ctype-sjis.c ../strings/ctype-tis620.c
|
||||
../strings/ctype-uca.c ../strings/ctype-ucs2.c ../strings/ctype-ujis.c
|
||||
../strings/ctype-utf8.c ../strings/ctype-win1250ch.c ../strings/ctype.c
|
||||
../strings/decimal.c
|
||||
../mysys/default.c errmsg.c ../mysys/errors.c ../mysys/my_sync.c
|
||||
../mysys/hash.c ../mysys/my_sleep.c ../mysys/default_modify.c
|
||||
get_password.c ../strings/int2str.c ../strings/is_prefix.c
|
||||
|
@ -85,6 +86,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
|
|||
../mysys/my_open.c ../mysys/my_pread.c ../mysys/my_pthread.c ../mysys/my_read.c
|
||||
../mysys/my_realloc.c ../mysys/my_rename.c ../mysys/my_seek.c
|
||||
../mysys/my_static.c ../strings/my_strtoll10.c ../mysys/my_symlink.c
|
||||
../mysys/ma_dyncol.c
|
||||
../mysys/my_symlink2.c ../mysys/my_thr_init.c ../sql-common/my_time.c
|
||||
../strings/my_vsnprintf.c ../mysys/my_wincond.c ../mysys/my_winthread.c
|
||||
../mysys/my_write.c ../sql/net_serv.cc ../sql-common/pack.c ../sql/password.c
|
||||
|
|
|
@ -48,7 +48,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
|
|||
ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo \
|
||||
ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo \
|
||||
ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo \
|
||||
strmov_overlapp.lo
|
||||
strmov_overlapp.lo decimal.lo
|
||||
|
||||
mystringsextra= strto.c
|
||||
mystringsheaders= strings_def.h
|
||||
|
@ -65,7 +65,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
|
|||
my_symlink.lo my_fstream.lo mf_arr_appstr.lo \
|
||||
mf_loadpath.lo my_pthread.lo my_thr_init.lo \
|
||||
thr_mutex.lo mulalloc.lo string.lo \
|
||||
default.lo default_modify.lo \
|
||||
default.lo default_modify.lo ma_dyncol.lo \
|
||||
my_compress.lo array.lo my_once.lo list.lo my_net.lo \
|
||||
charset.lo charset-def.lo hash.lo mf_iocache.lo \
|
||||
mf_iocache2.lo my_seek.lo my_sleep.lo \
|
||||
|
|
|
@ -3549,7 +3549,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
|
|||
case MYSQL_TYPE_TIME:
|
||||
{
|
||||
MYSQL_TIME *tm= (MYSQL_TIME *)buffer;
|
||||
str_to_time(value, length, tm, &err);
|
||||
str_to_time(value, length, tm, TIME_FUZZY_DATE, &err);
|
||||
*param->error= test(err);
|
||||
break;
|
||||
}
|
||||
|
@ -4381,7 +4381,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
|
|||
field->max_length= MAX_DOUBLE_STRING_REP_LENGTH;
|
||||
break;
|
||||
case MYSQL_TYPE_TIME:
|
||||
field->max_length= 15; /* 19:23:48.123456 */
|
||||
field->max_length= 17; /* -819:23:48.123456 */
|
||||
param->skip_result= skip_result_with_length;
|
||||
break;
|
||||
case MYSQL_TYPE_DATE:
|
||||
|
|
|
@ -362,12 +362,12 @@ select cast(19999999999999999999 as signed);
|
|||
cast(19999999999999999999 as signed)
|
||||
9223372036854775807
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '19999999999999999999' to INT. Value truncated.
|
||||
select cast(-19999999999999999999 as signed);
|
||||
cast(-19999999999999999999 as signed)
|
||||
-9223372036854775808
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '-19999999999999999999' to INT. Value truncated.
|
||||
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
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
select CAST(1-2 AS UNSIGNED);
|
||||
CAST(1-2 AS UNSIGNED)
|
||||
18446744073709551615
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER);
|
||||
CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER)
|
||||
-1
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select CAST('10 ' as unsigned integer);
|
||||
CAST('10 ' as unsigned integer)
|
||||
10
|
||||
|
@ -12,9 +16,15 @@ Warning 1292 Truncated incorrect INTEGER value: '10 '
|
|||
select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1;
|
||||
cast(-5 as unsigned) | 1 cast(-5 as unsigned) & -1
|
||||
18446744073709551611 18446744073709551611
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1;
|
||||
cast(-5 as unsigned) -1 cast(-5 as unsigned) + 1
|
||||
18446744073709551610 18446744073709551612
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select ~5, cast(~5 as signed);
|
||||
~5 cast(~5 as signed)
|
||||
18446744073709551610 -6
|
||||
|
@ -23,12 +33,60 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
|||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)`
|
||||
select cast(18446744073709551615 as signed);
|
||||
cast(18446744073709551615 as signed)
|
||||
-1
|
||||
select cast(5 as unsigned) -6.0;
|
||||
cast(5 as unsigned) -6.0
|
||||
-1.0
|
||||
select cast(NULL as signed), cast(1/0 as signed);
|
||||
cast(NULL as signed) cast(1/0 as signed)
|
||||
NULL NULL
|
||||
select cast(1 as double(5,2));
|
||||
cast(1 as double(5,2))
|
||||
1.00
|
||||
select cast("5.2222" as double(5,2));
|
||||
cast("5.2222" as double(5,2))
|
||||
5.22
|
||||
select cast(12.444 as double(5,2));
|
||||
cast(12.444 as double(5,2))
|
||||
12.44
|
||||
select cast(cast(12.444 as decimal(10,3)) as double(5,2));
|
||||
cast(cast(12.444 as decimal(10,3)) as double(5,2))
|
||||
12.44
|
||||
select cast(null as double(5,2));
|
||||
cast(null as double(5,2))
|
||||
NULL
|
||||
select cast(12.444 as double);
|
||||
cast(12.444 as double)
|
||||
12.444
|
||||
select cast(cast("20:01:01" as time) as datetime);
|
||||
cast(cast("20:01:01" as time) as datetime)
|
||||
0000-00-00 20:01:01
|
||||
select cast(cast("8:46:06.23434" AS time) as decimal(32,10));
|
||||
cast(cast("8:46:06.23434" AS time) as decimal(32,10))
|
||||
84606.2343400000
|
||||
select cast(cast(20010203101112.121314 as double) as datetime);
|
||||
cast(cast(20010203101112.121314 as double) as datetime)
|
||||
2001-02-03 10:11:12.125000
|
||||
select cast(cast(010203101112.12 as double) as datetime);
|
||||
cast(cast(010203101112.12 as double) as datetime)
|
||||
2001-02-03 10:11:12.120000
|
||||
select cast(cast(20010203101112.121314 as decimal(32,6)) as datetime);
|
||||
cast(cast(20010203101112.121314 as decimal(32,6)) as datetime)
|
||||
2001-02-03 10:11:12.121314
|
||||
select cast(20010203101112.121314 as datetime);
|
||||
cast(20010203101112.121314 as datetime)
|
||||
2001-02-03 10:11:12.121314
|
||||
select cast(110203101112.121314 as datetime);
|
||||
cast(110203101112.121314 as datetime)
|
||||
2011-02-03 10:11:12.121314
|
||||
select cast(cast(010203101112.12 as double) as datetime);
|
||||
cast(cast(010203101112.12 as double) as datetime)
|
||||
2001-02-03 10:11:12.120000
|
||||
select cast(cast("2011-04-05 8:46:06.23434" AS datetime) as time);
|
||||
cast(cast("2011-04-05 8:46:06.23434" AS datetime) as time)
|
||||
08:46:06.234340
|
||||
select cast(NULL as unsigned), cast(1/0 as unsigned);
|
||||
cast(NULL as unsigned) cast(1/0 as unsigned)
|
||||
NULL NULL
|
||||
|
@ -111,6 +169,115 @@ select 10E+0+'a';
|
|||
10
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'a'
|
||||
select cast("a" as double(5,2));
|
||||
cast("a" as double(5,2))
|
||||
0.00
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'a'
|
||||
select cast(1000 as decimal(5,2));
|
||||
cast(1000 as decimal(5,2))
|
||||
999.99
|
||||
Warnings:
|
||||
Error 1264 Out of range value for column 'cast(1000 as decimal(5,2))' at row 1
|
||||
select cast(-1000 as decimal(5,2));
|
||||
cast(-1000 as decimal(5,2))
|
||||
-999.99
|
||||
Warnings:
|
||||
Error 1264 Out of range value for column 'cast(-1000 as decimal(5,2))' at row 1
|
||||
select cast(1000 as double(5,2));
|
||||
cast(1000 as double(5,2))
|
||||
999.99
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'cast(1000 as double(5,2))' at row 1
|
||||
select cast(-1000 as double(5,2));
|
||||
cast(-1000 as double(5,2))
|
||||
-999.99
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'cast(-1000 as double(5,2))' at row 1
|
||||
select cast(010203101112.121314 as datetime);
|
||||
cast(010203101112.121314 as datetime)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '10203101112.121314'
|
||||
select cast(120010203101112.121314 as datetime);
|
||||
cast(120010203101112.121314 as datetime)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '120010203101112.121314'
|
||||
select cast(cast(1.1 as decimal) as datetime);
|
||||
cast(cast(1.1 as decimal) as datetime)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '1'
|
||||
select cast(cast(-1.1 as decimal) as datetime);
|
||||
cast(cast(-1.1 as decimal) as datetime)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '-1'
|
||||
select cast('0' as date);
|
||||
cast('0' as date)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '0'
|
||||
select cast('' as date);
|
||||
cast('' as date)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: ''
|
||||
select cast('0' as datetime);
|
||||
cast('0' as datetime)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '0'
|
||||
select cast('' as datetime);
|
||||
cast('' as datetime)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: ''
|
||||
select cast('0' as time);
|
||||
cast('0' as time)
|
||||
00:00:00
|
||||
select cast('' as time);
|
||||
cast('' as time)
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: ''
|
||||
select cast(NULL as DATE);
|
||||
cast(NULL as DATE)
|
||||
NULL
|
||||
select cast(NULL as DATETIME);
|
||||
cast(NULL as DATETIME)
|
||||
NULL
|
||||
select cast(NULL as TIME);
|
||||
cast(NULL as TIME)
|
||||
NULL
|
||||
select cast(NULL as BINARY);
|
||||
cast(NULL as BINARY)
|
||||
NULL
|
||||
select cast(cast(120010203101112.121314 as double) as datetime);
|
||||
cast(cast(120010203101112.121314 as double) as datetime)
|
||||
NULL
|
||||
select cast(cast(1.1 as double) as datetime);
|
||||
cast(cast(1.1 as double) as datetime)
|
||||
NULL
|
||||
select cast(cast(-1.1 as double) as datetime);
|
||||
cast(cast(-1.1 as double) as datetime)
|
||||
NULL
|
||||
explain extended select cast(10 as double(5,2));
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select cast(10 as double(5,2)) AS `cast(10 as double(5,2))`
|
||||
explain extended select cast(10 as double);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select cast(10 as double) AS `cast(10 as double)`
|
||||
explain extended select cast(10 as decimal(5,2));
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select cast(10 as decimal(5,2)) AS `cast(10 as decimal(5,2))`
|
||||
select cast('18446744073709551616' as unsigned);
|
||||
cast('18446744073709551616' as unsigned)
|
||||
18446744073709551615
|
||||
|
@ -146,6 +313,18 @@ cast('' as signed)
|
|||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: ''
|
||||
select cast(1 as double(5,6));
|
||||
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '').
|
||||
select cast(1 as decimal(5,6));
|
||||
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '').
|
||||
select cast(1 as double(66,6));
|
||||
ERROR 42000: Too big precision 66 specified for column '1'. Maximum is 65.
|
||||
select cast(1 as decimal(66,6));
|
||||
ERROR 42000: Too big precision 66 specified for column '1'. Maximum is 65.
|
||||
select cast(1 as decimal(64,63));
|
||||
ERROR 42000: Too big scale 63 specified for column '1'. Maximum is 30.
|
||||
select cast(1 as double(64,63));
|
||||
ERROR 42000: Too big scale 63 specified for column '1'. Maximum is 30.
|
||||
set names binary;
|
||||
select cast(_latin1'test' as char character set latin2);
|
||||
cast(_latin1'test' as char character set latin2)
|
||||
|
@ -255,12 +434,6 @@ cast("2001-1-1" as datetime) = "2001-01-01 00:00:00"
|
|||
select cast("1:2:3" as TIME) = "1:02:03";
|
||||
cast("1:2:3" as TIME) = "1:02:03"
|
||||
0
|
||||
select cast(NULL as DATE);
|
||||
cast(NULL as DATE)
|
||||
NULL
|
||||
select cast(NULL as BINARY);
|
||||
cast(NULL as BINARY)
|
||||
NULL
|
||||
CREATE TABLE t1 (a enum ('aac','aab','aaa') not null);
|
||||
INSERT INTO t1 VALUES ('aaa'),('aab'),('aac');
|
||||
SELECT a, CAST(a AS CHAR) FROM t1 ORDER BY CAST(a AS UNSIGNED) ;
|
||||
|
@ -337,6 +510,21 @@ Warning 1105 Cast to signed converted positive out-of-range integer to it's nega
|
|||
select cast(1.0e+300 as signed int);
|
||||
cast(1.0e+300 as signed int)
|
||||
9223372036854775807
|
||||
create table t1 select cast(1 as unsigned), cast(1 as signed), cast(1 as double(5,2)), cast(1 as decimal(5,3)), cast("A" as binary), cast("A" as char(100)), cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME), cast("1:2:3" as TIME);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`cast(1 as unsigned)` int(1) unsigned NOT NULL DEFAULT '0',
|
||||
`cast(1 as signed)` int(1) NOT NULL DEFAULT '0',
|
||||
`cast(1 as double(5,2))` double(5,2) DEFAULT NULL,
|
||||
`cast(1 as decimal(5,3))` decimal(5,3) NOT NULL DEFAULT '0.000',
|
||||
`cast("A" as binary)` varbinary(1) NOT NULL DEFAULT '',
|
||||
`cast("A" as char(100))` varbinary(100) NOT NULL DEFAULT '',
|
||||
`cast("2001-1-1" as DATE)` date DEFAULT NULL,
|
||||
`cast("2001-1-1" as DATETIME)` datetime DEFAULT NULL,
|
||||
`cast("1:2:3" as TIME)` time DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (f1 double);
|
||||
INSERT INTO t1 SET f1 = -1.0e+30 ;
|
||||
INSERT INTO t1 SET f1 = +1.0e+30 ;
|
||||
|
|
1265
mysql-test/r/dyncol.result
Normal file
1265
mysql-test/r/dyncol.result
Normal file
File diff suppressed because it is too large
Load diff
|
@ -285,33 +285,55 @@ set names default;
|
|||
select cast(-2 as unsigned), 18446744073709551614, -2;
|
||||
cast(-2 as unsigned) 18446744073709551614 -2
|
||||
18446744073709551614 18446744073709551614 -2
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select abs(cast(-2 as unsigned)), abs(18446744073709551614), abs(-2);
|
||||
abs(cast(-2 as unsigned)) abs(18446744073709551614) abs(-2)
|
||||
18446744073709551614 18446744073709551614 2
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select ceiling(cast(-2 as unsigned)), ceiling(18446744073709551614), ceiling(-2);
|
||||
ceiling(cast(-2 as unsigned)) ceiling(18446744073709551614) ceiling(-2)
|
||||
18446744073709551614 18446744073709551614 -2
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select floor(cast(-2 as unsigned)), floor(18446744073709551614), floor(-2);
|
||||
floor(cast(-2 as unsigned)) floor(18446744073709551614) floor(-2)
|
||||
18446744073709551614 18446744073709551614 -2
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select format(cast(-2 as unsigned), 2), format(18446744073709551614, 2), format(-2, 2);
|
||||
format(cast(-2 as unsigned), 2) format(18446744073709551614, 2) format(-2, 2)
|
||||
18,446,744,073,709,551,614.00 18,446,744,073,709,551,614.00 -2.00
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select sqrt(cast(-2 as unsigned)), sqrt(18446744073709551614), sqrt(-2);
|
||||
sqrt(cast(-2 as unsigned)) sqrt(18446744073709551614) sqrt(-2)
|
||||
4294967296 4294967296 NULL
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select round(cast(-2 as unsigned), 1), round(18446744073709551614, 1), round(-2, 1);
|
||||
round(cast(-2 as unsigned), 1) round(18446744073709551614, 1) round(-2, 1)
|
||||
18446744073709551614 18446744073709551614 -2
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select round(4, cast(-2 as unsigned)), round(4, 18446744073709551614), round(4, -2);
|
||||
round(4, cast(-2 as unsigned)) round(4, 18446744073709551614) round(4, -2)
|
||||
4 4 0
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select truncate(cast(-2 as unsigned), 1), truncate(18446744073709551614, 1), truncate(-2, 1);
|
||||
truncate(cast(-2 as unsigned), 1) truncate(18446744073709551614, 1) truncate(-2, 1)
|
||||
18446744073709551614 18446744073709551614 -2
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select truncate(4, cast(-2 as unsigned)), truncate(4, 18446744073709551614), truncate(4, -2);
|
||||
truncate(4, cast(-2 as unsigned)) truncate(4, 18446744073709551614) truncate(4, -2)
|
||||
4 4 0
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select round(10000000000000000000, -19), truncate(10000000000000000000, -19);
|
||||
round(10000000000000000000, -19) truncate(10000000000000000000, -19)
|
||||
10000000000000000000 10000000000000000000
|
||||
|
@ -363,12 +385,18 @@ round(4, -4294967200) truncate(4, -4294967200)
|
|||
select mod(cast(-2 as unsigned), 3), mod(18446744073709551614, 3), mod(-2, 3);
|
||||
mod(cast(-2 as unsigned), 3) mod(18446744073709551614, 3) mod(-2, 3)
|
||||
2 2 -2
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select mod(5, cast(-2 as unsigned)), mod(5, 18446744073709551614), mod(5, -2);
|
||||
mod(5, cast(-2 as unsigned)) mod(5, 18446744073709551614) mod(5, -2)
|
||||
5 5 1
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
|
||||
pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5)
|
||||
2.13598703592091e+96 2.13598703592091e+96 -32
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1));
|
||||
INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0);
|
||||
SELECT a DIV 900 y FROM t1 GROUP BY y;
|
||||
|
@ -488,7 +516,7 @@ SELECT -9999999999999999991 DIV -1;
|
|||
-9999999999999999991 DIV -1
|
||||
-9223372036854775808
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '-9999999999999999991' to INT. Value truncated.
|
||||
SELECT -9223372036854775808 DIV -1;
|
||||
-9223372036854775808 DIV -1
|
||||
-9223372036854775808
|
||||
|
|
|
@ -1533,7 +1533,7 @@ select locate('lo','hello',-18446744073709551615);
|
|||
locate('lo','hello',-18446744073709551615)
|
||||
0
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select locate('lo','hello',18446744073709551616);
|
||||
locate('lo','hello',18446744073709551616)
|
||||
0
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
select locate('lo','hello',-18446744073709551617);
|
||||
locate('lo','hello',-18446744073709551617)
|
||||
0
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select locate('lo','hello',18446744073709551617);
|
||||
locate('lo','hello',18446744073709551617)
|
||||
0
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select left('hello', 18446744073709551616);
|
||||
left('hello', 18446744073709551616)
|
||||
hello
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
select left('hello', -18446744073709551617);
|
||||
left('hello', -18446744073709551617)
|
||||
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select left('hello', 18446744073709551617);
|
||||
left('hello', 18446744073709551617)
|
||||
hello
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select right('hello', 18446744073709551616);
|
||||
right('hello', 18446744073709551616)
|
||||
hello
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
select right('hello', -18446744073709551617);
|
||||
right('hello', -18446744073709551617)
|
||||
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select right('hello', 18446744073709551617);
|
||||
right('hello', 18446744073709551617)
|
||||
hello
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select substring('hello', 18446744073709551616, 1);
|
||||
substring('hello', 18446744073709551616, 1)
|
||||
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
select substring('hello', -18446744073709551617, 1);
|
||||
substring('hello', -18446744073709551617, 1)
|
||||
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select substring('hello', 18446744073709551617, 1);
|
||||
substring('hello', 18446744073709551617, 1)
|
||||
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select substring('hello', 1, 18446744073709551616);
|
||||
substring('hello', 1, 18446744073709551616)
|
||||
hello
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
select substring('hello', 1, -18446744073709551617);
|
||||
substring('hello', 1, -18446744073709551617)
|
||||
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select substring('hello', 1, 18446744073709551617);
|
||||
substring('hello', 1, 18446744073709551617)
|
||||
hello
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select insert('hello', 18446744073709551616, 1, 'hi');
|
||||
insert('hello', 18446744073709551616, 1, 'hi')
|
||||
hello
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
select insert('hello', -18446744073709551617, 1, 'hi');
|
||||
insert('hello', -18446744073709551617, 1, 'hi')
|
||||
hello
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select insert('hello', 18446744073709551617, 1, 'hi');
|
||||
insert('hello', 18446744073709551617, 1, 'hi')
|
||||
hello
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select insert('hello', 1, 18446744073709551616, 'hi');
|
||||
insert('hello', 1, 18446744073709551616, 'hi')
|
||||
hi
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
select insert('hello', 1, -18446744073709551617, 'hi');
|
||||
insert('hello', 1, -18446744073709551617, 'hi')
|
||||
hi
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select insert('hello', 1, 18446744073709551617, 'hi');
|
||||
insert('hello', 1, 18446744073709551617, 'hi')
|
||||
hi
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select repeat('hello', 18446744073709551616);
|
||||
repeat('hello', 18446744073709551616)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select repeat('hello', 18446744073709551617);
|
||||
repeat('hello', 18446744073709551617)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select space(18446744073709551616);
|
||||
space(18446744073709551616)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select space(18446744073709551617);
|
||||
space(18446744073709551617)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select rpad('hello', 18446744073709551616, '1');
|
||||
rpad('hello', 18446744073709551616, '1')
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select rpad('hello', 18446744073709551617, '1');
|
||||
rpad('hello', 18446744073709551617, '1')
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551615' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551616' to INT. Value truncated.
|
||||
select lpad('hello', 18446744073709551616, '1');
|
||||
lpad('hello', 18446744073709551616, '1')
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551616' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-18446744073709551617' to INT. Value truncated.
|
||||
select lpad('hello', 18446744073709551617, '1');
|
||||
lpad('hello', 18446744073709551617, '1')
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '18446744073709551617' to INT. Value truncated.
|
||||
Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated
|
||||
SET @orig_sql_mode = @@SQL_MODE;
|
||||
SET SQL_MODE=traditional;
|
||||
|
|
|
@ -1014,6 +1014,7 @@ SELECT MAKETIME(CAST(-1 AS UNSIGNED), 0, 0);
|
|||
MAKETIME(CAST(-1 AS UNSIGNED), 0, 0)
|
||||
838:59:59
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
Warning 1292 Truncated incorrect time value: '18446744073709551615:00:00'
|
||||
SELECT EXTRACT(HOUR FROM '100000:02:03');
|
||||
EXTRACT(HOUR FROM '100000:02:03')
|
||||
|
@ -1033,6 +1034,7 @@ SELECT SEC_TO_TIME(CAST(-1 AS UNSIGNED));
|
|||
SEC_TO_TIME(CAST(-1 AS UNSIGNED))
|
||||
838:59:59
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
Warning 1292 Truncated incorrect time value: '18446744073709551615'
|
||||
SET NAMES latin1;
|
||||
SET character_set_results = NULL;
|
||||
|
|
|
@ -371,7 +371,7 @@ EXPLAIN
|
|||
SELECT * FROM City
|
||||
WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE City range Population,Country,Name Name 35 NULL # Using index condition; Using where; Rowid-ordered scan
|
||||
1 SIMPLE City range Population,Name,Country Name # NULL # Using index condition; Using where; Rowid-ordered scan
|
||||
SELECT * FROM City USE INDEX ()
|
||||
WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%';
|
||||
ID Name Country Population
|
||||
|
|
|
@ -372,7 +372,7 @@ EXPLAIN
|
|||
SELECT * FROM City
|
||||
WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE City index_merge Population,Country,Name Population,Name,Country 4,35,3 NULL # Using sort_intersect(Population,Name,Country); Using where
|
||||
1 SIMPLE City index_merge Population,Name,Country Population,Name,Country # NULL # Using sort_intersect(Population,Name,Country); Using where
|
||||
SELECT * FROM City USE INDEX ()
|
||||
WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%';
|
||||
ID Name Country Population
|
||||
|
|
|
@ -380,7 +380,7 @@ ERROR 22003: Out of range value for column 'sp_vars_check_ret1()' at row 1
|
|||
SELECT sp_vars_check_ret2();
|
||||
ERROR 22003: Out of range value for column 'sp_vars_check_ret2()' at row 1
|
||||
SELECT sp_vars_check_ret3();
|
||||
ERROR HY000: Incorrect integer value: 'Hello, world' for column 'sp_vars_check_ret3()' at row 1
|
||||
ERROR 22007: Incorrect integer value: 'Hello, world' for column 'sp_vars_check_ret3()' at row 1
|
||||
SELECT sp_vars_check_ret4();
|
||||
sp_vars_check_ret4()
|
||||
154.12
|
||||
|
|
|
@ -260,24 +260,24 @@ INSERT INTO t1 (col2) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
|
|||
INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
|
||||
INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE));
|
||||
INSERT INTO t1 (col1) VALUES(CAST('2004-10-0' AS DATE));
|
||||
ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-0'
|
||||
INSERT INTO t1 (col1) VALUES(CAST('2004-0-10' AS DATE));
|
||||
ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-0-10'
|
||||
INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE));
|
||||
ERROR 22007: Incorrect datetime value: '0000-00-00'
|
||||
INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
|
||||
INSERT INTO t1 (col2) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-0 15:30'
|
||||
INSERT INTO t1 (col2) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-0-10 15:30'
|
||||
INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '0000-00-00'
|
||||
INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
|
||||
INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-0 15:30'
|
||||
INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col3' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-0-10 15:30'
|
||||
INSERT INTO t1 (col3) VALUES(CAST('0000-00-00' AS DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '0000-00-00'
|
||||
drop table t1;
|
||||
|
@ -287,24 +287,26 @@ INSERT INTO t1 (col2) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
|
|||
INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
|
||||
INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE));
|
||||
INSERT INTO t1 (col1) VALUES(CONVERT('2004-10-0' , DATE));
|
||||
ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-0'
|
||||
INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE));
|
||||
ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-0-10'
|
||||
INSERT INTO t1 (col1) VALUES('2004-0-10');
|
||||
ERROR 22007: Incorrect date value: '2004-0-10' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE));
|
||||
ERROR 22007: Incorrect datetime value: '0000-00-00'
|
||||
INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
|
||||
INSERT INTO t1 (col2) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-0 15:30'
|
||||
INSERT INTO t1 (col2) VALUES(CONVERT('2004-0-10 15:30',DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-0-10 15:30'
|
||||
INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '0000-00-00'
|
||||
INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
|
||||
INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-10-0 15:30'
|
||||
INSERT INTO t1 (col3) VALUES(CONVERT('2004-0-10 15:30',DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col3' at row 1
|
||||
ERROR 22007: Incorrect datetime value: '2004-0-10 15:30'
|
||||
INSERT INTO t1 (col3) VALUES(CONVERT('0000-00-00',DATETIME));
|
||||
ERROR 22007: Incorrect datetime value: '0000-00-00'
|
||||
drop table t1;
|
||||
|
@ -364,9 +366,9 @@ Warnings:
|
|||
Error 1365 Division by 0
|
||||
Error 1365 Division by 0
|
||||
INSERT INTO t1 (col1) VALUES ('');
|
||||
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: '' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('a59b');
|
||||
ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: 'a59b' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('1a');
|
||||
ERROR 01000: Data truncated for column 'col1' at row 1
|
||||
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
|
||||
|
@ -447,9 +449,9 @@ ERROR 22012: Division by 0
|
|||
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
|
||||
ERROR 22012: Division by 0
|
||||
INSERT INTO t1 (col1) VALUES ('');
|
||||
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: '' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('a59b');
|
||||
ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: 'a59b' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('1a');
|
||||
ERROR 01000: Data truncated for column 'col1' at row 1
|
||||
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
|
||||
|
@ -531,9 +533,9 @@ ERROR 22012: Division by 0
|
|||
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
|
||||
ERROR 22012: Division by 0
|
||||
INSERT INTO t1 (col1) VALUES ('');
|
||||
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: '' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('a59b');
|
||||
ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: 'a59b' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('1a');
|
||||
ERROR 01000: Data truncated for column 'col1' at row 1
|
||||
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
|
||||
|
@ -615,9 +617,9 @@ ERROR 22012: Division by 0
|
|||
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
|
||||
ERROR 22012: Division by 0
|
||||
INSERT INTO t1 (col1) VALUES ('');
|
||||
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: '' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('a59b');
|
||||
ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: 'a59b' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('1a');
|
||||
ERROR 01000: Data truncated for column 'col1' at row 1
|
||||
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
|
||||
|
@ -697,9 +699,9 @@ ERROR 22012: Division by 0
|
|||
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
|
||||
ERROR 22012: Division by 0
|
||||
INSERT INTO t1 (col1) VALUES ('');
|
||||
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: '' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('a59b');
|
||||
ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: 'a59b' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('1a');
|
||||
ERROR 01000: Data truncated for column 'col1' at row 1
|
||||
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
|
||||
|
@ -776,7 +778,7 @@ ERROR 22003: Out of range value for column 'col1' at row 1
|
|||
INSERT INTO t1 VALUES ('-100E+1');
|
||||
ERROR 22003: Out of range value for column 'col1' at row 1
|
||||
INSERT INTO t1 VALUES ('-100E');
|
||||
ERROR HY000: Incorrect decimal value: '-100E' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect decimal value: '-100E' for column 'col1' at row 1
|
||||
UPDATE t1 SET col1 =col1 * 50000 WHERE col1 =11;
|
||||
ERROR 22003: Out of range value for column 'col1' at row 6
|
||||
UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0;
|
||||
|
@ -784,11 +786,11 @@ ERROR 22012: Division by 0
|
|||
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
|
||||
ERROR 22012: Division by 0
|
||||
INSERT INTO t1 (col1) VALUES ('');
|
||||
ERROR HY000: Incorrect decimal value: '' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect decimal value: '' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('a59b');
|
||||
ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect decimal value: 'a59b' for column 'col1' at row 1
|
||||
INSERT INTO t1 (col1) VALUES ('1a');
|
||||
ERROR HY000: Incorrect decimal value: '1a' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect decimal value: '1a' for column 'col1' at row 1
|
||||
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'col1' at row 1
|
||||
|
@ -1361,34 +1363,34 @@ col5 mediumint, col6 mediumint unsigned,
|
|||
col7 int, col8 int unsigned,
|
||||
col9 bigint, col10 bigint unsigned);
|
||||
insert into t1(col1) values('-');
|
||||
ERROR HY000: Incorrect integer value: '-' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect integer value: '-' for column 'col1' at row 1
|
||||
insert into t1(col2) values('+');
|
||||
ERROR HY000: Incorrect integer value: '+' for column 'col2' at row 1
|
||||
ERROR 22007: Incorrect integer value: '+' for column 'col2' at row 1
|
||||
insert into t1(col3) values('-');
|
||||
ERROR HY000: Incorrect integer value: '-' for column 'col3' at row 1
|
||||
ERROR 22007: Incorrect integer value: '-' for column 'col3' at row 1
|
||||
insert into t1(col4) values('+');
|
||||
ERROR HY000: Incorrect integer value: '+' for column 'col4' at row 1
|
||||
ERROR 22007: Incorrect integer value: '+' for column 'col4' at row 1
|
||||
insert into t1(col5) values('-');
|
||||
ERROR HY000: Incorrect integer value: '-' for column 'col5' at row 1
|
||||
ERROR 22007: Incorrect integer value: '-' for column 'col5' at row 1
|
||||
insert into t1(col6) values('+');
|
||||
ERROR HY000: Incorrect integer value: '+' for column 'col6' at row 1
|
||||
ERROR 22007: Incorrect integer value: '+' for column 'col6' at row 1
|
||||
insert into t1(col7) values('-');
|
||||
ERROR HY000: Incorrect integer value: '-' for column 'col7' at row 1
|
||||
ERROR 22007: Incorrect integer value: '-' for column 'col7' at row 1
|
||||
insert into t1(col8) values('+');
|
||||
ERROR HY000: Incorrect integer value: '+' for column 'col8' at row 1
|
||||
ERROR 22007: Incorrect integer value: '+' for column 'col8' at row 1
|
||||
insert into t1(col9) values('-');
|
||||
ERROR HY000: Incorrect integer value: '-' for column 'col9' at row 1
|
||||
ERROR 22007: Incorrect integer value: '-' for column 'col9' at row 1
|
||||
insert into t1(col10) values('+');
|
||||
ERROR HY000: Incorrect integer value: '+' for column 'col10' at row 1
|
||||
ERROR 22007: Incorrect integer value: '+' for column 'col10' at row 1
|
||||
drop table t1;
|
||||
set sql_mode='traditional';
|
||||
create table t1(a year);
|
||||
insert into t1 values ('-');
|
||||
ERROR HY000: Incorrect integer value: '-' for column 'a' at row 1
|
||||
ERROR 22007: Incorrect integer value: '-' for column 'a' at row 1
|
||||
insert into t1 values ('+');
|
||||
ERROR HY000: Incorrect integer value: '+' for column 'a' at row 1
|
||||
ERROR 22007: Incorrect integer value: '+' for column 'a' at row 1
|
||||
insert into t1 values ('');
|
||||
ERROR HY000: Incorrect integer value: '' for column 'a' at row 1
|
||||
ERROR 22007: Incorrect integer value: '' for column 'a' at row 1
|
||||
insert into t1 values ('2000a');
|
||||
ERROR 01000: Data truncated for column 'a' at row 1
|
||||
insert into t1 values ('2E3x');
|
||||
|
|
|
@ -985,3 +985,9 @@ COUNT(*)
|
|||
DROP FUNCTION f1;
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
CREATE TABLE t1 ( f1 blob, f2 blob );
|
||||
INSERT INTO t1 VALUES ('','');
|
||||
SELECT f1,f2,"found row" FROM t1 WHERE f1 = f2 ;
|
||||
f1 f2 found row
|
||||
found row
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -825,7 +825,7 @@ Error 1365 Division by 0
|
|||
Error 1365 Division by 0
|
||||
Error 1365 Division by 0
|
||||
INSERT INTO Sow6_2f VALUES ('a59b');
|
||||
ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1
|
||||
ERROR 22007: Incorrect decimal value: 'a59b' for column 'col1' at row 1
|
||||
drop table Sow6_2f;
|
||||
select 10.3330000000000/12.34500000;
|
||||
10.3330000000000/12.34500000
|
||||
|
@ -838,12 +838,12 @@ select 9999999999999999999999999999999999999999999999999999999999999999999999999
|
|||
x
|
||||
99999999999999999999999999999999999999999999999999999999999999999
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x;
|
||||
x
|
||||
100000000000000000000000000000000000000000000000000000000000000000
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
Error 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
Error 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '19999999999999999999' to UNSIGNED INT. Value truncated.
|
||||
create table t1(a decimal(18));
|
||||
insert into t1 values(123456789012345678);
|
||||
alter table t1 modify column a decimal(19);
|
||||
|
@ -1674,7 +1674,7 @@ CREATE TABLE t1 SELECT
|
|||
/* 82 */ 1000000000000000000000000000000000000000000000000000000000000000000000000000000001
|
||||
AS c1;
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
DESC t1;
|
||||
Field Type Null Key Default Extra
|
||||
c1 decimal(65,0) NO 0
|
||||
|
|
|
@ -324,7 +324,7 @@ select CAST(a AS DECIMAL(13,5)) FROM (SELECT '' as a) t;
|
|||
CAST(a AS DECIMAL(13,5))
|
||||
0.00000
|
||||
Warnings:
|
||||
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||
Error 1659 Encountered illegal value '' when converting to DECIMAL
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
create table t1 (a integer unsigned);
|
||||
insert into t1 values (1),(-1),(0),(-2);
|
||||
|
|
|
@ -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: ''
|
||||
Error 1657 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated.
|
||||
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: ''
|
||||
Error 1657 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated.
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -2450,6 +2450,8 @@ NULL NULL 1
|
|||
8385959 838:59:59 3
|
||||
130000 13:00:00 4
|
||||
100000 10:00:00 5
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
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_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
|
@ -2462,6 +2464,8 @@ NULL NULL 1
|
|||
8385959 838:59:59 3
|
||||
130000 13:00:00 4
|
||||
100000 10:00:00 5
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -2556,7 +2560,9 @@ NULL NULL 1
|
|||
18446744073709551615 -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308'
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308'
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
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 unsigned) AS `CAST(my_double AS UNSIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
|
@ -2571,7 +2577,9 @@ NULL NULL 1
|
|||
18446744073709551615 -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308'
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308'
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -2587,9 +2595,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: ''
|
||||
Error 1657 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-1.000000000000000000000000000000' to UNSIGNED INT. Value truncated.
|
||||
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 +2611,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: ''
|
||||
Error 1657 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to UNSIGNED INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '-1.000000000000000000000000000000' to UNSIGNED INT. Value truncated.
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -2620,6 +2628,9 @@ NULL NULL 1
|
|||
9223372036854775807 9223372036854775807 3
|
||||
0 0 4
|
||||
18446744073709551615 -1 5
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
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_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
|
@ -2632,6 +2643,9 @@ NULL NULL 1
|
|||
9223372036854775807 9223372036854775807 3
|
||||
0 0 4
|
||||
18446744073709551615 -1 5
|
||||
Warnings:
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -2955,8 +2969,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: ''
|
||||
Error 1657 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated.
|
||||
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 +2984,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: ''
|
||||
Error 1657 Got overflow when converting '-9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated.
|
||||
Error 1657 Got overflow when converting '9999999999999999999999999999999999.999999999999999999999999999999' to INT. Value truncated.
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -3282,9 +3296,9 @@ NULL NULL 1
|
|||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 30
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
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 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
Error 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
|
||||
|
@ -3300,9 +3314,9 @@ NULL NULL 1
|
|||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 30
|
||||
Warnings:
|
||||
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
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 1657 Got overflow when converting '' to DECIMAL. Value truncated.
|
||||
Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
|
||||
DROP VIEW v1;
|
||||
|
||||
|
@ -3372,9 +3386,9 @@ NULL NULL 1
|
|||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 29
|
||||
Warnings:
|
||||
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||
Error 1659 Encountered illegal value '' when converting to DECIMAL
|
||||
Error 1659 Encountered illegal value '' when converting to DECIMAL
|
||||
Error 1659 Encountered illegal value '' when converting to DECIMAL
|
||||
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 +3403,9 @@ NULL NULL 1
|
|||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 29
|
||||
Warnings:
|
||||
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||
Error 1659 Encountered illegal value '' when converting to DECIMAL
|
||||
Error 1659 Encountered illegal value '' when converting to DECIMAL
|
||||
Error 1659 Encountered illegal value '' when converting to DECIMAL
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -3408,11 +3422,11 @@ NULL NULL 1
|
|||
-1.00 -1 5
|
||||
-3333.33 -3333.3333 28
|
||||
Warnings:
|
||||
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||
Error 1659 Encountered illegal value '' when converting to DECIMAL
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||
Error 1659 Encountered illegal value '' when converting to DECIMAL
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
|
||||
Error 1366 Incorrect decimal value: '' for column '' at row 0
|
||||
Error 1659 Encountered illegal value '' when converting to DECIMAL
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '-1'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
|
||||
|
@ -3430,11 +3444,11 @@ NULL NULL 1
|
|||
-1.00 -1 |