From 727a99f1e313adecf162cf7c3199cc496d87099e Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 16 Jan 2014 21:59:51 +0000 Subject: [PATCH] Tweaks to error message text. FossilOrigin-Name: 090a77d97808b86d1e9f5c63c743a2b159a15f5d --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/build.c | 2 +- src/select.c | 10 +++++----- test/with1.test | 23 ++++++++++------------- 5 files changed, 26 insertions(+), 29 deletions(-) diff --git a/manifest b/manifest index 9f4c9c003b..f942fc379a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\sthe\serror\smessages\sused\sto\sreport\sillegal\srecursive\scte\sreferences. -D 2014-01-16T21:02:02.206 +C Tweaks\sto\serror\smessage\stext. +D 2014-01-16T21:59:51.988 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -169,7 +169,7 @@ F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7 F src/btree.c c15e1722696b66c4029c487acfb830b0985bf142 F src/btree.h a61ddebc78c66795a2b93181321a116746302cc9 F src/btreeInt.h f038e818bfadf75afbd09819ed93c26a333d39e0 -F src/build.c a6b9ba918f9194e955d198402076fe3203ff2567 +F src/build.c 7e6c275ab1731510d6f793d0f88373ab3e858e69 F src/callback.c 174e3c8656bc29f91d710ab61550d16eea34be98 F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac F src/ctime.c 77779efbe78dd678d84bfb4fc2e87b6b6ad8dccd @@ -219,7 +219,7 @@ F src/printf.c 85d07756e45d7496d19439dcae3e6e9e0090f269 F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece F src/resolve.c ae278d8ce037883323f677e78c241f64289f12ec F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0 -F src/select.c 1b058f7ef37e2667fd33921531480a616a04bca2 +F src/select.c d75733ab2ad5e9f0d79fb4ab9f45d3d3d3675a3d F src/shell.c 9f3bc02a658b8f61d2cbe60cfc482f660c1c6c48 F src/sqlite.h.in d94a8b89522f526ba711182ee161e06f8669bcc9 F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e @@ -1091,7 +1091,7 @@ F test/wild001.test bca33f499866f04c24510d74baf1e578d4e44b1c F test/win32heap.test ea19770974795cff26e11575e12d422dbd16893c F test/win32lock.test 7a6bd73a5dcdee39b5bb93e92395e1773a194361 F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d -F test/with1.test f1602892682cd9bfa5b3b0a5d04b2283b61e7982 +F test/with1.test 90490c75e98e1914d84b7cef9e636b48917a020f F test/withM.test 52448ce23e1c2ecba79d10e130ee49ce9f9a2a7a F test/without_rowid1.test aaa26da19d543cd8d3d2d0e686dfa255556c15c8 F test/without_rowid2.test af260339f79d13cb220288b67cd287fbcf81ad99 @@ -1150,7 +1150,7 @@ F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P a296b73360d34c9364eceb2cc09a9a92adc4abb8 -R 20dd6a1609afa0cf73fe04c795b9e1e4 -U dan -Z 6bd9745179436f1c3b8a75548e64bd7b +P 54eee9fe99290e59469bd3e1a66bb749887d37ee +R 7385964692340c50e255f43b779c83ed +U drh +Z 3d3568f983c7b2bd0c47dd0558e3c02c diff --git a/manifest.uuid b/manifest.uuid index 2e74fdae17..bdfa111f79 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -54eee9fe99290e59469bd3e1a66bb749887d37ee \ No newline at end of file +090a77d97808b86d1e9f5c63c743a2b159a15f5d \ No newline at end of file diff --git a/src/build.c b/src/build.c index 353c938074..fa7364c3da 100644 --- a/src/build.c +++ b/src/build.c @@ -4222,7 +4222,7 @@ With *sqlite3WithAdd( int i; for(i=0; inCte; i++){ if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){ - sqlite3ErrorMsg(pParse, "duplicate cte name: %s", zName); + sqlite3ErrorMsg(pParse, "duplicate WITH table name: %s", zName); } } } diff --git a/src/select.c b/src/select.c index 7b6c5e9c2c..ae2e0ce655 100644 --- a/src/select.c +++ b/src/select.c @@ -3609,20 +3609,20 @@ static int withExpand( /* Only one recursive reference is permitted. */ if( pTab->nRef>2 ){ sqlite3ErrorMsg( - pParse, "multiple recursive references in cte: %s", pCte->zName + pParse, "multiple references to recursive table: %s", pCte->zName ); return WRC_Abort; } assert( pTab->nRef==1 || ((pSel->selFlags&SF_Recursive) && pTab->nRef==2 )); - pCte->zErr = "circular reference to cte: %s"; + pCte->zErr = "circular reference: %s"; sqlite3WalkSelect(pWalker, bMayRecursive ? pSel->pPrior : pSel); for(pLeft=pSel; pLeft->pPrior; pLeft=pLeft->pPrior); pEList = pLeft->pEList; if( pCte->pCols ){ if( pEList->nExpr!=pCte->pCols->nExpr ){ - sqlite3ErrorMsg(pParse, "cte \"%s\" returns %d values for %d columns", + sqlite3ErrorMsg(pParse, "table %s has %d values for %d columns", pCte->zName, pEList->nExpr, pCte->pCols->nExpr ); return WRC_Abort; @@ -3633,9 +3633,9 @@ static int withExpand( if( bMayRecursive ){ if( pSel->selFlags & SF_Recursive ){ - pCte->zErr = "multiple recursive references in cte: %s"; + pCte->zErr = "multiple recursive references: %s"; }else{ - pCte->zErr = "recursive reference may not appear in sub-query: %s"; + pCte->zErr = "recursive reference in a subquery: %s"; } sqlite3WalkSelect(pWalker, pSel); } diff --git a/test/with1.test b/test/with1.test index 4ad6260b78..db0d7bc36e 100644 --- a/test/with1.test +++ b/test/with1.test @@ -79,14 +79,14 @@ do_catchsql_test 3.1 { WITH tmp2(x) AS ( SELECT * FROM tmp1 ), tmp1(a) AS ( SELECT * FROM tmp2 ) SELECT * FROM tmp1; -} {1 {circular reference to cte: tmp1}} +} {1 {circular reference: tmp1}} do_catchsql_test 3.2 { CREATE TABLE t2(x INTEGER); WITH tmp(a) AS (SELECT * FROM t1), tmp(a) AS (SELECT * FROM t1) SELECT * FROM tmp; -} {1 {duplicate cte name: tmp}} +} {1 {duplicate WITH table name: tmp}} do_execsql_test 3.3 { CREATE TABLE t3(x); @@ -172,23 +172,23 @@ do_execsql_test 5.5 { do_catchsql_test 5.6.1 { WITH i(x, y) AS ( VALUES(1) ) SELECT * FROM i; -} {1 {cte "i" returns 1 values for 2 columns}} +} {1 {table i has 1 values for 2 columns}} do_catchsql_test 5.6.2 { WITH i(x) AS ( VALUES(1,2) ) SELECT * FROM i; -} {1 {cte "i" returns 2 values for 1 columns}} +} {1 {table i has 2 values for 1 columns}} do_catchsql_test 5.6.3 { CREATE TABLE t5(a, b); WITH i(x) AS ( SELECT * FROM t5 ) SELECT * FROM i; -} {1 {cte "i" returns 2 values for 1 columns}} +} {1 {table i has 2 values for 1 columns}} do_catchsql_test 5.6.4 { WITH i(x) AS ( SELECT 1, 2 UNION ALL SELECT 1 ) SELECT * FROM i; -} {1 {cte "i" returns 2 values for 1 columns}} +} {1 {table i has 2 values for 1 columns}} do_catchsql_test 5.6.5 { WITH i(x) AS ( SELECT 1 UNION ALL SELECT 1, 2 ) @@ -203,7 +203,7 @@ do_catchsql_test 5.6.6 { do_catchsql_test 5.6.7 { WITH i(x) AS ( SELECT 1, 2 UNION SELECT x+1 FROM i ) SELECT * FROM i; -} {1 {cte "i" returns 2 values for 1 columns}} +} {1 {table i has 2 values for 1 columns}} #------------------------------------------------------------------------- # @@ -304,7 +304,7 @@ do_catchsql_test 7.4 { SELECT i FROM tree WHERE p IN (SELECT id FROM t) ) SELECT id FROM t; -} {1 {recursive reference may not appear in sub-query: t}} +} {1 {recursive reference in a subquery: t}} do_catchsql_test 7.5 { WITH t(id) AS ( @@ -313,7 +313,7 @@ do_catchsql_test 7.5 { SELECT i FROM tree, t WHERE p = id AND p IN (SELECT id FROM t) ) SELECT id FROM t; -} {1 {multiple recursive references in cte: t}} +} {1 {multiple recursive references: t}} do_catchsql_test 7.6 { WITH t(id) AS ( @@ -322,11 +322,8 @@ do_catchsql_test 7.6 { SELECT i FROM tree, t WHERE p = id ) SELECT id FROM t; -} {1 {circular reference to cte: t}} +} {1 {circular reference: t}} finish_test - - -