Skip to content
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

[Bug]: Select into statement returns always -1 updated rows #3203

Open
1 task done
stephanep3 opened this issue Dec 4, 2024 · 2 comments
Open
1 task done

[Bug]: Select into statement returns always -1 updated rows #3203

stephanep3 opened this issue Dec 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@stephanep3
Copy link

stephanep3 commented Dec 4, 2024

What happened?

When I execute "int SqlCommand.ExecuteNonQuery()", this function return always -1 on babelfish when the command is a "select into" statement.

Ref:
https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlcommand.executenonquery?view=net-8.0-pp

We see the same error in DBeaver :
image

On sql Server, the same request returns 1 affected rows

FYI: Babelfish works good with these statements :
create table #tmp2 (c1 int not null)
insert into #tmp2 (c1) values(1) --updated rows = 1 : good
update #tmp2 set c1 = 2 --updated rows = 1 : good
delete #tmp2 --updated rows = 1 : good
delete #tmp2 --updated rows =0 : good

Version

BABEL_4_X_DEV (Default)

Extension

babelfishpg_tsql (Default)

Which flavor of Linux are you using when you see the bug?

Amazon Linux

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.
@stephanep3 stephanep3 added the bug Something isn't working label Dec 4, 2024
@robverschoor
Copy link
Contributor

I cannot reproduce this issue. On 4.3.0 as well as on earlier versions it works correctly for me:

1> select 1 as c1 into #tmp
2> select @@rowcount
3> go
rowcount
-----------
          1

(1 rows affected)

@stephanep3
Copy link
Author

stephanep3 commented Dec 4, 2024

I got the good value if I do "select @@rowcount" after the select into statement.
I rephrased my bug description, it's about the function "int ExecuteNonQuery()" my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants