1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Correct handling of views on tables with quoted column names. Ticket #756. (CVS 1826)

FossilOrigin-Name: 8ac5a8ad5eec381585adb6812fc39a1a30aee4c1
This commit is contained in:
drh
2004-07-20 00:20:23 +00:00
parent bab39e1358
commit 2c61c070d2
5 changed files with 30 additions and 14 deletions

View File

@ -12,7 +12,7 @@
# focus of this file is testing SELECT statements that are part of
# expressions.
#
# $Id: subselect.test,v 1.7 2002/07/15 18:55:26 drh Exp $
# $Id: subselect.test,v 1.8 2004/07/20 00:20:23 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -150,6 +150,4 @@ do_test subselect-3.9 {
}
} {4}
finish_test

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing VIEW statements.
#
# $Id: view.test,v 1.17 2004/06/19 00:16:32 drh Exp $
# $Id: view.test,v 1.18 2004/07/20 00:20:23 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -385,5 +385,22 @@ do_test view-9.6 {
}
} {3 4 4 2 5 1}
# Tables with columns having peculiar quoted names used in views
# Ticket #756.
#
do_test view-10.1 {
execsql {
CREATE TABLE t3("9" integer, [4] text);
INSERT INTO t3 VALUES(1,2);
CREATE VIEW v_t3_a AS SELECT a.[9] FROM t3 AS a;
CREATE VIEW v_t3_b AS SELECT "4" FROM t3;
SELECT * FROM v_t3_a;
}
} {1}
do_test view-10.2 {
execsql {
SELECT * FROM v_t3_b;
}
} {2}
finish_test