[MonetDB-users] JDBC: Not all results returned
Hi, I have a simple SQL script which starts like this: CREATE TABLE people ( pid integer NOT NULL PRIMARY KEY, name varchar(40) NOT NULL DEFAULT '', number varchar(15) NOT NULL UNIQUE DEFAULT '0', email varchar(100) NOT NULL, spid integer NOT NULL DEFAULT '0' ); Afterwards, it inserts 251 People with ascending pids from 0 to 250. I apply it to the MonetDB database either with MapiClient, or JDBCClient. However, if I login with the JDBCClient and do a "select name,number from people;" i only get 250 rows, not 251! But no error is reported. Instead, a "select count(*) from people;" returns 251. if i try the same with the MapiClient, everything works as expected. the problem seems to be with other tables, too, but there the count of returned rows another one, so I expect it has something to with a packet limit, or something? is it a configuration thing or a bug? with 2.8.2 everything worked. if executed from a java program, the statement returns the exception "protocol violation: unexpected line in data block:"
On Wed, Feb 15, 2006 at 12:07:08AM +0100, Martin Beck wrote:
Hi, I have a simple SQL script which starts like this: CREATE TABLE people ( pid integer NOT NULL PRIMARY KEY, name varchar(40) NOT NULL DEFAULT '', number varchar(15) NOT NULL UNIQUE DEFAULT '0', email varchar(100) NOT NULL, spid integer NOT NULL DEFAULT '0' );
Afterwards, it inserts 251 People with ascending pids from 0 to 250. I apply it to the MonetDB database either with MapiClient, or JDBCClient. However, if I login with the JDBCClient and do a "select name,number from people;" i only get 250 rows, not 251! But no error is reported. Instead, a "select count(*) from people;" returns 251.
if i try the same with the MapiClient, everything works as expected.
the problem seems to be with other tables, too, but there the count of returned rows another one, so I expect it has something to with a packet limit, or something? is it a configuration thing or a bug? with 2.8.2 everything worked.
if executed from a java program, the statement returns the exception "protocol violation: unexpected line in data block:"
The 2.8.2 version had a default result size of 250 rows. So all seems fine. The way to fix this problem is to set the reply size. For example SET REPLY_SIZE=1000; Niels
------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
On 15-02-2006 08:54:29 +0100, Niels Nes wrote:
if executed from a java program, the statement returns the exception "protocol violation: unexpected line in data block:"
The 2.8.2 version had a default result size of 250 rows. So all seems fine. The way to fix this problem is to set the reply size. For example SET REPLY_SIZE=1000;
That shouldn't cause JdbcClient to spit out the protocol violation error. Or better, not spit it out. The reason this last row is missing for sure has to do with the protocol violation JDBC reports. I will look into it. Do you have by any chance also the 251 INSERT statements for easy testing for me? Thanks!
Fabian Groffen schrieb:
On 15-02-2006 08:54:29 +0100, Niels Nes wrote:
if executed from a java program, the statement returns the exception "protocol violation: unexpected line in data block:" The 2.8.2 version had a default result size of 250 rows. So all seems fine. The way to fix this problem is to set the reply size. For example SET REPLY_SIZE=1000;
That shouldn't cause JdbcClient to spit out the protocol violation error. Or better, not spit it out. The reason this last row is missing for sure has to do with the protocol violation JDBC reports. I will look into it.
Do you have by any chance also the 251 INSERT statements for easy testing for me? As I stated, for example another table with a smaller rowsize, gives me 2750 result rows instead of expected 10000. (using ver. 2.10). Using 2.8.2 there was no problem with exactly the same tables.
However, I've send the script to Fabian, so he tries to look into it. Anyone, who wants to give it a try himself should leave me a mail, thanks
On 15-02-2006 10:27:10 +0100, Martin Beck wrote:
Do you have by any chance also the 251 INSERT statements for easy testing for me? As I stated, for example another table with a smaller rowsize, gives me 2750 result rows instead of expected 10000. (using ver. 2.10). Using 2.8.2 there was no problem with exactly the same tables.
Interesting. I will run your script, thanks for that.
On 15-02-2006 11:04:23 +0100, Fabian Groffen wrote:
On 15-02-2006 10:27:10 +0100, Martin Beck wrote:
Do you have by any chance also the 251 INSERT statements for easy testing for me? As I stated, for example another table with a smaller rowsize, gives me 2750 result rows instead of expected 10000. (using ver. 2.10). Using 2.8.2 there was no problem with exactly the same tables.
Interesting. I will run your script, thanks for that.
Ok, also JdbcClient reports the problem: % java -jar jars/jdbcclient-1.3.jar sWelcome to the MonetDB interactive % JDBC terminal! Database: MonetDB 4.9.3 Driver: MonetDB Native Driver 1.3 (Spur_devel 20060215) Type \q to quit, \h for a list of available commands auto commit mode: on monetdb->\d TABLE sys.people monetdb-> select count(*) from people; +-----------+ | count_pid | +===========+ | 251 | +-----------+ 1 row monetdb-> select name from people; Error: protocol violation: unexpected line in data block: +----------------------------+ | name | +============================+ ... monetdb-> it unexpectedly ends the query result output, and appears to get an empty row it doesn't expect.
On 15-02-2006 11:29:45 +0100, Fabian Groffen wrote:
monetdb-> select name from people; Error: protocol violation: unexpected line in data block:
JDBC is right, the server sends this: &6 1 1 2500 250 (&6 id columncount rowcount offset) which means the server claims 2500 rows will follow, while in fact only one is sent (which is the last row actually), hence JDBC reports the prompt it sees as unexpected, since it waits for another 2499 rows to come.
Fabian Groffen schrieb:
On 15-02-2006 11:29:45 +0100, Fabian Groffen wrote:
monetdb-> select name from people; Error: protocol violation: unexpected line in data block:
JDBC is right, the server sends this: &6 1 1 2500 250
(&6 id columncount rowcount offset)
which means the server claims 2500 rows will follow, while in fact only one is sent (which is the last row actually), hence JDBC reports the prompt it sees as unexpected, since it waits for another 2499 rows to come.
Is there any possibility to do a workaround? Or do I have to download source and patch it? Martin
On 23-02-2006 14:58:29 +0100, Martin Beck wrote:
Is there any possibility to do a workaround? Or do I have to download source and patch it?
I'm sorry, you can't workaround it, unless you are happy with a limit 250. (But also that isn't water proof.) You will have to download a recent stable sources snapshot from our site and compile and install it.
participants (3)
-
Fabian Groffen
-
Martin Beck
-
Niels Nes