Skip to content

Commit 25e2204

Browse files
committed
Rename method from PrepareSql to PreparedSql
This name change is motivated to prevent misunderstandings: the callback is not meant to output a prepared SQL statement. Rather, the callback is being informed of the SQL statement prepared by SQLite.
1 parent 9e10fd8 commit 25e2204

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/sqlite.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7078,7 +7078,7 @@ struct sqlite3_module {
70787078
int (*xShadowName)(const char*);
70797079
/* The methods below relate to features contributed by the community and
70807080
** are available for version 700 and greater. */
7081-
int (*xPrepareSql)(sqlite3_vtab_cursor*, const char*);
7081+
int (*xPreparedSql)(sqlite3_vtab_cursor*, const char*);
70827082
};
70837083

70847084
/*

src/test8.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ static int echoShadowName(const char *name){
12981298
return SQLITE_OK;
12991299
}
13001300

1301-
static int echoPrepareSql(sqlite3_vtab_cursor *cur, const char *sql){
1301+
static int echoPreparedSql(sqlite3_vtab_cursor *cur, const char *sql){
13021302
assert( cur );
13031303
assert( sql );
13041304
return SQLITE_OK;
@@ -1356,7 +1356,7 @@ static sqlite3_module echoModuleV2 = {
13561356
echoRelease,
13571357
echoRollbackTo,
13581358
echoShadowName,
1359-
echoPrepareSql,
1359+
echoPreparedSql,
13601360
};
13611361

13621362
/*

src/vdbe.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8073,15 +8073,15 @@ case OP_VInitIn: { /* out2 */
80738073
#endif /* SQLITE_OMIT_VIRTUALTABLE */
80748074

80758075
#ifndef SQLITE_OMIT_VIRTUALTABLE
8076-
/* Opcode: VPrepareSql P1 * * * *
8076+
/* Opcode: VPreparedSql P1 * * * *
80778077
**
80788078
** P1 is a cursor opened using VOpen.
80798079
**
8080-
** This opcode invokes the xPrepareSql method on the virtual table specified
8081-
** by P1. The SQL text parameter to xPrepareSql is obtained from Vdbe* `p`.
8080+
** This opcode invokes the xPreparedSql method on the virtual table specified
8081+
** by P1. The SQL text parameter to xPreparedSql is obtained from Vdbe* `p`.
80828082
**
80838083
*/
8084-
case OP_VPrepareSql: {
8084+
case OP_VPreparedSql: {
80858085
const sqlite3_module *pModule;
80868086
sqlite3_vtab_cursor *pVCur;
80878087
sqlite3_vtab *pVtab;
@@ -8094,10 +8094,10 @@ case OP_VPrepareSql: {
80948094
pVtab = pVCur->pVtab;
80958095
pModule = pVtab->pModule;
80968096

8097-
/* Invoke the xPrepareSql method */
8097+
/* Invoke the xPreparedSql method */
80988098
if( pModule->iVersion>=700 ){
8099-
if( pModule->xPrepareSql && p->zSql ){
8100-
rc = pModule->xPrepareSql(pVCur, p->zSql);
8099+
if( pModule->xPreparedSql && p->zSql ){
8100+
rc = pModule->xPreparedSql(pVCur, p->zSql);
81018101
if( rc ) goto abort_due_to_error;
81028102
}
81038103
}

src/wherecode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
14151415
int addrNotFound;
14161416
int nConstraint = pLoop->nLTerm;
14171417

1418-
sqlite3VdbeAddOp1(v, OP_VPrepareSql, iCur);
1418+
sqlite3VdbeAddOp1(v, OP_VPreparedSql, iCur);
14191419

14201420
iReg = sqlite3GetTempRange(pParse, nConstraint+2);
14211421
addrNotFound = pLevel->addrBrk;

test/rowvaluevtab.test

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ do_vfilter4_test 1.4f {
9696
SELECT a FROM e1 WHERE (b, c) IN ( VALUES(2, 2) )
9797
} {{SELECT rowid, a, b, c FROM 't1' WHERE b = ?}}
9898

99-
######################################################################
100-
# Test echo_v2. We simply want to ensure that OP_VPrepareSql executes
101-
######################################################################
99+
#######################################################################
100+
# Test echo_v2. We simply want to ensure that OP_VPreparedSql executes
101+
#######################################################################
102102

103103
do_execsql_test 2.0 {
104104
CREATE TABLE t2(a, b, c);
@@ -113,10 +113,10 @@ do_execsql_test 2.0 {
113113
CREATE VIRTUAL TABLE e2 USING echo_v2(t2);
114114
}
115115

116-
proc do_vpreparesql1_test {tn sql expected} {
116+
proc do_vpreparedsql1_test {tn sql expected} {
117117
set rc -1
118118
db eval "explain $sql" {
119-
if {$opcode=="VPrepareSql"} {
119+
if {$opcode=="VPreparedSql"} {
120120
set rc 0
121121
}
122122
}
@@ -128,7 +128,7 @@ proc do_vpreparesql1_test {tn sql expected} {
128128
do_execsql_test 2.1 {
129129
SELECT a FROM e2 WHERE (b, c) IN ( VALUES(1, 3) )
130130
} {three}
131-
do_vpreparesql1_test 2.1f {
131+
do_vpreparedsql1_test 2.1f {
132132
SELECT a FROM e2 WHERE (b, c) IN ( VALUES(2, 2) )
133133
} {0}
134134

0 commit comments

Comments
 (0)