[Monetdb-developers] Mapi blocked mode multi query consideration
Mapi has two modes, which I refer to as line mode and block mode. The main plus for the client when using the block mode variant is that multi-line queries can be sent directly to the server without any parsing. The line mode variant, on the other hand, separates lines by newline characters, so multiline queries are not possible; one has to replace all newlines by spaces when not inside a string, otherwise by \n. (this requires some parsing of the query before sending) Now the problem I'm dealing with is as follows: If I send a multiline query using blockmode to the server, and that query is syntactically incorrect (according to the server), the server returns that same multiline query. In the result mode, however, newlines are treated as row delimiters. The effect of this, is that only the first row of the query sent is visible, which most of the time does not contain the error. For example, suppose the following query is sent: SELECT * FROM "foobar"; where the table foobar does not exist in the catalog, then the error message will be: !ERROR parse error at token (257) in statement: select * from "foobar" which due to row-style parsing will only result in the error message with query 'select *'. The question here is actually, who is doing what wrong? Any thoughts on this?
Fabian wrote:
Mapi has two modes, which I refer to as line mode and block mode. The main plus for the client when using the block mode variant is that multi-line queries can be sent directly to the server without any parsing. The line mode variant, on the other hand, separates lines by newline characters, so multiline queries are not possible; one has to replace all newlines by spaces when not inside a string, otherwise by \n. (this requires some parsing of the query before sending)
Now the problem I'm dealing with is as follows: If I send a multiline query using blockmode to the server, and that query is syntactically incorrect (according to the server), the server returns that same multiline query. In the result mode, however, newlines are treated as row delimiters. The effect of this, is that only the first row of the query sent is visible, which most of the time does not contain the error.
For example, suppose the following query is sent: SELECT * FROM "foobar";
where the table foobar does not exist in the catalog, then the error message will be: !ERROR parse error at token (257) in statement: select * from "foobar"
which due to row-style parsing will only result in the error message with query 'select *'.
The question here is actually, who is doing what wrong? Any thoughts on this?
Are you using block mode in both directions?
--
Sjoerd Mullender
participants (2)
-
Fabian
-
Sjoerd Mullender