Skip to content

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

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

srgoogleguy
Copy link
Contributor

...bit builds in pdo_sqlite.

@lstrojny
Copy link
Contributor

lstrojny commented Jan 6, 2013

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

@srgoogleguy
Copy link
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
Copy link
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.

@srgoogleguy
Copy link
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
Copy link
Contributor

lstrojny commented Jan 7, 2013

Looks good.

@php-pulls
Copy link

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