import testsuite.BaseTestCase; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import com.mysql.jdbc.Driver; public class bug30999 extends BaseTestCase { public bug30999(String name) { super(name); } public static void main(String[] args) { junit.textui.TestRunner.run(bug30999.class); } public void testBug29893() throws Exception { try { this.stmt.executeUpdate("drop database if exists bug30999"); this.stmt.executeUpdate("create database bug30999"); this.stmt.executeUpdate("use bug30999"); this.stmt.executeUpdate("set autocommit = 1"); this.stmt.executeUpdate("create table cookie(COOKIE_ID int not null primary key auto_increment," + "COOKIE_TYPE_ID tinyint(4) not null," + "COOKIE_VALUE varchar(32) not null," + "PLF_CODE varchar(6) not null," + "ACTIVE_FLAG char(1) not null default 'Y'," + "CREATION_DATE_TIME datetime not null," + "MOD_DATE_TIME datetime not null," + "NUM_DAYS_EXPIRATION smallint(6) not null" + ") engine=innodb"); this.stmt.executeUpdate("insert into cookie (COOKIE_TYPE_ID, COOKIE_VALUE, PLF_CODE, CREATION_DATE_TIME, MOD_DATE_TIME, NUM_DAYS_EXPIRATION) values(1, 'fafdfawqwed67fsa6ffsda', 'xxxyyy', '2007-10-21 16:20:02', '2007-10-21 16:21:02', 1)"); this.stmt.setQueryTimeout(2); this.stmt.executeUpdate("INSERT INTO cookie (cookie_type_id, cookie_value, plf_code, active_flag, creation_date_time, mod_date_time,num_days_expiration)VALUES(2,'3a424501d07149e0bb815984aebc82a0','PCLN','Y','2007-08-28 15:08:50','2007-08-28 15:08:50',sleep(20)+365) ON DUPLICATE KEY UPDATE cookie_id = cookie_id"); } finally { closeMemberJDBCResources(); } } }