Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fixes Bug #63916 PDO::PARAM_INT casts to 32bit int internally even on 64... #253

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

srgoogleguy commented Jan 6, 2013

...bit builds in pdo_sqlite.

Contributor

lstrojny commented Jan 6, 2013

Patch + tests looks good. Does the same bug happen for ext/sqlite3?

Contributor

srgoogleguy commented Jan 6, 2013

hmmm, yes it does. If I run the same reproduce test case through sqlite3 we get the same issue.

query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))'); $stmt = $conn->prepare('insert into users (id, num) values (:id, :num)'); $stmt->bindValue(':id', 1, SQLITE3_INTEGER); $stmt->bindValue(':num', $num, SQLITE3_INTEGER); $stmt->execute(); $stmt = $conn->query('SELECT num FROM users'); $result = $stmt->fetchArray(); printf("Expected: %d Received: %d\n", $num, $result[0]); ?>

Output is: "Expected: 100004313234244 Received: 294714180"

I'll have to dig into sqlite3 to see why it's not using the sqlite3_bind_int64 API functions where they're needed. I would have thought this would be the reason they are there, no?

Contributor

lstrojny commented Jan 6, 2013

@srgoogleguy I'm not sure as I don’t know that much about sqlite3. Would be cool if you could dig into that a little further.

Contributor

srgoogleguy commented Jan 6, 2013

@lstrojny Just wanted to update this that I managed to locate the issue in ext/sqlite3 as well and I fixed it in #253

Contributor

lstrojny commented Jan 7, 2013

Looks good.

Comment on behalf of lstrojny at php.net:

Merged into 5.4, 5.5 and master

@php-pulls php-pulls closed this Jan 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment