Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Implement the experimental sqlite3_bind_parameter_count() API in support of DBD::SQLite. Also fix the sqlite3.def export list. (CVS 1797) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
c44943e6fe0c88830102253591a501dc |
User & Date: | drh 2004-07-15 14:15:01.000 |
Context
2004-07-15
| ||
20:08 | Added tests for sqlite3_changes after a DELETE. (CVS 1798) (check-in: c01f13267f user: drh tags: trunk) | |
14:15 | Implement the experimental sqlite3_bind_parameter_count() API in support of DBD::SQLite. Also fix the sqlite3.def export list. (CVS 1797) (check-in: c44943e6fe user: drh tags: trunk) | |
13:37 | Make SrcList.nSrc a signed quantity to avoid problems in AIX. (CVS 1796) (check-in: f2bb83cfd7 user: drh tags: trunk) | |
Changes
Changes to publish.sh.
︙ | ︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # script. # srcdir=`echo "$0" | sed 's%\(^.*\)/[^/][^/]*$%\1%'` # Get the makefile. # cp $srcdir/Makefile.linux-gcc ./Makefile chmod +x $srcdir/install-sh # Get the current version number - needed to help build filenames # VERS=`cat $srcdir/VERSION` VERSW=`sed 's/\./_/g' $srcdir/VERSION` | > | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # script. # srcdir=`echo "$0" | sed 's%\(^.*\)/[^/][^/]*$%\1%'` # Get the makefile. # cp $srcdir/Makefile.linux-gcc ./Makefile cp $srcdir/sqlite3.def ./sqlite3.def chmod +x $srcdir/install-sh # Get the current version number - needed to help build filenames # VERS=`cat $srcdir/VERSION` VERSW=`sed 's/\./_/g' $srcdir/VERSION` |
︙ | ︙ | |||
78 79 80 81 82 83 84 85 | --driver-name i386-mingw32msvc-gcc \ --dlltool-name i386-mingw32msvc-dlltool \ --as i386-mingw32msvc-as \ --target i386-mingw32 \ -dllname tclsqlite3.dll -lmsvcrt *.o $TCLSTUBLIB i386-mingw32msvc-strip tclsqlite3.dll rm tclsqlite.o cat >sqlite3.def <<\END_OF_FILE | > < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | --driver-name i386-mingw32msvc-gcc \ --dlltool-name i386-mingw32msvc-dlltool \ --as i386-mingw32msvc-as \ --target i386-mingw32 \ -dllname tclsqlite3.dll -lmsvcrt *.o $TCLSTUBLIB i386-mingw32msvc-strip tclsqlite3.dll rm tclsqlite.o cp ../sqlite3.def . cat >sqlite3.def <<\END_OF_FILE i386-mingw32msvc-dllwrap \ --def sqlite3.def -v --export-all \ --driver-name i386-mingw32msvc-gcc \ --dlltool-name i386-mingw32msvc-dlltool \ --as i386-mingw32msvc-as \ --target i386-mingw32 \ -dllname sqlite3.dll -lmsvcrt *.o |
︙ | ︙ |
Changes to sqlite3.def.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | EXPORTS sqlite3_aggregate_context sqlite3_aggregate_count sqlite3_bind_blob sqlite3_bind_double sqlite3_bind_int sqlite3_bind_int64 sqlite3_bind_null sqlite3_bind_text sqlite3_bind_text16 sqlite3_busy_handler sqlite3_busy_timeout sqlite3_changes sqlite3_close sqlite3_collation_needed | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | EXPORTS sqlite3_aggregate_context sqlite3_aggregate_count sqlite3_bind_blob sqlite3_bind_double sqlite3_bind_int sqlite3_bind_int64 sqlite3_bind_null sqlite3_bind_parameter_count sqlite3_bind_text sqlite3_bind_text16 sqlite3_busy_handler sqlite3_busy_timeout sqlite3_changes sqlite3_close sqlite3_collation_needed |
︙ | ︙ |
Changes to src/sqlite.h.in.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the SQLite library ** presents to client programs. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the SQLite library ** presents to client programs. ** ** @(#) $Id: sqlite.h.in,v 1.108 2004/07/15 14:15:02 drh Exp $ */ #ifndef _SQLITE_H_ #define _SQLITE_H_ #include <stdarg.h> /* Needed for the definition of va_list */ /* ** Make sure we can call this stuff from C++. |
︙ | ︙ | |||
617 618 619 620 621 622 623 624 625 626 627 628 629 630 | int sqlite3_bind_int(sqlite3_stmt*, int, int); int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite_int64); int sqlite3_bind_null(sqlite3_stmt*, int); int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*)); int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); /* ** Return the number of columns in the result set returned by the compiled ** SQL statement. This routine returns 0 if pStmt is an SQL statement ** that does not return data (for example an UPDATE). */ int sqlite3_column_count(sqlite3_stmt *pStmt); | > > > > > > > > | 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | int sqlite3_bind_int(sqlite3_stmt*, int, int); int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite_int64); int sqlite3_bind_null(sqlite3_stmt*, int); int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*)); int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); /* ** Return the number of wildcards in a compiled SQL statement. This ** routine was added to support DBD::SQLite. ** **** EXPERIMENTAL ***** */ int sqlite3_bind_parameter_count(sqlite3_stmt*); /* ** Return the number of columns in the result set returned by the compiled ** SQL statement. This routine returns 0 if pStmt is an SQL statement ** that does not return data (for example an UPDATE). */ int sqlite3_column_count(sqlite3_stmt *pStmt); |
︙ | ︙ |
Changes to src/test1.c.
︙ | ︙ | |||
9 10 11 12 13 14 15 | ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing the printf() interface to SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing the printf() interface to SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** ** $Id: test1.c,v 1.93 2004/07/15 14:15:02 drh Exp $ */ #include "sqliteInt.h" #include "tcl.h" #include "os.h" #include <stdlib.h> #include <string.h> |
︙ | ︙ | |||
1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 | rc = sqlite3_bind_blob(pStmt, idx, value, bytes, SQLITE_TRANSIENT); if( rc!=SQLITE_OK ){ return TCL_ERROR; } return TCL_OK; } /* ** Usage: sqlite3_errcode DB ** ** Return the string representation of the most recent sqlite3_* API ** error code. e.g. "SQLITE_ERROR". */ | > > > > > > > > > > > > > > > > > > > > > > | 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 | rc = sqlite3_bind_blob(pStmt, idx, value, bytes, SQLITE_TRANSIENT); if( rc!=SQLITE_OK ){ return TCL_ERROR; } return TCL_OK; } /* ** Usage: sqlite3_bind_parameter_count STMT ** ** Return the number of wildcards in the given statement. */ static int test_bind_parameter_count( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ sqlite3_stmt *pStmt; if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "STMT"); return TCL_ERROR; } if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_bind_parameter_count(pStmt))); return TCL_OK; } /* ** Usage: sqlite3_errcode DB ** ** Return the string representation of the most recent sqlite3_* API ** error code. e.g. "SQLITE_ERROR". */ |
︙ | ︙ | |||
2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 | { "sqlite3_bind_int", test_bind_int, 0 }, { "sqlite3_bind_int64", test_bind_int64, 0 }, { "sqlite3_bind_double", test_bind_double, 0 }, { "sqlite3_bind_null", test_bind_null ,0 }, { "sqlite3_bind_text", test_bind_text ,0 }, { "sqlite3_bind_text16", test_bind_text16 ,0 }, { "sqlite3_bind_blob", test_bind_blob ,0 }, { "sqlite3_errcode", test_errcode ,0 }, { "sqlite3_errmsg", test_errmsg ,0 }, { "sqlite3_errmsg16", test_errmsg16 ,0 }, { "sqlite3_open", test_open ,0 }, { "sqlite3_open16", test_open16 ,0 }, { "sqlite3_complete16", test_complete16 ,0 }, | > | 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 | { "sqlite3_bind_int", test_bind_int, 0 }, { "sqlite3_bind_int64", test_bind_int64, 0 }, { "sqlite3_bind_double", test_bind_double, 0 }, { "sqlite3_bind_null", test_bind_null ,0 }, { "sqlite3_bind_text", test_bind_text ,0 }, { "sqlite3_bind_text16", test_bind_text16 ,0 }, { "sqlite3_bind_blob", test_bind_blob ,0 }, { "sqlite3_bind_parameter_count", test_bind_parameter_count, 0}, { "sqlite3_errcode", test_errcode ,0 }, { "sqlite3_errmsg", test_errmsg ,0 }, { "sqlite3_errmsg16", test_errmsg16 ,0 }, { "sqlite3_open", test_open ,0 }, { "sqlite3_open16", test_open16 ,0 }, { "sqlite3_complete16", test_complete16 ,0 }, |
︙ | ︙ |
Changes to src/vdbeapi.c.
︙ | ︙ | |||
510 511 512 513 514 515 516 | rc = sqlite3VdbeMemSetStr(pVar, zData, nData, SQLITE_UTF16NATIVE, xDel); if( rc ){ return rc; } rc = sqlite3VdbeChangeEncoding(pVar, p->db->enc); return rc; } | > > > > > > > > > > | 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 | rc = sqlite3VdbeMemSetStr(pVar, zData, nData, SQLITE_UTF16NATIVE, xDel); if( rc ){ return rc; } rc = sqlite3VdbeChangeEncoding(pVar, p->db->enc); return rc; } /* ** Return the number of wildcards that can be potentially bound to. ** This routine is added to support DBD::SQLite. ** ******** EXPERIMENTAL ******* */ int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){ return ((Vdbe*)pStmt)->nVar; } |
Changes to test/bind.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 2003 September 6 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script testing the sqlite_bind API. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2003 September 6 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script testing the sqlite_bind API. # # $Id: bind.test,v 1.15 2004/07/15 14:15:02 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl proc sqlite_step {stmt N VALS COLS} { upvar VALS vals |
︙ | ︙ | |||
37 38 39 40 41 42 43 44 45 46 47 48 49 50 | do_test bind-1.1 { db close set DB [sqlite3 db test.db] execsql {CREATE TABLE t1(a,b,c)} set VM [sqlite3_prepare $DB {INSERT INTO t1 VALUES(?,?,?)} -1 TAIL] set TAIL } {} do_test bind-1.2 { sqlite_step $VM N VALUES COLNAMES } {SQLITE_DONE} do_test bind-1.3 { execsql {SELECT rowid, * FROM t1} } {1 {} {} {}} do_test bind-1.4 { | > > > | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | do_test bind-1.1 { db close set DB [sqlite3 db test.db] execsql {CREATE TABLE t1(a,b,c)} set VM [sqlite3_prepare $DB {INSERT INTO t1 VALUES(?,?,?)} -1 TAIL] set TAIL } {} do_test bind-1.1.1 { sqlite3_bind_parameter_count $VM } 3 do_test bind-1.2 { sqlite_step $VM N VALUES COLNAMES } {SQLITE_DONE} do_test bind-1.3 { execsql {SELECT rowid, * FROM t1} } {1 {} {} {}} do_test bind-1.4 { |
︙ | ︙ |
Changes to www/support.tcl.
|
| | | 1 2 3 4 5 6 7 8 | set rcsid {$Id: support.tcl,v 1.3 2004/07/15 14:15:02 drh Exp $} source common.tcl header {SQLite Support Options} puts { <h2>SQLite Support Options</h2> <h3>Mailing List</h3> |
︙ | ︙ | |||
23 24 25 26 27 28 29 | sqlite-users-help@sqlite.org</a> and instructions will be sent by to you by return email. </p> <p> An archive of the mailing list can be found at <a href="http://www.mail-archive.com/sqlite-users%40sqlite.org/"> | | > > | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | sqlite-users-help@sqlite.org</a> and instructions will be sent by to you by return email. </p> <p> An archive of the mailing list can be found at <a href="http://www.mail-archive.com/sqlite-users%40sqlite.org/"> http://www.mail-archive.com/sqlite-users%40sqlite.org</a> and at <a href="http://www.theaimsgroup.com/"> http://www.theaimsgroup.com/</a>. </p> <h3>Professional Support</h3> <p> If you would like professional support for SQLite or if you want custom modifications to SQLite performed by the |
︙ | ︙ |