this statement returns 1 row with the stable build but returns 0 when using the nightly one.
Select P_ID,R_Date from performances Where R_Date = ? and P_ID = 171576
Resultset with stable build looks like..
P_ID R_Date 171576 2002-02-02
Column Information For - mynndb.performances --------------------------------------------
Field Type Collation Null Key Default Extra Privileges Comment
------------ ------------ ----------------- ------ ------ ---------- ------ ------------------------------- -------
P_ID int(10) NULL PRI 0 select,insert,update,references
H_ID int(10) NULL MUL 0 select,insert,update,references
R_ID int(10) NULL MUL 0 select,insert,update,references
H_Age int(10) NULL YES MUL (NULL) select,insert,update,references
R_Date date NULL MUL 0000-00-00 select,insert,update,references
Comments varchar(255) latin1_swedish_ci YES (NULL) select,insert,update,references
Weight int(10) NULL YES (NULL) select,insert,update,references
HeadGear char(1) latin1_swedish_ci select,insert,update,references
FinPos int(10) NULL YES (NULL) select,insert,update,references
Jock_ID int(10) NULL YES (NULL) select,insert,update,references
BtnByPrev double NULL YES (NULL) select,insert,update,references
BtnByWinner double NULL YES (NULL) select,insert,update,references
Jock_All int(10) NULL YES (NULL) select,insert,update,references
Draw int(10) NULL YES (NULL) select,insert,update,references
SF int(10) NULL YES (NULL) select,insert,update,references
RHR int(10) NULL YES (NULL) select,insert,update,references
ORating int(10) NULL YES (NULL) select,insert,update,references
Odds double NULL YES (NULL) select,insert,update,references
RaceFormPlus int(10) NULL YES (NULL) select,insert,update,references
PrevPerform int(10) NULL YES (NULL) select,insert,update,references
TrainerID int(10) NULL MUL 0 select,insert,update,references
DaysSinceRun int(10) NULL YES (NULL) select,insert,update,references
Index Information For - mynndb.performances -------------------------------------------
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
------------ ---------- --------- ------------ ----------- --------- ----------- -------- ------ ------ ---------- -------
performances 0 P_ID 1 P_ID A 371759 (NULL) (NULL) BTREE
performances 0 R_H_ID 1 R_ID A (NULL) (NULL) (NULL) BTREE
performances 0 R_H_ID 2 H_ID A 371759 (NULL) (NULL) BTREE
performances 1 R_Date 1 R_Date A 1936 (NULL) (NULL) BTREE
performances 1 H_Age 1 H_Age A 15 (NULL) (NULL) YES BTREE
performances 1 TrainerID 1 TrainerID A 2528 (NULL) (NULL) BTREE
performances 1 H_ID 1 H_ID A 41306 (NULL) (NULL) BTREE
DDL Information For - mynndb.performances -----------------------------------------
Table Create Table
------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------
performances CREATE TABLE `performances` (
`P_ID` int(10) NOT NULL default '0',
`H_ID` int(10) NOT NULL default '0',
`R_ID` int(10) NOT NULL default '0',
`H_Age` int(10) default NULL,
`R_Date` date NOT NULL default '0000-00-00',
`Comments` varchar(255) default NULL,
`Weight` int(10) default NULL,
`HeadGear` char(1) NOT NULL default '',
`FinPos` int(10) default NULL,
`Jock_ID` int(10) default NULL,
`BtnByPrev` double default NULL,
`BtnByWinner` double default NULL,
`Jock_All` int(10) default NULL,
`Draw` int(10) default NULL,
`SF` int(10) default NULL,
`RHR` int(10) default NULL,
`ORating` int(10) default NULL,
`Odds` double default NULL,
`RaceFormPlus` int(10) default NULL,
`PrevPerform` int(10) default NULL,
`TrainerID` int(10) NOT NULL default '0',
`DaysSinceRun` int(10) default NULL,
UNIQUE KEY `P_ID` (`P_ID`),
UNIQUE KEY `R_H_ID` (`R_ID`,`H_ID`),
KEY `R_Date` (`R_Date`),
KEY `H_Age` (`H_Age`),
KEY `TrainerID` (`TrainerID`),
KEY `H_ID` (`H_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
From: Mark Matthews <[EMAIL PROTECTED]> To: Brian Power <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: anybody used prepared statements in 4.1 succesfully? Date: Fri, 23 Jan 2004 09:55:12 -0600
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Brian Power wrote:
> yeah, I tried the new connector. but I'm getting strange results when > using a date field, > > > My sql looks like.. > > Where R_Date < ? and R_Date > ? and H_ID <> ?........ > > My code looks like... > > perparedStmt.setDate(1,new java.sql.Date(myDate.getTime())); > > R_Date looks like... > R_Date date Not null > > It doesn't crash, but it doesn't return the records either.When I use > the stable connector/j it works fine (but of course, it's not really > doing a prepared statement in the background) > > Also just at the point where I execute the statement, I get strange text > output to stdout, something like "0 0 0 0 0 8 0 0 0 ......."
The output is from some debug code that has now been disabled.
What does your table look like (i.e. schema, and the minimum amount of data needed to reproduce the issue)?
I haven't yet seen a bug like this. The JDBC compliance testsuite we use, as well as our own unit and regression tests cover quite a bit of java.sql.Date functionality with prepared statements, and they all work. It looks like we might be working with a corner case here, so I'll need to see exactly what data causes this to happen in your case.
-Mark - -- Mr. Mark Matthews MySQL AB, Software Development Manager, J2EE and Windows Platforms Office: +1 708 557 2388 www.mysql.com
Want to swim with the dolphins? (April 14-16, 2004) http://www.mysql.com/uc2004/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAEUPgtvXNTca6JD8RAi66AKCSKHkC5T4BPI/lx3qkdBuTbeW/HACdGWbt /FFQi5dEqHbGCWTNWh7Gzpo= =XWrG -----END PGP SIGNATURE-----
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
P_ID R_Date 171576 2002-02-02
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]