[fpc-pascal]SQLite and NULL Strings...

James Mills prologic at daisy.ods.org
Mon Jul 14 08:55:19 CEST 2003


Hi,

This is a very weird behaviour I've found of either SQLite, or the Unit.
I'm not sure... I have been discussing this same problem on the SQLite
mailing list but without success there, so perhaps someone here might
know...

I have attached a test database, which contains 1 database entry, null
strings are inserted using NULL... Check the database schema yourself.

The problem therein lies in the fact that test3.pas returns "" for the
query: SELECT channelNotice FROM channels WHERE channel LIKE '#ProLogiTech';
It should return a null string as it does in test2.pas and in the sqlite
shell program.

$ ./test2
Creating class
Fields Names -------------------
0 -> channel
1 -> owner
2 -> regTime
3 -> state
4 -> URL
5 -> email
6 -> channelNotice
7 -> joins
8 -> peak
9 -> games
10 -> modeLocked
11 -> mailLevel
12 -> restrict
13 -> entries
14 -> quota
15 -> channelIdle
16 -> noIdle
17 -> lastSuspension
18 -> hideAccess
19 -> keepTopic
20 -> onChannel
21 -> opRestrict
22 -> funMsg
23 -> mustId
24 -> tellAdd
25 -> tellDel
26 -> tellSet
27 -> msgNotice
28 -> topic
29 -> topicSetter
30 -> lastTopic
31 -> autoCmd
32 -> modes
Fields -------------------
0 -> #ProLogiTech  prologic  1057934559  REGISTERED        1  1      0  0  1  50  0  OFF    NO  YES  YES  NO  NO  NO  NO  NO  NO  NO          

$ ./test3
Creating class
Fields Names -------------------
0 -> channelNotice
Fields -------------------
0 -> ""  

This should be: 0 ->  

Any ideas anyone  ?
The attached sqlite.pas and sqlitedb.pas were put together by Michael,
myself and Eric Jourde (possibly ported from tsqlite I hear)

cheers
James

-- 
-
- James Mills
Zero Defect Software Engineers Group - ZDSEG
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2.pas
Type: text/x-pascal
Size: 873 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20030714/aa09855c/attachment.pas>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test3.pas
Type: text/x-pascal
Size: 885 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20030714/aa09855c/attachment-0001.pas>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: channels.db
Type: application/octet-stream
Size: 4096 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20030714/aa09855c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqlite.pas
Type: text/x-pascal
Size: 10359 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20030714/aa09855c/attachment-0002.pas>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqlitedb.pas
Type: text/x-pascal
Size: 10357 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20030714/aa09855c/attachment-0003.pas>


More information about the fpc-pascal mailing list