Skip to content

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

Closed
srgoogleguy wants to merge 1 commit into
php:masterfrom
srgoogleguy:bug_63916
Closed

srgoogleguy wants to merge 1 commit into
php:masterfrom
srgoogleguy:bug_63916

Conversation

@srgoogleguy

Copy link
Copy Markdown
Contributor

...bit builds in pdo_sqlite.

@lstrojny

lstrojny commented Jan 6, 2013

Copy link
Copy Markdown
Contributor

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

@srgoogleguy

Copy link
Copy Markdown
Contributor Author

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?

@lstrojny

lstrojny commented Jan 6, 2013

Copy link
Copy Markdown
Contributor

@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.

@srgoogleguy

Copy link
Copy Markdown
Contributor Author

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

@lstrojny

lstrojny commented Jan 7, 2013

Copy link
Copy Markdown
Contributor

Looks good.

@php-pulls

Copy link
Copy Markdown

Comment on behalf of lstrojny at php.net:

Merged into 5.4, 5.5 and master

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants