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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
eb67909b
Commit
eb67909b
authored
Jun 29, 2004
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL#1600 (Warn if result is truncatet due to max_allowed_packet)
parent
6acd105b
Changes
28
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
90 additions
and
10 deletions
+90
-10
include/mysqld_error.h
include/mysqld_error.h
+2
-1
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+2
-0
mysql-test/r/packet.result
mysql-test/r/packet.result
+2
-0
sql/item_geofunc.cc
sql/item_geofunc.cc
+5
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+56
-9
sql/share/czech/errmsg.txt
sql/share/czech/errmsg.txt
+1
-0
sql/share/danish/errmsg.txt
sql/share/danish/errmsg.txt
+1
-0
sql/share/dutch/errmsg.txt
sql/share/dutch/errmsg.txt
+1
-0
sql/share/english/errmsg.txt
sql/share/english/errmsg.txt
+1
-0
sql/share/estonian/errmsg.txt
sql/share/estonian/errmsg.txt
+1
-0
sql/share/french/errmsg.txt
sql/share/french/errmsg.txt
+1
-0
sql/share/german/errmsg.txt
sql/share/german/errmsg.txt
+1
-0
sql/share/greek/errmsg.txt
sql/share/greek/errmsg.txt
+1
-0
sql/share/hungarian/errmsg.txt
sql/share/hungarian/errmsg.txt
+1
-0
sql/share/italian/errmsg.txt
sql/share/italian/errmsg.txt
+1
-0
sql/share/japanese/errmsg.txt
sql/share/japanese/errmsg.txt
+1
-0
sql/share/korean/errmsg.txt
sql/share/korean/errmsg.txt
+1
-0
sql/share/norwegian-ny/errmsg.txt
sql/share/norwegian-ny/errmsg.txt
+1
-0
sql/share/norwegian/errmsg.txt
sql/share/norwegian/errmsg.txt
+1
-0
sql/share/polish/errmsg.txt
sql/share/polish/errmsg.txt
+1
-0
sql/share/portuguese/errmsg.txt
sql/share/portuguese/errmsg.txt
+1
-0
sql/share/romanian/errmsg.txt
sql/share/romanian/errmsg.txt
+1
-0
sql/share/russian/errmsg.txt
sql/share/russian/errmsg.txt
+1
-0
sql/share/serbian/errmsg.txt
sql/share/serbian/errmsg.txt
+1
-0
sql/share/slovak/errmsg.txt
sql/share/slovak/errmsg.txt
+1
-0
sql/share/spanish/errmsg.txt
sql/share/spanish/errmsg.txt
+1
-0
sql/share/swedish/errmsg.txt
sql/share/swedish/errmsg.txt
+1
-0
sql/share/ukrainian/errmsg.txt
sql/share/ukrainian/errmsg.txt
+1
-0
No files found.
include/mysqld_error.h
View file @
eb67909b
...
...
@@ -316,4 +316,5 @@
#define ER_GET_TEMPORARY_ERRMSG 1297
#define ER_UNKNOWN_TIME_ZONE 1298
#define ER_WARN_INVALID_TIMESTAMP 1299
#define ER_ERROR_MESSAGES 300
#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1300
#define ER_ERROR_MESSAGES 301
mysql-test/r/func_str.result
View file @
eb67909b
...
...
@@ -225,6 +225,8 @@ substring_index("www.tcx.se","",3)
select length(repeat("a",100000000)),length(repeat("a",1000*64));
length(repeat("a",100000000)) length(repeat("a",1000*64))
NULL 64000
Warnings:
Warning 1300 Data truncated by function 'repeat' do to max_allowed_packet
select position("0" in "baaa" in (1)),position("0" in "1" in (1,2,3)),position("sql" in ("mysql"));
position("0" in "baaa" in (1)) position("0" in "1" in (1,2,3)) position("sql" in ("mysql"))
1 0 3
...
...
mysql-test/r/packet.result
View file @
eb67909b
...
...
@@ -8,6 +8,8 @@ len
select repeat('a',2000);
repeat('a',2000)
NULL
Warnings:
Warning 1300 Data truncated by function 'repeat' do to max_allowed_packet
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
...
...
sql/item_geofunc.cc
View file @
eb67909b
...
...
@@ -446,7 +446,12 @@ String *Item_func_spatial_collection::val_str(String *str)
}
}
if
(
str
->
length
()
>
current_thd
->
variables
.
max_allowed_packet
)
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_ALLOWED_PACKET_OVERFLOWED
,
ER
(
ER_WARN_ALLOWED_PACKET_OVERFLOWED
),
func_name
());
goto
err
;
}
null_value
=
0
;
return
str
;
...
...
sql/item_strfunc.cc
View file @
eb67909b
...
...
@@ -266,7 +266,12 @@ String *Item_func_concat::val_str(String *str)
continue
;
if
(
res
->
length
()
+
res2
->
length
()
>
current_thd
->
variables
.
max_allowed_packet
)
goto
null
;
// Error check
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_ALLOWED_PACKET_OVERFLOWED
,
ER
(
ER_WARN_ALLOWED_PACKET_OVERFLOWED
),
func_name
());
goto
null
;
}
if
(
res
->
alloced_length
()
>=
res
->
length
()
+
res2
->
length
())
{
// Use old buffer
res
->
append
(
*
res2
);
...
...
@@ -544,7 +549,12 @@ String *Item_func_concat_ws::val_str(String *str)
if
(
res
->
length
()
+
sep_str
->
length
()
+
res2
->
length
()
>
current_thd
->
variables
.
max_allowed_packet
)
goto
null
;
// Error check
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_ALLOWED_PACKET_OVERFLOWED
,
ER
(
ER_WARN_ALLOWED_PACKET_OVERFLOWED
),
func_name
());
goto
null
;
}
if
(
res
->
alloced_length
()
>=
res
->
length
()
+
sep_str
->
length
()
+
res2
->
length
())
{
// Use old buffer
...
...
@@ -801,7 +811,14 @@ redo:
offset
=
(
int
)
(
ptr
-
res
->
ptr
());
if
(
res
->
length
()
-
from_length
+
to_length
>
current_thd
->
variables
.
max_allowed_packet
)
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_ALLOWED_PACKET_OVERFLOWED
,
ER
(
ER_WARN_ALLOWED_PACKET_OVERFLOWED
),
func_name
());
goto
null
;
}
if
(
!
alloced
)
{
alloced
=
1
;
...
...
@@ -822,7 +839,12 @@ skip:
{
if
(
res
->
length
()
-
from_length
+
to_length
>
current_thd
->
variables
.
max_allowed_packet
)
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_ALLOWED_PACKET_OVERFLOWED
,
ER
(
ER_WARN_ALLOWED_PACKET_OVERFLOWED
),
func_name
());
goto
null
;
}
if
(
!
alloced
)
{
alloced
=
1
;
...
...
@@ -882,7 +904,12 @@ String *Item_func_insert::val_str(String *str)
length
=
res
->
length
()
-
start
;
if
(
res
->
length
()
-
length
+
res2
->
length
()
>
current_thd
->
variables
.
max_allowed_packet
)
goto
null
;
// OOM check
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_ALLOWED_PACKET_OVERFLOWED
,
ER
(
ER_WARN_ALLOWED_PACKET_OVERFLOWED
),
func_name
());
goto
null
;
}
res
=
copy_if_not_alloced
(
str
,
res
,
res
->
length
());
res
->
replace
(
start
,
length
,
*
res2
);
return
res
;
...
...
@@ -1934,7 +1961,12 @@ String *Item_func_repeat::val_str(String *str)
length
=
res
->
length
();
// Safe length check
if
(
length
>
current_thd
->
variables
.
max_allowed_packet
/
count
)
goto
err
;
// Probably an error
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_ALLOWED_PACKET_OVERFLOWED
,
ER
(
ER_WARN_ALLOWED_PACKET_OVERFLOWED
),
func_name
());
goto
err
;
}
tot_length
=
length
*
(
uint
)
count
;
if
(
!
(
res
=
alloc_buffer
(
res
,
str
,
&
tmp_value
,
tot_length
)))
goto
err
;
...
...
@@ -1999,8 +2031,14 @@ String *Item_func_rpad::val_str(String *str)
return
(
res
);
}
pad_char_length
=
rpad
->
numchars
();
if
((
ulong
)
byte_count
>
current_thd
->
variables
.
max_allowed_packet
||
args
[
2
]
->
null_value
||
!
pad_char_length
)
if
((
ulong
)
byte_count
>
current_thd
->
variables
.
max_allowed_packet
)
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_ALLOWED_PACKET_OVERFLOWED
,
ER
(
ER_WARN_ALLOWED_PACKET_OVERFLOWED
),
func_name
());
goto
err
;
}
if
(
args
[
2
]
->
null_value
||
!
pad_char_length
)
goto
err
;
res_byte_length
=
res
->
length
();
/* Must be done before alloc_buffer */
if
(
!
(
res
=
alloc_buffer
(
res
,
str
,
&
tmp_value
,
byte_count
)))
...
...
@@ -2079,8 +2117,15 @@ String *Item_func_lpad::val_str(String *str)
pad_char_length
=
pad
->
numchars
();
byte_count
=
count
*
collation
.
collation
->
mbmaxlen
;
if
(
byte_count
>
current_thd
->
variables
.
max_allowed_packet
||
args
[
2
]
->
null_value
||
!
pad_char_length
||
str
->
alloc
(
byte_count
))
if
(
byte_count
>
current_thd
->
variables
.
max_allowed_packet
)
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_ALLOWED_PACKET_OVERFLOWED
,
ER
(
ER_WARN_ALLOWED_PACKET_OVERFLOWED
),
func_name
());
goto
err
;
}
if
(
args
[
2
]
->
null_value
||
!
pad_char_length
||
str
->
alloc
(
byte_count
))
goto
err
;
str
->
length
(
0
);
...
...
@@ -2359,7 +2404,9 @@ String *Item_load_file::val_str(String *str)
}
if
(
stat_info
.
st_size
>
(
long
)
current_thd
->
variables
.
max_allowed_packet
)
{
/* my_error(ER_TOO_LONG_STRING, MYF(0), file_name->c_ptr()); */
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_ALLOWED_PACKET_OVERFLOWED
,
ER
(
ER_WARN_ALLOWED_PACKET_OVERFLOWED
),
func_name
());
goto
err
;
}
if
(
tmp_value
.
alloc
(
stat_info
.
st_size
))
...
...
sql/share/czech/errmsg.txt
View file @
eb67909b
...
...
@@ -312,3 +312,4 @@ character-set=latin2
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/danish/errmsg.txt
View file @
eb67909b
...
...
@@ -306,3 +306,4 @@ character-set=latin1
"Modtog temporary fejl %d '%-.100s' fra %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/dutch/errmsg.txt
View file @
eb67909b
...
...
@@ -314,3 +314,4 @@ character-set=latin1
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/english/errmsg.txt
View file @
eb67909b
...
...
@@ -303,3 +303,4 @@ character-set=latin1
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/estonian/errmsg.txt
View file @
eb67909b
...
...
@@ -308,3 +308,4 @@ character-set=latin7
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/french/errmsg.txt
View file @
eb67909b
...
...
@@ -303,3 +303,4 @@ character-set=latin1
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/german/errmsg.txt
View file @
eb67909b
...
...
@@ -315,3 +315,4 @@ character-set=latin1
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/greek/errmsg.txt
View file @
eb67909b
...
...
@@ -303,3 +303,4 @@ character-set=greek
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/hungarian/errmsg.txt
View file @
eb67909b
...
...
@@ -305,3 +305,4 @@ character-set=latin2
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/italian/errmsg.txt
View file @
eb67909b
...
...
@@ -303,3 +303,4 @@ character-set=latin1
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/japanese/errmsg.txt
View file @
eb67909b
...
...
@@ -305,3 +305,4 @@ character-set=ujis
"Got temporary NDB error %d '%-.100s'",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/korean/errmsg.txt
View file @
eb67909b
...
...
@@ -303,3 +303,4 @@ character-set=euckr
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/norwegian-ny/errmsg.txt
View file @
eb67909b
...
...
@@ -305,3 +305,4 @@ character-set=latin1
"Mottok temporary feil %d '%-.100s' fra %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/norwegian/errmsg.txt
View file @
eb67909b
...
...
@@ -305,3 +305,4 @@ character-set=latin1
"Mottok temporary feil %d '%-.100s' fra %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/polish/errmsg.txt
View file @
eb67909b
...
...
@@ -307,3 +307,4 @@ character-set=latin2
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/portuguese/errmsg.txt
View file @
eb67909b
...
...
@@ -304,3 +304,4 @@ character-set=latin1
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/romanian/errmsg.txt
View file @
eb67909b
...
...
@@ -307,3 +307,4 @@ character-set=latin2
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/russian/errmsg.txt
View file @
eb67909b
...
...
@@ -305,3 +305,4 @@ character-set=koi8r
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/serbian/errmsg.txt
View file @
eb67909b
...
...
@@ -309,3 +309,4 @@ character-set=cp1250
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/slovak/errmsg.txt
View file @
eb67909b
...
...
@@ -311,3 +311,4 @@ character-set=latin2
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/spanish/errmsg.txt
View file @
eb67909b
...
...
@@ -305,3 +305,4 @@ character-set=latin1
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/swedish/errmsg.txt
View file @
eb67909b
...
...
@@ -303,3 +303,4 @@ character-set=latin1
"Fick tilfällig felkod %d '%-.100s' från %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
sql/share/ukrainian/errmsg.txt
View file @
eb67909b
...
...
@@ -308,3 +308,4 @@ character-set=koi8u
"Got temporary error %d '%-.100s' from %s",
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Data truncated by function '%s' do to max_allowed_packet"
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