Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7195b010
Commit
7195b010
authored
Jan 21, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-5.0
into mysql.com:/home/mydev/mysql-5.0-5000
parents
0edfc25e
d29c4533
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
41 deletions
+45
-41
extra/comp_err.c
extra/comp_err.c
+2
-1
mysql-test/r/strict.result
mysql-test/r/strict.result
+2
-2
mysql-test/t/strict.test
mysql-test/t/strict.test
+2
-2
sql/field.cc
sql/field.cc
+31
-29
sql/field_conv.cc
sql/field_conv.cc
+5
-6
sql/share/errmsg.txt
sql/share/errmsg.txt
+3
-1
No files found.
extra/comp_err.c
View file @
7195b010
...
...
@@ -35,6 +35,7 @@
#define HEADER_LENGTH 32
/* Length of header in errmsg.sys */
#define DEFAULT_CHARSET_DIR "../sql/share/charsets"
#define ER_PREFIX "ER_"
#define WARN_PREFIX "WARN_"
static
char
*
OUTFILE
=
(
char
*
)
"errmsg.sys"
;
static
char
*
HEADERFILE
=
(
char
*
)
"mysqld_error.h"
;
static
char
*
NAMEFILE
=
(
char
*
)
"mysqld_ername.h"
;
...
...
@@ -453,7 +454,7 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
DBUG_RETURN
(
0
);
continue
;
}
if
(
is_prefix
(
str
,
ER_PREFIX
))
if
(
is_prefix
(
str
,
ER_PREFIX
)
||
is_prefix
(
str
,
WARN_PREFIX
)
)
{
if
(
!
(
current_error
=
parse_error_string
(
str
,
rcount
)))
{
...
...
mysql-test/r/strict.result
View file @
7195b010
...
...
@@ -814,14 +814,14 @@ DROP TABLE t1;
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
INSERT INTO t1 (col1) VALUES ('hellobob');
ERROR
01000: Data truncated
for column 'col1' at row 1
ERROR
22001: Data too long
for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('hellobob');
ERROR 01000: Data truncated for column 'col2' at row 1
INSERT INTO t1 (col2) VALUES ('hello ');
Warnings:
Note 1265 Data truncated for column 'col2' at row 1
UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
ERROR
01000: Data truncated
for column 'col1' at row 2
ERROR
22001: Data too long
for column 'col1' at row 2
UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
ERROR 01000: Data truncated for column 'col2' at row 2
INSERT IGNORE INTO t1 VALUES ('hellobob', 'hellobob');
...
...
mysql-test/t/strict.test
View file @
7195b010
...
...
@@ -565,12 +565,12 @@ DROP TABLE t1;
CREATE
TABLE
t1
(
col1
CHAR
(
5
),
col2
VARCHAR
(
6
));
INSERT
INTO
t1
VALUES
(
'hello'
,
'hello'
),(
'he'
,
'he'
),(
'hello '
,
'hello '
);
--
error
1
265
--
error
1
400
INSERT
INTO
t1
(
col1
)
VALUES
(
'hellobob'
);
--
error
1265
INSERT
INTO
t1
(
col2
)
VALUES
(
'hellobob'
);
INSERT
INTO
t1
(
col2
)
VALUES
(
'hello '
);
--
error
1
265
--
error
1
400
UPDATE
t1
SET
col1
=
'hellobob'
WHERE
col1
=
'he'
;
--
error
1265
UPDATE
t1
SET
col2
=
'hellobob'
WHERE
col2
=
'he'
;
...
...
sql/field.cc
View file @
7195b010
...
...
@@ -117,7 +117,7 @@ bool Field::check_int(const char *str, int length, const char *int_end,
{
if
(
!
my_isspace
(
cs
,
*
str
))
{
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
return
1
;
}
}
...
...
@@ -662,7 +662,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
from
++
;
if
(
from
==
end
)
{
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
is_cuted_fields_incr
=
1
;
}
else
if
(
*
from
==
'+'
||
*
from
==
'-'
)
// Found some sign ?
...
...
@@ -738,7 +738,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
for
(;
from
!=
end
&&
my_isspace
(
&
my_charset_bin
,
*
from
);
from
++
)
;
if
(
from
!=
end
)
// If still something left, warn
{
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
is_cuted_fields_incr
=
1
;
}
}
...
...
@@ -917,7 +917,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
{
if
(
!
is_cuted_fields_incr
)
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
WARN_DATA_TRUNCATED
,
1
);
return
0
;
}
continue
;
...
...
@@ -939,7 +939,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
This is a note, not a warning, as we don't want to abort
when we cut decimals in strict mode
*/
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_NOTE
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_NOTE
,
WARN_DATA_TRUNCATED
,
1
);
}
return
0
;
}
...
...
@@ -2367,8 +2367,7 @@ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
table
->
in_use
->
count_cuted_fields
))
{
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
(
error
?
ER_WARN_DATA_OUT_OF_RANGE
:
ER_WARN_DATA_TRUNCATED
),
1
);
(
error
?
ER_WARN_DATA_OUT_OF_RANGE
:
WARN_DATA_TRUNCATED
),
1
);
error
=
1
;
}
Field_float
::
store
(
nr
);
...
...
@@ -2656,8 +2655,7 @@ int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
table
->
in_use
->
count_cuted_fields
))
{
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
(
error
?
ER_WARN_DATA_OUT_OF_RANGE
:
ER_WARN_DATA_TRUNCATED
),
1
);
(
error
?
ER_WARN_DATA_OUT_OF_RANGE
:
WARN_DATA_TRUNCATED
),
1
);
error
=
1
;
}
Field_double
::
store
(
nr
);
...
...
@@ -3024,7 +3022,7 @@ int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs)
if
(
error
||
!
have_smth_to_conv
)
{
error
=
1
;
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
from
,
len
,
MYSQL_TIMESTAMP_DATETIME
,
1
);
}
...
...
@@ -3104,7 +3102,7 @@ int Field_timestamp::store(longlong nr)
}
else
if
(
error
)
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
WARN_DATA_TRUNCATED
,
nr
,
MYSQL_TIMESTAMP_DATETIME
,
1
);
#ifdef WORDS_BIGENDIAN
...
...
@@ -3337,14 +3335,14 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs)
{
tmp
=
0L
;
error
=
1
;
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
from
,
len
,
MYSQL_TIMESTAMP_TIME
,
1
);
}
else
{
if
(
error
)
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
WARN_DATA_TRUNCATED
,
from
,
len
,
MYSQL_TIMESTAMP_TIME
,
1
);
if
(
ltime
.
month
)
...
...
@@ -3700,7 +3698,7 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs)
tmp
=
(
uint32
)
l_time
.
year
*
10000L
+
(
uint32
)
(
l_time
.
month
*
100
+
l_time
.
day
);
if
(
error
)
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
from
,
len
,
MYSQL_TIMESTAMP_DATE
,
1
);
#ifdef WORDS_BIGENDIAN
...
...
@@ -3896,7 +3894,7 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs)
tmp
=
l_time
.
day
+
l_time
.
month
*
32
+
l_time
.
year
*
16
*
32
;
if
(
error
)
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
from
,
len
,
MYSQL_TIMESTAMP_DATE
,
1
);
int3store
(
ptr
,
tmp
);
...
...
@@ -3909,7 +3907,7 @@ int Field_newdate::store(double nr)
{
(
void
)
Field_newdate
::
store
((
longlong
)
-
1
);
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
nr
,
MYSQL_TIMESTAMP_DATE
);
WARN_DATA_TRUNCATED
,
nr
,
MYSQL_TIMESTAMP_DATE
);
return
1
;
}
else
...
...
@@ -3968,7 +3966,7 @@ int Field_newdate::store_time(TIME *ltime,timestamp_type type)
{
tmp
=
0
;
error
=
1
;
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
}
int3store
(
ptr
,
tmp
);
return
error
;
...
...
@@ -4124,7 +4122,7 @@ int Field_datetime::store(longlong nr)
if
(
error
)
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
initial_nr
,
WARN_DATA_TRUNCATED
,
initial_nr
,
MYSQL_TIMESTAMP_DATETIME
,
1
);
#ifdef WORDS_BIGENDIAN
...
...
@@ -4154,7 +4152,7 @@ int Field_datetime::store_time(TIME *ltime,timestamp_type type)
{
tmp
=
0
;
error
=
1
;
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
}
#ifdef WORDS_BIGENDIAN
if
(
table
->
s
->
db_low_byte_first
)
...
...
@@ -4370,8 +4368,12 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
error
=
1
;
}
if
(
error
)
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_DATA_TRUNCATED
,
1
);
{
if
(
table
->
in_use
->
abort_on_warning
)
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_ERROR
,
ER_DATA_TOO_LONG
,
1
);
else
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
}
return
error
;
}
...
...
@@ -4724,7 +4726,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
error
=
1
;
}
if
(
error
)
set_warning
(
level
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
level
,
WARN_DATA_TRUNCATED
,
1
);
return
error
;
}
...
...
@@ -5325,7 +5327,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
bmove
(
ptr
+
packlength
,(
char
*
)
&
from
,
sizeof
(
char
*
));
}
if
(
error
)
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
return
0
;
}
...
...
@@ -5911,11 +5913,11 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
if
(
err
||
end
!=
from
+
length
||
tmp
>
typelib
->
count
)
{
tmp
=
0
;
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
}
}
else
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
}
store_type
((
ulonglong
)
tmp
);
return
err
;
...
...
@@ -5933,7 +5935,7 @@ int Field_enum::store(longlong nr)
int
error
=
0
;
if
((
uint
)
nr
>
typelib
->
count
||
nr
==
0
)
{
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
nr
=
0
;
error
=
1
;
}
...
...
@@ -6092,11 +6094,11 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs)
tmp
>
(
ulonglong
)
(((
longlong
)
1
<<
typelib
->
count
)
-
(
longlong
)
1
))
{
tmp
=
0
;
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
}
}
else
if
(
got_warning
)
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
store_type
(
tmp
);
return
err
;
}
...
...
@@ -6109,7 +6111,7 @@ int Field_set::store(longlong nr)
(
longlong
)
1
))
{
nr
&=
(
longlong
)
(((
longlong
)
1
<<
typelib
->
count
)
-
(
longlong
)
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
error
=
1
;
}
store_type
((
ulonglong
)
nr
);
...
...
sql/field_conv.cc
View file @
7195b010
...
...
@@ -121,8 +121,7 @@ set_field_to_null(Field *field)
field
->
reset
();
if
(
current_thd
->
count_cuted_fields
==
CHECK_FIELD_WARN
)
{
field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_DATA_TRUNCATED
,
1
);
field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
return
0
;
}
if
(
!
current_thd
->
no_errors
)
...
...
@@ -230,7 +229,7 @@ static void do_copy_not_null(Copy_field *copy)
if
(
*
copy
->
from_null_ptr
&
copy
->
from_bit
)
{
copy
->
to_field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
WARN_DATA_TRUNCATED
,
1
);
copy
->
to_field
->
reset
();
}
else
...
...
@@ -336,7 +335,7 @@ static void do_cut_string(Copy_field *copy)
if
(
!
my_isspace
(
system_charset_info
,
*
ptr
))
// QQ: ucs incompatible
{
copy
->
to_field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
WARN_DATA_TRUNCATED
,
1
);
break
;
}
}
...
...
@@ -360,7 +359,7 @@ static void do_varstring1(Copy_field *copy)
length
=
copy
->
to_length
-
1
;
if
(
current_thd
->
count_cuted_fields
)
copy
->
to_field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
WARN_DATA_TRUNCATED
,
1
);
}
*
(
uchar
*
)
copy
->
to_ptr
=
(
uchar
)
length
;
memcpy
(
copy
->
to_ptr
+
1
,
copy
->
from_ptr
+
1
,
length
);
...
...
@@ -375,7 +374,7 @@ static void do_varstring2(Copy_field *copy)
length
=
copy
->
to_length
-
HA_KEY_BLOB_LENGTH
;
if
(
current_thd
->
count_cuted_fields
)
copy
->
to_field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_
WARN_DATA_TRUNCATED
,
1
);
WARN_DATA_TRUNCATED
,
1
);
}
int2store
(
copy
->
to_ptr
,
length
);
memcpy
(
copy
->
to_ptr
+
HA_KEY_BLOB_LENGTH
,
copy
->
from_ptr
+
HA_KEY_BLOB_LENGTH
,
...
...
sql/share/errmsg.txt
View file @
7195b010
...
...
@@ -4900,7 +4900,7 @@ ER_WARN_DATA_OUT_OF_RANGE 22003
ger "Daten abgeschnitten, auerhalb des Wertebereichs fr Spalte '%s' in Zeile %ld"
por "Dado truncado, fora de alcance para coluna '%s' na linha %ld"
spa "Datos truncados, fuera de gama para columna '%s' en la lnea %ld"
ER_
WARN_DATA_TRUNCATED 01000
WARN_DATA_TRUNCATED 01000
eng "Data truncated for column '%s' at row %ld"
ger "Daten abgeschnitten fr Spalte '%s' in Zeile %ld"
por "Dado truncado para coluna '%s' na linha %ld"
...
...
@@ -5312,3 +5312,5 @@ ER_PROC_AUTO_GRANT_FAIL
eng "Failed to grant EXECUTE and ALTER ROUTINE privileges"
ER_PROC_AUTO_REVOKE_FAIL
eng "Failed to revoke all privileges to dropped routine"
ER_DATA_TOO_LONG 22001
eng "Data too long for column '%s' at row %ld"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment