OLD | NEW |
1 /* | 1 /* |
2 ** 2007 September 9 | 2 ** 2007 September 9 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 | 601 |
602 assert(rc==SQLITE_OK || pStmt==0); | 602 assert(rc==SQLITE_OK || pStmt==0); |
603 if( zTail && objc>=5 ){ | 603 if( zTail && objc>=5 ){ |
604 if( bytes>=0 ){ | 604 if( bytes>=0 ){ |
605 bytes = bytes - (zTail-zSql); | 605 bytes = bytes - (zTail-zSql); |
606 } | 606 } |
607 Tcl_ObjSetVar2(interp, objv[4], 0, Tcl_NewStringObj(zTail, bytes), 0); | 607 Tcl_ObjSetVar2(interp, objv[4], 0, Tcl_NewStringObj(zTail, bytes), 0); |
608 } | 608 } |
609 if( rc!=SQLITE_OK ){ | 609 if( rc!=SQLITE_OK ){ |
610 assert( pStmt==0 ); | 610 assert( pStmt==0 ); |
611 sprintf(zBuf, "%s ", (char *)sqlite3ErrName(rc)); | 611 sqlite3_snprintf(sizeof(zBuf), zBuf, "%s ", (char *)sqlite3ErrName(rc)); |
612 Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), 0); | 612 Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), 0); |
613 return TCL_ERROR; | 613 return TCL_ERROR; |
614 } | 614 } |
615 | 615 |
616 if( pStmt ){ | 616 if( pStmt ){ |
617 if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; | 617 if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; |
618 Tcl_AppendResult(interp, zBuf, 0); | 618 Tcl_AppendResult(interp, zBuf, 0); |
619 } | 619 } |
620 return TCL_OK; | 620 return TCL_OK; |
621 } | 621 } |
(...skipping 16 matching lines...) Expand all Loading... |
638 Tcl_CreateObjCommand(interp, | 638 Tcl_CreateObjCommand(interp, |
639 "sqlite3_nonblocking_prepare_v2", blocking_prepare_v2_proc, 0, 0); | 639 "sqlite3_nonblocking_prepare_v2", blocking_prepare_v2_proc, 0, 0); |
640 #endif | 640 #endif |
641 return TCL_OK; | 641 return TCL_OK; |
642 } | 642 } |
643 #else | 643 #else |
644 int SqlitetestThread_Init(Tcl_Interp *interp){ | 644 int SqlitetestThread_Init(Tcl_Interp *interp){ |
645 return TCL_OK; | 645 return TCL_OK; |
646 } | 646 } |
647 #endif | 647 #endif |
OLD | NEW |