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
f0233c2e
Commit
f0233c2e
authored
Jun 04, 2005
by
konstantin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix show warnings limit 0 and show warnings limit 0, 0.
Add test coverage for SHOW WARNINGS LIMIT a, b;
parent
7a1282b3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
2 deletions
+77
-2
mysql-test/r/warnings.result
mysql-test/r/warnings.result
+53
-0
mysql-test/t/warnings.test
mysql-test/t/warnings.test
+22
-0
sql/sql_error.cc
sql/sql_error.cc
+2
-2
No files found.
mysql-test/r/warnings.result
View file @
f0233c2e
...
@@ -179,3 +179,56 @@ drop table t1;
...
@@ -179,3 +179,56 @@ drop table t1;
set table_type=MYISAM;
set table_type=MYISAM;
Warnings:
Warnings:
Warning 1287 'table_type' is deprecated; use 'storage_engine' instead
Warning 1287 'table_type' is deprecated; use 'storage_engine' instead
create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
update t1 set a='abc';
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'a' at row 3
Warning 1265 Data truncated for column 'a' at row 4
Warning 1265 Data truncated for column 'a' at row 5
Warning 1265 Data truncated for column 'a' at row 6
Warning 1265 Data truncated for column 'a' at row 7
Warning 1265 Data truncated for column 'a' at row 8
Warning 1265 Data truncated for column 'a' at row 9
Warning 1265 Data truncated for column 'a' at row 10
show warnings limit 2, 1;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 3
show warnings limit 0, 10;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'a' at row 3
Warning 1265 Data truncated for column 'a' at row 4
Warning 1265 Data truncated for column 'a' at row 5
Warning 1265 Data truncated for column 'a' at row 6
Warning 1265 Data truncated for column 'a' at row 7
Warning 1265 Data truncated for column 'a' at row 8
Warning 1265 Data truncated for column 'a' at row 9
Warning 1265 Data truncated for column 'a' at row 10
show warnings limit 9, 1;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 10
show warnings limit 10, 1;
Level Code Message
show warnings limit 9, 2;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 10
show warnings limit 0, 0;
Level Code Message
show warnings limit 1;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 1
show warnings limit 0;
Level Code Message
show warnings limit 1, 0;
Level Code Message
select * from t1 limit 0;
a
select * from t1 limit 1, 0;
a
select * from t1 limit 0, 0;
a
drop table t1;
mysql-test/t/warnings.test
View file @
f0233c2e
...
@@ -133,3 +133,25 @@ drop table t1;
...
@@ -133,3 +133,25 @@ drop table t1;
# Test for deprecated table_type variable
# Test for deprecated table_type variable
#
#
set
table_type
=
MYISAM
;
set
table_type
=
MYISAM
;
#
# Tests for show warnings limit a, b
#
create
table
t1
(
a
int
);
insert
into
t1
(
a
)
values
(
1
),
(
2
),
(
3
),
(
4
),
(
5
),
(
6
),
(
7
),
(
8
),
(
9
),
(
10
);
# should generate 10 warnings
update
t1
set
a
=
'abc'
;
show
warnings
limit
2
,
1
;
show
warnings
limit
0
,
10
;
show
warnings
limit
9
,
1
;
show
warnings
limit
10
,
1
;
show
warnings
limit
9
,
2
;
show
warnings
limit
0
,
0
;
show
warnings
limit
1
;
show
warnings
limit
0
;
show
warnings
limit
1
,
0
;
# make sure behaviour is consistent with select ... limit
select
*
from
t1
limit
0
;
select
*
from
t1
limit
1
,
0
;
select
*
from
t1
limit
0
,
0
;
drop
table
t1
;
sql/sql_error.cc
View file @
f0233c2e
...
@@ -203,6 +203,8 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
...
@@ -203,6 +203,8 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
offset
--
;
offset
--
;
continue
;
continue
;
}
}
if
(
limit
--
==
0
)
break
;
protocol
->
prepare_for_resend
();
protocol
->
prepare_for_resend
();
protocol
->
store
(
warning_level_names
[
err
->
level
],
protocol
->
store
(
warning_level_names
[
err
->
level
],
warning_level_length
[
err
->
level
],
system_charset_info
);
warning_level_length
[
err
->
level
],
system_charset_info
);
...
@@ -210,8 +212,6 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
...
@@ -210,8 +212,6 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
protocol
->
store
(
err
->
msg
,
strlen
(
err
->
msg
),
system_charset_info
);
protocol
->
store
(
err
->
msg
,
strlen
(
err
->
msg
),
system_charset_info
);
if
(
protocol
->
write
())
if
(
protocol
->
write
())
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
if
(
!--
limit
)
break
;
}
}
send_eof
(
thd
);
send_eof
(
thd
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
...
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