diff mbox series

[meta-oe,2/2] psqlodbc: fix a failing ptest

Message ID 20251023144351.264756-2-skandigraun@gmail.com
State New
Headers show
Series [meta-oe,1/2] psqlodbc: upgrade 16.00.0000 -> 17.00.0006 | expand

Commit Message

Gyorgy Sarvari Oct. 23, 2025, 2:43 p.m. UTC
The descrec test fails currently, due to the different characterwidth
postgres uses depending on the current locale.

If the locale is C or posix, then each character is 1 byte. Otherwise,
if it's some UTF8 locale, then it is 4 bytes.

The test case expects 4 byte width by default, making it fail. This backported patch
allows for both 4 and 1 byte characters to be tested successfully.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 ...xpected-output-file-for-descrec-test.patch | 72 +++++++++++++++++++
 .../psqlodbc/psqlodbc_17.00.0006.bb           |  1 +
 2 files changed, 73 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/psqlodbc/files/add-expected-output-file-for-descrec-test.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-dbs/psqlodbc/files/add-expected-output-file-for-descrec-test.patch b/meta-oe/recipes-dbs/psqlodbc/files/add-expected-output-file-for-descrec-test.patch
new file mode 100644
index 0000000000..af25b207c8
--- /dev/null
+++ b/meta-oe/recipes-dbs/psqlodbc/files/add-expected-output-file-for-descrec-test.patch
@@ -0,0 +1,72 @@ 
+From 453a8bdcaafde9fcd108a195ffea3ccb5c4d0a21 Mon Sep 17 00:00:00 2001
+From: Christoph Berg <myon@debian.org>
+Date: Mon, 16 Jun 2025 20:25:26 +0200
+Subject: [PATCH] Add expected output file for descrec test in C locale (#131)
+
+When running with LC_ALL=C, SQL_DESC_OCTET_LENGTH matches the character
+length. Add "10" as accepted value.
+
+The net diff to the existing descrec.out file is this:
+
+ test/expected/descrec.out	2025-06-13 19:02:36.460302799 +0200
+ test/expected/descrec_2.out	2025-06-16 14:34:44.270543393 +0200
+ @@ -19,7 +19,7 @@
+  -- Column 3 --
+  SQL_DESC_NAME: col3
+  SQL_DESC_TYPE: 12
+ -SQL_DESC_OCTET_LENGTH: 40
+ +SQL_DESC_OCTET_LENGTH: 10
+  SQL_DESC_PRECISION: 0
+  SQL_DESC_SCALE: 0
+  SQL_DESC_NULLABLE: 0
+
+Fixes #51.
+
+Upstream-Status: Backport [https://github.com/postgresql-interfaces/psqlodbc/commit/453a8bdcaafde9fcd108a195ffea3ccb5c4d0a21]
+Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
+
+---
+ test/expected/descrec_2.out | 34 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 34 insertions(+)
+ create mode 100644 test/expected/descrec_2.out
+
+diff --git a/test/expected/descrec_2.out b/test/expected/descrec_2.out
+new file mode 100644
+index 0000000..6f61c49
+--- /dev/null
++++ b/test/expected/descrec_2.out
+@@ -0,0 +1,34 @@
++connected
++
++-- Column 1 --
++SQL_DESC_NAME: col1
++SQL_DESC_TYPE: 4
++SQL_DESC_OCTET_LENGTH: 0
++SQL_DESC_PRECISION: 0
++SQL_DESC_SCALE: 0
++SQL_DESC_NULLABLE: 0
++
++-- Column 2 --
++SQL_DESC_NAME: col2
++SQL_DESC_TYPE: 2
++SQL_DESC_OCTET_LENGTH: 6
++SQL_DESC_PRECISION: 4
++SQL_DESC_SCALE: 2
++SQL_DESC_NULLABLE: 1
++
++-- Column 3 --
++SQL_DESC_NAME: col3
++SQL_DESC_TYPE: 12
++SQL_DESC_OCTET_LENGTH: 10
++SQL_DESC_PRECISION: 0
++SQL_DESC_SCALE: 0
++SQL_DESC_NULLABLE: 0
++
++-- Column 4 --
++SQL_DESC_NAME: col4
++SQL_DESC_TYPE: -5
++SQL_DESC_OCTET_LENGTH: 8
++SQL_DESC_PRECISION: 0
++SQL_DESC_SCALE: 0
++SQL_DESC_NULLABLE: 0
++disconnecting
diff --git a/meta-oe/recipes-dbs/psqlodbc/psqlodbc_17.00.0006.bb b/meta-oe/recipes-dbs/psqlodbc/psqlodbc_17.00.0006.bb
index cead6789f4..2fbd8b78e4 100644
--- a/meta-oe/recipes-dbs/psqlodbc/psqlodbc_17.00.0006.bb
+++ b/meta-oe/recipes-dbs/psqlodbc/psqlodbc_17.00.0006.bb
@@ -24,6 +24,7 @@  SRC_URI = "git://github.com/postgresql-interfaces/psqlodbc.git;protocol=https;br
     file://psqlodbc-remove-some-checks-for-cross-compiling.patch \
     file://psqlodbc-donot-use-the-hardcode-libdir.patch \
     file://psqlodbc-fix-for-ptest-support.patch \
+    file://add-expected-output-file-for-descrec-test.patch \
     file://run-ptest \
 "