Starting with verison 16 of postgresql-odbc, the test wchar-char started to fail, but only on s390x arch. It fails no matter what postgresql server is in the buildroot and the test itself did not change from the latest included postgresql-odbc version (which was 13). The build succeeds on F38 though. Reproducible: Always Steps to Reproduce: 1. build postgresql-odbc v16 on s390x 2. 3. Actual Results: wchar-char test fails Expected Results: all tests succeed The relevant difference in the output vs. what is expected is someting related to locales: ``` ... ok 41 - numeric ok 42 - large-object ok 43 - large-object-data-at-exec ok 44 - odbc-escapes not ok 45 - wchar-char test output differs ok 46 - params-batch-exec ok 47 - fetch-refcursors make: *** [Makefile:33: installcheck] Error 1 === trying to find all regression.diffs files in build directory === + echo '=== trying to find all regression.diffs files in build directory ===' + find -name regression.diffs + read line + cat ./regression.diffs *** ./expected/wchar-char.out 2023-09-15 02:49:52.000000000 +0000 --- results/wchar-char.out 2023-12-25 01:34:07.804943823 +0000 *************** *** 1,5 **** connected ! SJIS test ! ANSI=���͈�㔎�j�ł��B�M���͐ē��_����ł��ˁH ! U+79C1U+306FU+4E95U+4E0AU+535AU+53F2U+3067U+3059U+3002U+8CB4U+65B9U+306FU+6589U+85E4U+6D69U+3055U+3093U+3067U+3059U+306DU+FF1F disconnecting --- 1,9 ---- connected ! UTF8 test ! *** wcs_debug = 0 *** ! ANSI=私は镎婓です。貴方は斉藤浩さんですね? 𠀋𡈽𡌛𡑮𡢽𪐷𪗱𪘂 ! U+C179U+6F30U+4E95U+4E0AU+535AU+53F2U+6730U+5930U+0230U+B48CU+B965U+6F30U+8965U+E485U+696DU+5530U+9330U+6730U+5930U+6D30U+1FFFU+2000U+2000U+40D8U+0BDCU+44D8U+3DDEU+44D8U+1BDFU+45D8U+6EDCU+46D8U+BDDCU+69D8U+37DCU+69D8U+F1DDU+69D8U+02DE ! *** wcs_debug = 1 *** ! ANSI=私は镎婓です。貴方は斉藤浩さんですね? 𠀋𡈽𡌛𡑮𡢽𪐷𪗱𪘂 ! U+C179U+6F30U+4E95U+4E0AU+535AU+53F2U+6730U+5930U+0230U+B48CU+B965U+6F30U+8965U+E485U+696DU+5530U+9330U+6730U+5930U+6D30U+1FFFU+2000U+2000U+40D8U+0BDCU+44D8U+3DDEU+44D8U+1BDFU+45D8U+6EDCU+46D8U+BDDCU+69D8U+37DCU+69D8U+F1DDU+69D8U+02DE disconnecting ... ``` The test also includes several outputs, while the test suite is implemented the way it tries to compare with all the possible expected outputs and the smallest diff is used. The log above seems like wrong output is picked, but even if I hacked it so the UTF variant is used, the result was slightly different (in some bytes only, but made the diff actually bigger, so the test suite correctly picked a different diff): ``` *** ./expected/wchar-char.out 2024-01-05 20:40:46.690858126 +0000 --- results/wchar-char.out 2024-01-05 20:40:50.770858126 +0000 *************** *** 1,9 **** connected UTF8 test *** wcs_debug = 0 *** ! ANSI=私は井上博史です。貴方は斉藤浩さんですね? 𠀋𡈽𡌛𡑮𡢽𪐷𪗱𪘂 ! U+79C1U+306FU+4E95U+4E0AU+535AU+53F2U+3067U+3059U+3002U+8CB4U+65B9U+306FU+6589U+85E4U+6D69U+3055U+3093U+3067U+3059U+306DU+FF1FU+0020U+0020U+D840U+DC0BU+D844U+DE3DU+D844U+DF1BU+D845U+DC6EU+D846U+DCBDU+D869U+DC37U+D869U+DDF1U+D869U+DE02 *** wcs_debug = 1 *** ! ANSI=私は井上博史です。貴方は斉藤浩さんですね? 𠀋𡈽𡌛𡑮𡢽𪐷𪗱𪘂 ! U+79C1U+306FU+4E95U+4E0AU+535AU+53F2U+3067U+3059U+3002U+8CB4U+65B9U+306FU+6589U+85E4U+6D69U+3055U+3093U+3067U+3059U+306DU+FF1FU+0020U+0020U+D840U+DC0BU+D844U+DE3DU+D844U+DF1BU+D845U+DC6EU+D846U+DCBDU+D869U+DC37U+D869U+DDF1U+D869U+DE02 disconnecting --- 1,9 ---- connected UTF8 test *** wcs_debug = 0 *** ! ANSI=私は镎婓です。貴方は斉藤浩さんですね? 𠀋𡈽𡌛𡑮𡢽𪐷𪗱𪘂 ! U+C179U+6F30U+4E95U+4E0AU+535AU+53F2U+6730U+5930U+0230U+B48CU+B965U+6F30U+8965U+E485U+696DU+5530U+9330U+6730U+5930U+6D30U+1FFFU+2000U+2000U+40D8U+0BDCU+44D8U+3DDEU+44D8U+1BDFU+45D8U+6EDCU+46D8U+BDDCU+69D8U+37DCU+69D8U+F1DDU+69D8U+02DE *** wcs_debug = 1 *** ! ANSI=私は镎婓です。貴方は斉藤浩さんですね? 𠀋𡈽𡌛𡑮𡢽𪐷𪗱𪘂 ! U+C179U+6F30U+4E95U+4E0AU+535AU+53F2U+6730U+5930U+0230U+B48CU+B965U+6F30U+8965U+E485U+696DU+5530U+9330U+6730U+5930U+6D30U+1FFFU+2000U+2000U+40D8U+0BDCU+44D8U+3DDEU+44D8U+1BDFU+45D8U+6EDCU+46D8U+BDDCU+69D8U+37DCU+69D8U+F1DDU+69D8U+02DE disconnecting ```
The test is disabled now on s390x in order to avoid FTBFS, this BZ should serve as a reminder that we need to look at it better.
For the record the UTF part of the test fails due to conversion to the native endianity which it assumes to be LE, failing on the s390x. Working on patch for this. Still investigating the ANSI part. To note prior to the 16.0 the test has been actually always skipped, not executed due to some issue in the tests locale detection code, I don't plan to investigate that further. Took the liberty to take this BZ.
I have opened PR https://src.fedoraproject.org/rpms/postgresql-odbc/pull-request/5 with fix. It fixes the inline data a endianity conversion and assures that the test output is checked against the "utf8" locale tests case making sure that possible silent failures in future don't happen. I think that the test case in general could use make over towards utf16/ucs2 literals and other bits from more contemporary C, but I do lack the general upstream context to attempt it.