Re: [sqlite] SQLite 3.21 on IBM Mainframe - z/OS

2017-12-26 Thread mbezzi

Quick update:

The -qdll compiler option, needed to enable dynamic extensions, causes 
problems with some SQLite commands. Removing it fixes those problems. 
For the time being I've removed the option and I will continue to test.


Thank you,
mario


On 12/25/2017 10:08 PM, Mario Bezzi wrote:

Hello,

SQLite 3.21 autoconf (sqlite-autoconf-321.zip) compiles and runs 
successfully on z/OS 2.2 with few minor modifications which I would 
like the developers to consider for integration into the code base.


Namely:

1 - In sqlite3.c, in the code section coming from tokenize.c, the 
EBCDIC version of the aiClass[] array defines codepoint 0x15 as class 
'27' (CC_ILLEGAL). In EBCDIC (both codepages 037 and 1047, the most 
common ones) 0x15 is actually NL (newline) and should be defined as 
class '7' CC_SPACE to allow the tokenizer to properly manage 
multi-line statements.


There are minor issues in the Makefile generated by ./configure:

2 - The ./configure process wrongly detects the presence of the posix 
fallocate function, which is not actually available ("checking for 
posix_fallocate... yes"), and sets -DHAVE_POSIX_FALLOCATE=1. It should 
be -DHAVE_POSIX_FALLOCATE=0. I don't know why this happens as I was 
not able to understand what the check does. I will be happy to help 
debugging it if guided.


3- In order to successfully compile sqlite3, the C compiler command 
(CC=..) should be changed from cc to xlc; the CFLAGS option should be 
set to "CFLAGS = -g -qFLOAT=IEEE -qstrict -qdll" and 
"-D_XOPEN_SOURCE=600" should be added to the current DEFS.


If needed I have a diff generated pach for 1) and another one for 2) 
3) to make the required changes better understandable.


With these changes the process to build sqlite is as simple as:

1- Upload a non compressed tarball of the autoconf version of SQLite 
to a file in your OMVS environment (let say the file is called 
sqlite-autoconf-321.tar)


From your OMVS shell issue the following commands

2- pax -ofrom=iso8859-1,to=ibm-1047 -rf sqlite-autoconf-321.tar 
(the "to" codepage in the pax command must be set to your actual 
EBCDIC codepage)


3- ./configure --enable-dynamic-extension (I need this option myself 
but of course it is not mandatory)


4- for the time being manually apply the changes described above

5- make

Et voilĂ .

At the moment I am testing with the sqlite3 cli, and I can perform 
normal operations and load and use dynamic extensions.


I will keep testing and I will report other issues if any.

Hope this helps,

mario




___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Function patternCompare() not EBCDIC friendly

2015-12-30 Thread mbezzi
Roland,

   I am pleased to see that you are successfully using SQLite on z/OS. 
Are you using the standard amalgamation? Did you need to apply special 
mods to SQLite to work on z/OS? Would you mind sharing your build procedure?

Few months ago I tried compiling SQLite on z/OS: It worked but the 
data-bases generated on z/OS contains text data in EBCDIC format, 
including metadata, which makes those data-bases unusable on other 
platforms. The opposite was also true in my experience: Data-bases 
created on other platforms (I tried Linux) are not usable on z/OS for 
the very same reason.

At that time I've spent some time trying to find where SQLite required 
to be modified to change this behavior, but this resulted a too hard 
assignment given my limited understanding of SQLite internals.

Did you face the same issue? Did you find a solution? Anybody willing to 
help here giving guidance on what should be changed in SQLite to have 
text data and meta-data stored in UTF-8 format under z/OS?

Thank you,
mario


On 12/30/2015 04:55 PM, Roland Martin wrote:
> I have tested the code change on z/OS and it works.
>
> Thanks for the quick turnaround!
>
> Roland Martin
>
> -Original Message-
> From: drhsqlite at gmail.com [mailto:drhsqlite at gmail.com] On Behalf Of 
> Richard Hipp
> Sent: Wednesday, December 30, 2015 9:08 AM
> To: SQLite mailing list
> Cc: rolandsmartin at gmail.com
> Subject: Re: [sqlite] Function patternCompare() not EBCDIC friendly
>
> On 12/30/15, Roland Martin  wrote:
>> Working with version 3.9.2 on IBM z/OS case insensitive LIKE queries
>> do not work if case does not match.
>
> Please test and let us know if the
> https://www.sqlite.org/src/info/0a99a8c4facf65ec check-in fixes your problem.
>
> --
> D. Richard Hipp
> drh at sqlite.org
>
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>