php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35508 PDO returns SQLSTATE error on valid queries.
Submitted: 2005-12-01 19:35 UTC Modified: 2005-12-01 21:01 UTC
From: capiCrimm at gmail dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5.1.1 OS: Debian
Private report: No CVE-ID:
 [2005-12-01 19:35 UTC] capiCrimm at gmail dot com
Description:
------------
When creating a temporary table with PDO it returns an   
error when you try to use the table. The database I'm   
running is mysql 14.7. The queries run fine in mysql CLI.   
I've tried switching around the query values and changing   
tables and databases. Error occurs both in php CLI and  
mod_php. I'm pretty sure Temp tables were working in RC1, 
though I may be remembering wrong. 

Reproduce code:
---------------
<?php

$pdoConnection = new PDO('mysql:dbname=gDev;host=localhost;','root','');

$pdoConnection->query('CREATE TEMPORARY TABLE TestC(str1 INT(1),str2 INT(1));');
$pdoConnection->query("INSERT INTO TestC VALUES(1,1);", PDO_RESULT_ASSOC); // line 6


?>

Expected result:
----------------
A Blank Page 

Actual result:
--------------
 Warning: PDO::query() [function.query]: SQLSTATE[22003]: 
Numeric value out of range: unhandled mode; this is a PDO 
bug, please report it in /file.php on line 6  

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-01 21:01 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

JFYI: all PDO constants were changed to class constants before 5.1 release.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 15:02:26 2014 UTC