vertica / Vertica-Extension-Packages

User Defined Extensions (UDX) to the Vertica Analytic Database
http://www.vertica.com/
Other
119 stars 113 forks source link

Add commit before calling SQLDisconnect to avoid HY010 error #68

Closed h-serizawa closed 2 years ago

h-serizawa commented 2 years ago

"SQLDisconnect() failed with error code HY010" error happens. The cause is commit or rollback is not called before calling SQLDisconnect. Add the call of SQLEndTran(SQL_COMMIT) before SQLDisconnect in destroy method. Close #66.

h-serizawa commented 2 years ago

Test results in v11.1.0-0-669fd97287b9c05ae8b69656c04c16cffa268024:

[Auto commit = ON]

dbadmin=> COPY store_sales
dbadmin->     WITH SOURCE ODBCSource() PARSER ODBCLoader(
dbadmin(>         connect='DSN=Vertica',
dbadmin(>         query='select * from store_sales'
dbadmin(>     )
dbadmin-> ;
 Rows Loaded
-------------
     2880404
(1 row)

2022-03-11 11:27:20.181 Init Session:0x7fb985ffb700 [Session] <INFO> [Query] TX:0(v_trial_node0001-3993:0xcd) set session autocommit to on

[Auto commit = OFF]

dbadmin=> COPY store_sales
dbadmin->     WITH SOURCE ODBCSource() PARSER ODBCLoader(
dbadmin(>         connect='DSN=Vertica',
dbadmin(>         query='select * from store_sales'
dbadmin(>     )
dbadmin-> ;
 Rows Loaded
-------------
     2880404
(1 row)

2022-03-11 11:27:20.181 Init Session:0x7fb985ffb700 [Session] <INFO> [Query] TX:0(v_trial_node0001-3993:0xcd) set session autocommit to on

h-serizawa commented 2 years ago

Close this request since we are moving to new repository.