Re: [BUGS] Parser failed to return an error
От | Tatsuo Ishii |
---|---|
Тема | Re: [BUGS] Parser failed to return an error |
Дата | |
Msg-id | 20170204.080929.854322444185739335.t-ishii@sraoss.co.jp обсуждение исходный текст |
Ответ на | [BUGS] Parser failed to return an error (rob stone <floriparob@gmail.com>) |
Ответы |
Re: [BUGS] Parser failed to return an error
|
Список | pgsql-bugs |
> Linux roblaptop 4.9.0-1-amd64 #1 SMP Debian 4.9.2-2 (2017-01-12) x86_64 > GNU/Linux > > > I was running a query like:- > > SELECT TO_CHAR(my_date,'dd-mm-yyyy) FROM my_table; > > and I forgot to type the second single quotation mark at the end of the > mask string. > > Under psql it just hung and I had to Ctrl-C to go back to a prompt and > under JDBC it hung as well and EQ just said "error", as in a failure of > some sort. > > I would have expected either a 42601 error or maybe a 03000 error to > have been returned. > > > If you need any further information, please let me know. Sounds like psql application or JDBC specific behaviors (not sure expected ones though). I was able to confirm that the PostgreSQL backend correctly returns a 42601 error in this case by using "pgproto" (https://github.com/tatsuo-ishii/pgproto), which handles PostgreSQL frontend/backend protocol in low level. $ pgproto -f /tmp/p -d test FE=> Query(query="CREATE TABLE my_table(my_date date);") <= BE CommandComplete(CREATE TABLE) <= BE ReadyForQuery(I) FE=> Query(query="SELECT TO_CHAR(my_date,'dd-mm-yyyy) FROM my_table;") <= BE ErrorResponse(S ERROR V ERROR C 42601 M unterminated quoted string at or near "'dd-mm-yyyy) FROM my_table;" P 24 Fscan.l L 1086 R scanner_yyerror ) <= BE ReadyForQuery(I) FE=> Terminate The test data used: ------------------------------------------------- # Create table 'Q' "CREATE TABLE my_table(my_date date);" # Read reply from backend 'Y' # Issue the query in question 'Q' "SELECT TO_CHAR(my_date,'dd-mm-yyyy) FROM my_table;" # Read reply from backend 'Y' # Terminate session 'X' ------------------------------------------------- Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese:http://www.sraoss.co.jp -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs
В списке pgsql-bugs по дате отправления: