[fpc-pascal] TMemoField saving empty strings as '' (double quote)

LacaK lacak at zoznam.sk
Wed Sep 11 15:01:26 CEST 2013


silvioprog  wrote / napísal(a):
> 2013/9/11 LacaK <lacak at zoznam.sk <mailto:lacak at zoznam.sk>>
>
>     silvioprog  wrote / napísal(a): Now doing more tests. I see, that
>     in pgAdmin when I use right click on table and use "View Data"
>     then '' (two single quotes) are shown in TEXT column, but when I
>     use SQL and type:
>     select * from <table name> then empty fields are shown ... so it
>     seems to me, that bug is in pgAdmin, does not ?
>     -Laco.
>
>
> The bug is in FCL. Please see the steps in my comparison:
>
> 1. first I inserted a record via pgAdmin: insert into test (id, 
> fieldtext) values (1, null);
Try in pgAdmin do:
insert into test (id, fieldtext) values (1, '');
Then use "View Data" and you will see two single quotes instead of empty 
cell.

> 2. after, I executed this demo: http://pastebin.com/HS8DZkDV;
> 3. finally, I made this selection in pgAdmin:
>   select * from test
>   where fieldtext is null;
>
> And the result is:
>
> id | fieldtext
> -----------------
> 1  |
>
> But, when I select so:
>
> select * from test
> where fieldtext = ''
>
> The result is:
>
> id | fieldtext
> -----------------
> 2  |
>
> Then SQLdb is saving an empty string instead of null. :o
>
Yes it is true for your version of bufdataset.pas, but it is fixed in trunk.

L.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130911/0a67913e/attachment.html>


More information about the fpc-pascal mailing list