BUG #15837: Precompiling embedded SQL applications which are created by SJIS character code is failed.

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #15837: Precompiling embedded SQL applications which are created by SJIS character code is failed.
Дата
Msg-id 15837-5d1f2dbc5db0ef0c@postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15837
Logged by:          daisuke higuchi
Email address:      higuchi.daisuke@jp.fujitsu.com
PostgreSQL version: 11.3
Operating system:   Windows 10
Description:

Precompiling some embedded SQL applications which are created by SJIS
character code is failed. 
SJIS (*1) is general character code on Japanese Windows OS, so I expected
that precompiling is succeeded. 
I show the sample application code and the error message. 

(1) 
When trying to precompile the following application,
"test_sjis_printf.pgc:9: ERROR: unterminated quoted identifier" is output:

[test_sjis_printf.pgc]
----------------------------------------------------------------
#include <stdio.h>
int main()
{
    printf("表");
    EXEC SQL CONNECT TO tcp:postgresql://localhost:5432/postgres AS con1
USER postgres/postgres;
    EXEC SQL DISCONNECT;
    return 0;
}
----------------------------------------------------------------

(2) 
When trying to precompile the following application, "test_sjis_sql.pgc:11:
ERROR: syntax error at or near ";"" is output: 
[test_sjis_sql.pgc]
----------------------------------------------------------------
#include <stdio.h>

EXEC SQL BEGIN DECLARE SECTION;
    char    tmpstr[1024];
EXEC SQL END DECLARE SECTION;

int
main()
{
    EXEC SQL CONNECT TO tcp:postgresql://localhost:5432/postgres AS con1
USER postgres/postgres;
    EXEC SQL select * INTO :tmpstr from 端;
    printf("values = %s \n", tmpstr);
    EXEC SQL DISCONNECT;
    return 0;
}
----------------------------------------------------------------

If above application is created with UTF-8 character set, precompiling is
succeeded. 
So, I think ecpg precompiler could not deal with SJIS character set
properly. 
- The character "表" is represented by 2 bytes "95 5C", so I think
precompiler recognize the second byte is backslash. 
- The character "端" is represented by 2 bytes "92 5B", so I think
precompiler recognize the second byte is '['. 

(*1) https://en.wikipedia.org/wiki/Shift_JIS

Regards,


В списке pgsql-bugs по дате отправления:

Предыдущее
От: Prakash Ramakrishnan
Дата:
Сообщение: space issue in 11 server
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Test suite fails on macOS after update to 9.6.13 and 11.3