On 2017/01/04 4:11 PM, Ken Wagner wrote:
Simon,
Yes, I am using the SQLite3 CLI. That's how I discovered the different
GLOB outcomes.
I now understand that the SQLite3 GLOB function is not fully
documented so it's best to just experiment with the GLOB function at
the CLI for SQLite3. And avoid using SQLite3 versions prior to 3.15.
It's doable. Just adds extra work requiring checking.
Again, as far as SQLite is concerned, I see no difference between
version 3.15/3.15 and 3.9 (did not check earlier versions). Can you give
an example of where different versions of SQLite (not DB Browser or any
other 3rd party tools) differ in its implementation? i.e. example
Database, Query and SQLite CLI versions which produces different answers
- because if this is really true, you may have stumbled on a bug. (You
say it worked differently in 3.11 at the very least?)
Here is a script that can be run, and below it I include the results of
how that script runs in SQLitespeed using SQLite version 3.16 (which
runs the same for SQLite 3.9, but I don't have a 3.11 DLL handy). Maybe
you can run it in 3.11 or whatever other one you think isn't working
(CLI that is) and post the result - Thanks.
CREATE TABLE t(a);
INSERT INTO t (a) VALUES
(''),
('5'),
('5AB'),
('A5B'),
('AB5');
SELECT rowid, * FROM t WHERE a GLOB '*[0-9]*';
SELECT rowid, * FROM t WHERE a GLOB '*[^0-9]*';
SELECT rowid, * FROM t WHERE a NOT GLOB '*[0-9]*';
DROP TABLE t;
------------------------
Script result:
-- SQLite version 3.16.1 [ Release: 2017-01-03 ] on SQLitespeed
version 2.0.2.4.
-- Script Items: 6 Parameter Count: 0
-- 2017-01-04 16:27:57.181 | [Info] Script Initialized,
Started executing...
--
================================================================================================
CREATE TABLE t(a);
INSERT INTO t (a) VALUES
(''),
('5'),
('5AB'),
('A5B'),
('AB5');
SELECT rowid, * FROM t WHERE a GLOB '*[0-9]*';
-- rowid | a
-- ------------ | -----
-- 2 | 5
-- 3 | 5AB
-- 4 | A5B
-- 5 | AB5
SELECT rowid, * FROM t WHERE a GLOB '*[^0-9]*';
-- rowid | a
-- ------------ | -----
-- 3 | 5AB
-- 4 | A5B
-- 5 | AB5
SELECT rowid, * FROM t WHERE a NOT GLOB '*[0-9]*';
-- rowid | a
-- ------------ | ---
-- 1 |
DROP TABLE t;
-- Script Stats: Total Script Execution Time: 0d 00h 00m and
00.016s
-- Total Script Query Time: -- --- --- ---
--.----
-- Total Database Rows Changed: 5
-- Total Virtual-Machine Steps: 319
-- Last executed Item Index: 6
-- Last Script Error:
--
------------------------------------------------------------------------------------------------
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users