kp2601 / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

About ODBC interface #557

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I use PostgreSQL ODBC driver to connect to H2 database, call SQLNumResultCols.

First, I create a table like this:
CREATE TABLE t ( f VARCHAR(20) NOT NULL )

And then, as the 1st case, I do:
SELECT x FROM t

It returns an error:
org.h2.jdbc.JdbcSQLException: Column "X" not found; SQL statement:
SELECT x FROM t [42122-176]]

It's correct. But as the 2nd case when I do:
SELECT x FROM y

the SQLNumResultCols not returns anymore!

I traced the SQLNumResultCols of PostgreSQL ODBC driver. In the 1st case, the 
sequence of id returned from H2 is: E, t, Z. In the 2nd case, it's: E, E, no 
further response, this cause the SQLNumResultCols still waiting for the end of 
the response packet.

Original issue reported on code.google.com by bjfran...@gmail.com on 11 Apr 2014 at 5:01

GoogleCodeExporter commented 9 years ago
Which version of the PostgreSQL driver is this?

Original comment by noelgrandin on 14 Apr 2014 at 8:24

GoogleCodeExporter commented 9 years ago
psqlodbc-09.03.0210, the latest version of PostgreSQL ODBC driver.

Another case, when I use isql to do:
SELECT COUNT(*) FROM t

It's Core Dumped!

Original comment by bjfran...@gmail.com on 30 Apr 2014 at 7:48

GoogleCodeExporter commented 9 years ago
Which version of H2 are you connecting to?
Because I can't see how this can be happening with the current version of H2.

Original comment by noelgrandin on 5 May 2014 at 7:28

GoogleCodeExporter commented 9 years ago
1.3.176

Original comment by bjfran...@gmail.com on 15 May 2014 at 6:40

GoogleCodeExporter commented 9 years ago
When I do ( an invalid SQL select after a valid SQL select ):

isql H2 me me
SQL> SELECT f FROM t;
SQL> SELECT x FROM t;
[ISQL]ERROR: Could not SQLExecute
quit

But when I do ( an invalid SQL select directly ):
isql H2 me me
SQL> SELECT x FROM t;

it's locked forever!
And when I do:

isql H2 me me
SQL> SELECT COUNT(*) FROM t;
Segmentation fault (core dumped)

it's core dumped!

My environment is ( all the newest version ):
unixodbc 2.3.2
psqlodbc 9.3.300
H2 1.3.176

Original comment by bjfran...@gmail.com on 22 May 2014 at 9:01

GoogleCodeExporter commented 9 years ago
I'm in 32-bits mode.
In 64-bits mode, that's OK.

Original comment by bjfran...@gmail.com on 27 May 2014 at 6:11