[sqlite] sqlite3: col name bug on select statemnt

2010-11-04 Thread geefwfge201011
[critical bug] sqlite3: col name bug on select statemnt

sqlite3 --version
3.7.3

this bug occures with count or sum .

 
c:\tmp sqlite3 test3.db

.header ON

-- bug
drop table t1;
drop table t2;
drop table t3;
CREATE  TABLE t1 (col1 INTEGER);
INSERT INTO t1 VALUES(1);
CREATE  TABLE t2 as select col1 , count(*) from t1;
CREATE  TABLE t3 as select col1 , sum(col1) from t1;
SELECT * FROM t2;
SELECT * FROM t3;
SELECT [col1] FROM t2;
SELECT [col1] FROM t3;
.schema t2
.schema t3
--- Error: no such column: col1
--- Result : CREATE TABLE t2(col1 INT,count(*));
  ^^^^
 workaround : CREATE  TABLE t2 as select col1  as 'col1' , count(*) from 
t1;

-- bug
drop table t1;
drop table t2;
CREATE  TABLE t1 ([col-1] INTEGER);
CREATE  TABLE t2 as select [col-1] , count(*) from t1;
.schema t2
--- Result : CREATE TABLE t2([col-1] INT,count(*));

-- bug
drop table t1;
drop table t2;
CREATE  TABLE t1 (col-1 INTEGER);
CREATE  TABLE t2 as select col-1 , count(*) from t1;
.schema t2
--- Result : CREATE TABLE t2(col-1 INT,count(*));

-- bug
drop table t1;
drop table t2;
CREATE  TABLE t1 ('col1' INTEGER);
CREATE  TABLE t2 as select col1 , count(*) from t1;
.schema t2
--- Result : CREATE TABLE t2(col1 INT,count(*));
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite.exe db_name .dump : It missed : table name is un quoted.(INSERT statement)

2010-11-04 Thread geefwfge201011
sqlite.exe db_name .dump
It missed : table name is un quoted.(INSERT statement)
database conversion fails (version 2 to 3)

sqlite -version
2.8.17

- dump_test.sql
create table where (id INTEGER);
   INSERT INTO where VALUES(1);
---

@rem create database
sqlite.exe dump_test.db  dump_test.sql

sqlite.exe dump_test.db .dump  test1.sql
@rem test1.sql : missed : table name is un quoted.

sqlite.exe dump_test.db .dump | sqlite3.exe test_db3.db
@rem sqlite3.exe test_db3.db  test1.sql
@rem  error occures.
@rem  : syntax error
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users