-
Notifications
You must be signed in to change notification settings - Fork 375
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
HY010 [unixODBC][Driver Manager]Function sequence error when updating/deleting 0 rows #701
Comments
Hi @hubipe, Unfortunately I can not reproduce this issue as shown in your repro. I tested with both v4.3.0 and our latest v5.2.0RC. Please double check your client info?
|
Hello @yitam,
I guess that problem is in installation, where even though there is version 4.3.0 installed, the webserver still uses version 4.0.8.9215. Thank you for pointing me the correct direction. |
Glad to hear that @hubipe! |
Closing issue due to inactivity. Please feel free to reopen. |
@younessadmi please provide more details to help us investigate, like what platform, SQL Server, etc. |
Docker 3.6 I'm facing the same issue than @hubipe. I already checked what extension is used by the Apache and it's the 5.2.0 Nevertheless, if I check first the existence of the rows that I want to delete, it will work... but I do not want to add a query to check the rows to delete :/ |
@younessadmi please also provide details for the following questions (copied from a new issue template): +## Microsoft ODBC Driver version |
Driver version or file name
SQL Server versionSQL Server 10.50 (2012r2) Client operating systemDebian 9 PHP versionPHP 7.2.14 Problem descriptionWhen executing UPDATE or DELETE through PDO with WHERE condition filtering out 0 rows (thus not updating anything), HY010 [unixODBC][Driver Manager]Function sequence error is raised. Expected behavior and actual behaviorAssume this table with only one row:
When running UPDATE test1 SET name = 'updated' WHERE id = 5; HY010 [unixODBC][Driver Manager]Function sequence error is raised. No error should be raised. Repro codeSQL CREATE TABLE [dbo].[test1](
[id] [int] NOT NULL,
[name] [nvarchar](50) NOT NULL
); PHP:
|
@younessadmi I could not seem to reproduce this using v5.2.0 and ODBC 17.2, trying both update and delete ops. This is what I did:
The output I got was
@younessadmi please double check the driver version by running
|
Thanks for answering. Here's the executed code :
Result :
|
@younessadmi I just realized you were using SQL Server 10.50 2008 R2, not SQL Server 2012. However, I still could not reproduce the issue in SQL Server 2008 R2 (SP2). What's the output of Also, please enable ODBC trace when running your query / queries. Then send the trace for further investigation. |
@yitam , thanks for your answer. I actually find the real issue.
But my problem comes when I use Zend Framework. It's actually the case when I try the following code :
I'ill try to resolve the issue then come back to you. |
@yitam actually, the framework uses the
And got this :
Any idea ? I'd like to avoid using PDO right now, as it's a bit risky regarding our 14M visitor monthly :/ |
Yes @younessadmi I could reproduce this with sqlsrv and unixODBC 2.3.4 in Debian 9, but pdo_sqlsrv has no problem. However, the issue seemingly lies with unixODBC because the problem with sqlsrv is gone with unixODBC 2.3.7. |
Thanks for answering. unixODBC 2.3.7 is not available on Debian 9 :/ So I'll try to build the package by myself. Nevertheless, is the bug solved from 2.3.7 or before ? |
@younessadmi I did not spend time trying different unixODBC versions. However, fyi unixODBC 2.3.7 is available with ODBC 17.3.1.1. |
So great !!! Thank you, it works like a charm so far. The issue can be closed. |
Driver version or file name
SQL Server version
SQL Server 10.50.6220 (2008r2)
Client operating system
Debian 8¨
PHP version
7.0.27-1~dotdeb+8.1
Problem description
It seems, that issue #336 has not been fixed, because I can reproduce the same behavior in the 4.3.0 version. When executing UPDATE or DELETE through PDO with WHERE condition filtering out 0 rows (thus not updating anything), HY010 [unixODBC][Driver Manager]Function sequence error is raised.
Expected behavior and actual behavior
Assume this table with only one row:
When running UPDATE test1 SET name = 'updated' WHERE id = 5;
HY010 [unixODBC][Driver Manager]Function sequence error is raised. No error should be raised.
Same error is raised, when trying to delete non existent row.
Repro code
SQL
PHP:
The text was updated successfully, but these errors were encountered: