From: drh Date: Thu, 21 Jun 2007 15:25:05 +0000 (+0000) Subject: Clarify documentation of the column metadata APIs. Make sure that the X-Git-Tag: version-3.4.1~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf2564f6123935215e7fc44dd4264f9531851d8a;p=thirdparty%2Fsqlite.git Clarify documentation of the column metadata APIs. Make sure that the new documentation claims are tested. (CVS 4107) FossilOrigin-Name: 2dafe08a91b5328a9d0df5ab29c3ff2d94ad5f6f --- diff --git a/manifest b/manifest index 0a4def3b56..d6e3bd825a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\sURL\sto\smailing\slist\sarchives.\s(CVS\s4106) -D 2007-06-21T13:30:40 +C Clarify\sdocumentation\sof\sthe\scolumn\smetadata\sAPIs.\s\sMake\ssure\sthat\sthe\nnew\sdocumentation\sclaims\sare\stested.\s(CVS\s4107) +D 2007-06-21T15:25:05 F Makefile.in 7f7485a4cc039476a42e534b3f26ec90e2f9753e F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -104,7 +104,7 @@ F src/random.c 6119474a6f6917f708c1dee25b9a8e519a620e88 F src/select.c 33a258fc9c9dccb28ae2d3a02f1e1148d6433148 F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/shell.c 4b0fc3c76a9f23a1c963e01703c0fbbca1b5c34d -F src/sqlite.h.in 42ec2b1e9186f08461d90b8268d06d3ae5cd9487 +F src/sqlite.h.in 475e0e3dbd34c151ca89423c97d878c99575c71a F src/sqlite3ext.h 7d0d363ea7327e817ef0dfe1b7eee1f171b72890 F src/sqliteInt.h ed31d1a0311c1ffc018fa2e9035a6cf7985049c8 F src/sqliteLimit.h f14609c27636ebc217c9603ade26dbdd7d0f6afa @@ -185,7 +185,7 @@ F test/btree9.test 5d8711b241145b90f65dd1795d5dd8290846fa5e F test/busy.test 0271c854738e23ad76e10d4096a698e5af29d211 F test/cache.test 9e530b55ba016ca17439f728a06898f0ade5f1da F test/capi2.test 7ecc9b342cc9ec27b53bbf95724cf2e5874fd496 -F test/capi3.test 08fe846db48d5bbf2aee1eca7804fb27f2fa602a +F test/capi3.test 1cf80839d6224126acf82eb824308981fb054ef9 F test/capi3b.test 5f0bc94b104e11086b1103b20277e1910f59c7f4 F test/capi3c.test 96e35164739c6fe3357fa36f0fe74bc23abc8ef7 F test/cast.test 0302bbc8d1be2f94da1e16ad2eb01ea356e26d18 @@ -509,7 +509,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P 314669b6cc76ab8984857c3591aa1910aac97694 -R 7dab77591ccdde744557f650d7710d3f +P af4b914a2152ce021401b6f78bb88a5323aa6fc2 +R 9c91b2e377cf682d8693c478c169d4ef U drh -Z 0b9b33667bf719d4ebe30216c3df8fd6 +Z 97256b78e966a6731710de3bdea5bd11 diff --git a/manifest.uuid b/manifest.uuid index 39e7874a23..0538e7dfd3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -af4b914a2152ce021401b6f78bb88a5323aa6fc2 \ No newline at end of file +2dafe08a91b5328a9d0df5ab29c3ff2d94ad5f6f \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 693f54da9f..59c1061129 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -30,7 +30,7 @@ ** the version number) and changes its name to "sqlite3.h" as ** part of the build process. ** -** @(#) $Id: sqlite.h.in,v 1.213 2007/06/20 09:09:48 danielk1977 Exp $ +** @(#) $Id: sqlite.h.in,v 1.214 2007/06/21 15:25:05 drh Exp $ */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ @@ -1237,10 +1237,16 @@ const void *sqlite3_column_name16(sqlite3_stmt*, int N); ** These routines provide a means to determine what column of what ** table in which database a result of a SELECT statement comes from. ** The name of the database or table or column can be returned as -** either a UTF8 or UTF16 string. The returned string is valid until +** either a UTF8 or UTF16 string. The _database_ routines return +** the database name, the _table_ routines return the table name, and +** the origin_ routines return the column name. +** The returned string is valid until ** the [sqlite3_stmt | prepared statement] is destroyed using ** [sqlite3_finalize()] or until the same information is requested -** again about the same column. +** again in a different encoding. +** +** The names returned are the original un-aliased names of the +** database, table, and column. ** ** The first argument to the following calls is a ** [sqlite3_stmt | compiled SQL statement]. @@ -1440,8 +1446,6 @@ int sqlite3_data_count(sqlite3_stmt *pStmt); ** versions of SQLite may change the behavior of sqlite3_column_type() ** following a type conversion. ** -*** The sqlite3_column_nm -** ** If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() ** routine returns the number of bytes in that BLOB or string. ** If the result is a UTF-16 string, then sqlite3_column_bytes() converts diff --git a/test/capi3.test b/test/capi3.test index c87fbd9df6..ac36b890c0 100644 --- a/test/capi3.test +++ b/test/capi3.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script testing the callback-free C/C++ API. # -# $Id: capi3.test,v 1.49 2007/06/19 10:58:24 drh Exp $ +# $Id: capi3.test,v 1.50 2007/06/21 15:25:05 drh Exp $ # set testdir [file dirname $argv0] @@ -587,6 +587,18 @@ do_test capi3-5.23 { sqlite3_finalize $STMT } SQLITE_OK +do_test capi3-5.30 { + set sql "SELECT a AS x, sum(b) AS y, max(c) AS z FROM t1 AS m GROUP BY x" + set STMT [sqlite3_prepare $DB $sql -1 TAIL] + sqlite3_column_count $STMT +} 3 + +check_header $STMT capi3-5.31 {x y z} {VARINT {} {}} +check_origin_header $STMT capi3-5.32 {main {} {}} {t1 {} {}} {a {} {}} +do_test capi3-5.33 { + sqlite3_finalize $STMT +} SQLITE_OK + set ::ENC [execsql {pragma encoding}] db close