** Prepare an SQL statement using the results of a printf() formatting. */
| 8696 | ** Prepare an SQL statement using the results of a printf() formatting. |
| 8697 | */ |
| 8698 | static int idxPrintfPrepareStmt( |
| 8699 | sqlite3 *db, /* Database handle to compile against */ |
| 8700 | sqlite3_stmt **ppStmt, /* OUT: Compiled SQL statement */ |
| 8701 | char **pzErrmsg, /* OUT: sqlite3_malloc()ed error message */ |
| 8702 | const char *zFmt, /* printf() format of SQL statement */ |
| 8703 | ... /* Trailing printf() arguments */ |
| 8704 | ){ |
| 8705 | va_list ap; |
| 8706 | int rc; |
| 8707 | char *zSql; |
| 8708 | va_start(ap, zFmt); |
| 8709 | zSql = sqlite3_vmprintf(zFmt, ap); |
| 8710 | if( zSql==0 ){ |
| 8711 | rc = SQLITE_NOMEM; |
| 8712 | }else{ |
| 8713 | rc = idxPrepareStmt(db, ppStmt, pzErrmsg, zSql); |
| 8714 | sqlite3_free(zSql); |
| 8715 | } |
| 8716 | va_end(ap); |
| 8717 | return rc; |
| 8718 | } |
| 8719 | |
| 8720 | |
| 8721 | /************************************************************************* |
no test coverage detected