SQLite User Forum

Proposed tiny change for SQLite on IBM z/OS
Login

Proposed tiny change for SQLite on IBM z/OS

(1) By Mario Bezzi (subscriptions.mario.bezzi) on 2021-03-19 13:54:55 [source]

With the IBM XL C compiler used to compile SQLite on IBM z/OS mainframe systems, the default C locale is supported by code page IBM-1047. 

In this code page the code point 0x15 is valid and represents the newline character. 

In its aiClass[] array, sqlite3.c marks code point 0x15 as invalid (0x28 - CC_ILLEGAL). This causes SQLite on z/OS to reject valid multi line SQL statements. 

I would like to propose the below tiny change, only affecting the EBCDIC implementation, which marks code point 0x15 as valid (CC_SPACE - 0x07) and fixes the problem. The diff is against v3.35.2.

--- sqlite3.c.original	2021-03-18 19:27:49.040156985 +0100
+++ sqlite3.c	2021-03-18 19:27:41.876206726 +0100
@@ -162308,7 +162308,7 @@
 #ifdef SQLITE_EBCDIC
 /*         x0  x1  x2  x3  x4  x5  x6  x7  x8  x9  xa  xb  xc  xd  xe  xf */
 /* 0x */   29, 28, 28, 28, 28,  7, 28, 28, 28, 28, 28, 28,  7,  7, 28, 28,
-/* 1x */   28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+/* 1x */   28, 28, 28, 28, 28,  7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
 /* 2x */   28, 28, 28, 28, 28,  7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
 /* 3x */   28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
 /* 4x */    7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 26, 12, 17, 20, 10,

Thank you,
mario

(2) By Larry Brasfield (larrybr) on 2021-03-19 15:05:47 in reply to 1 [link] [source]

Thanks for the report. This has been fixed on the trunk. There is likely to be a patch release soon incorporating this change.

(3) By Mario Bezzi (subscriptions.mario.bezzi) on 2021-03-19 15:43:43 in reply to 2 [link] [source]

Thank you Larry!

mario