Bug #16686 Only first warning is returned.
Description:
A insert statement that gives to warning when using mysql prompt in Unix.
Gives only one when using JDBC.
How to repeat:
Create table:
CREATE TABLE `organizationaddress` (
`bookid` int(11) NOT NULL default '0',
`organizationnr` int(11) NOT NULL default '0',
`type` char(1) collate utf8_bin NOT NULL default '',
`streetname` varchar(24) collate utf8_bin NOT NULL default '',
`streetnr` int(11) NOT NULL default '0',
`streetnrext` varchar(4) collate utf8_bin NOT NULL default '',
`zipcode` varchar(6) collate utf8_bin NOT NULL default '',
`city` varchar(24) collate utf8_bin NOT NULL default '',
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;
Test following statement, once using mysql command:
Suggested fix:
insert into organizationaddress (bookid, organizationnr, type, streetname, streetnr, streetnrext, zipcode, city) values (3, -1, 'Pxx', 'xxxxxxxxxxxxxxxxxxxxxxx', 6999999900019, '', '', '');
show warnings;
--> 2 warnings
When using JDBC it gives only 1 warning (drop and recreate table first):
try {
st = conn.createStatement();
rows = st.executeUpdate(statement);
} catch (SQLWarning e) {
SQLWarning warning = st.getWarnings();
while (warning != null) {
System.out.println("Warning: " +warning);
warning = warning.getNextWarning();
}
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.060 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: A insert statement that gives to warning when using mysql prompt in Unix. Gives only one when using JDBC. How to repeat: Create table: CREATE TABLE `organizationaddress` ( `bookid` int(11) NOT NULL default '0', `organizationnr` int(11) NOT NULL default '0', `type` char(1) collate utf8_bin NOT NULL default '', `streetname` varchar(24) collate utf8_bin NOT NULL default '', `streetnr` int(11) NOT NULL default '0', `streetnrext` varchar(4) collate utf8_bin NOT NULL default '', `zipcode` varchar(6) collate utf8_bin NOT NULL default '', `city` varchar(24) collate utf8_bin NOT NULL default '', ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; Test following statement, once using mysql command: Suggested fix: insert into organizationaddress (bookid, organizationnr, type, streetname, streetnr, streetnrext, zipcode, city) values (3, -1, 'Pxx', 'xxxxxxxxxxxxxxxxxxxxxxx', 6999999900019, '', '', ''); show warnings; --> 2 warnings When using JDBC it gives only 1 warning (drop and recreate table first): try { st = conn.createStatement(); rows = st.executeUpdate(statement); } catch (SQLWarning e) { SQLWarning warning = st.getWarnings(); while (warning != null) { System.out.println("Warning: " +warning); warning = warning.getNextWarning(); }