Bug? Confused data entry with column name

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug? Confused data entry with column name

Dale Mellor
>>>>>>>>  THIS VERSION
SQLite 3.25.3 2018-11-05 20:37:38
89e099fbe5e13c33e683bef07361231ca525b88f7907be7092058007b750alt1
zlib version 1.2.8
gcc-8.2.0


>>>>>>>>>   THIS SCRIPT
create table test (id varchar, description varchar);
insert into test (id, description) values ("Description", "Duh");
insert into test (id, description) values ("Daft", "Daft");
select rowid, * from test where id="Description";



>>>>>>>>>>   PRODUCES
2|Daft|Daft



>>>>>>>>>>   BUT EXPECTED
1|Description|Duh

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[Fwd: Bug? Confused data entry with column name]

Dale Mellor
-------- Forwarded Message --------
From: Dale Mellor <[hidden email]>
To: [hidden email]
Subject: Bug?  Confused data entry with column name
Date: Wed, 28 Nov 2018 05:42:16 +0000

> > > > > > > > > >   THIS SCRIPT
>
> create table test (id varchar, description varchar);
> insert into test (id, description) values ("Description", "Duh");
> insert into test (id, description) values ("Daft", "Daft");
> select rowid, * from test where id="Description";


Okay,  single quotes/double quotes,  my mistake.  I just read the SQL
standard.  Please ignore my previous posting.

Sorry,
Dale

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bug? Confused data entry with column name

Shawn Wagner
In reply to this post by Dale Mellor
Use single quotes, not double. Double quotes are used for identifiers, not
strings, so that matches rows where id and description have the same value.

On Wed, Nov 28, 2018, 1:19 AM Dale Mellor <[hidden email] wrote:

> >>>>>>>>  THIS VERSION
> SQLite 3.25.3 2018-11-05 20:37:38
> 89e099fbe5e13c33e683bef07361231ca525b88f7907be7092058007b750alt1
> zlib version 1.2.8
> gcc-8.2.0
>
>
> >>>>>>>>>   THIS SCRIPT
> create table test (id varchar, description varchar);
> insert into test (id, description) values ("Description", "Duh");
> insert into test (id, description) values ("Daft", "Daft");
> select rowid, * from test where id="Description";
>
>
>
> >>>>>>>>>>   PRODUCES
> 2|Daft|Daft
>
>
>
> >>>>>>>>>>   BUT EXPECTED
> 1|Description|Duh
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] Bug? Confused data entry with column name

Hick Gunter
In reply to this post by Dale Mellor
Works as advertised. "Description" (with double quotes) is a field name. 'Description' with single quotes is a string constant.

-----Urspr√ľngliche Nachricht-----
Von: sqlite-users [mailto:[hidden email]] Im Auftrag von Dale Mellor
Gesendet: Mittwoch, 28. November 2018 06:42
An: [hidden email]
Betreff: [EXTERNAL] [sqlite] Bug? Confused data entry with column name

>>>>>>>>  THIS VERSION
SQLite 3.25.3 2018-11-05 20:37:38
89e099fbe5e13c33e683bef07361231ca525b88f7907be7092058007b750alt1
zlib version 1.2.8
gcc-8.2.0


>>>>>>>>>   THIS SCRIPT
create table test (id varchar, description varchar); insert into test (id, description) values ("Description", "Duh"); insert into test (id, description) values ("Daft", "Daft"); select rowid, * from test where id="Description";



>>>>>>>>>>   PRODUCES
2|Daft|Daft



>>>>>>>>>>   BUT EXPECTED
1|Description|Duh


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] Bug? Confused data entry with column name

E.Pasma
and the confusing behaviour is admitted to be a "quirk" in SQLite:
https://sqlite.org/quirks.html#double_quoted_string_literals_are_accepted
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Bug? Confused data entry with column name

Keith Medcalf
In reply to this post by Dale Mellor

That is because some daft person is using the wrong quotes, doh!


---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.


>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>[hidden email]] On Behalf Of Dale Mellor
>Sent: Tuesday, 27 November, 2018 22:42
>To: [hidden email]
>Subject: [sqlite] Bug? Confused data entry with column name
>
>>>>>>>>>  THIS VERSION
>SQLite 3.25.3 2018-11-05 20:37:38
>89e099fbe5e13c33e683bef07361231ca525b88f7907be7092058007b750alt1
>zlib version 1.2.8
>gcc-8.2.0
>
>
>>>>>>>>>>   THIS SCRIPT
>create table test (id varchar, description varchar);
>insert into test (id, description) values ("Description", "Duh");
>insert into test (id, description) values ("Daft", "Daft");
>select rowid, * from test where id="Description";
>
>
>
>>>>>>>>>>>   PRODUCES
>2|Daft|Daft
>
>
>
>>>>>>>>>>>   BUT EXPECTED
>1|Description|Duh



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users