mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Refactor PDO's last inserted ID handler to use and return zend_string
Closes GH-6617
This commit is contained in:
parent
94ea8e247b
commit
a78aea8948
9 changed files with 40 additions and 46 deletions
|
@ -216,14 +216,11 @@ static zend_long sqlite_handle_doer(pdo_dbh_t *dbh, const zend_string *sql)
|
|||
}
|
||||
}
|
||||
|
||||
static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, size_t *len)
|
||||
static zend_string *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const zend_string *name)
|
||||
{
|
||||
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
|
||||
char *id;
|
||||
|
||||
id = php_pdo_int64_to_str(sqlite3_last_insert_rowid(H->db));
|
||||
*len = strlen(id);
|
||||
return id;
|
||||
return php_pdo_int64_to_str(sqlite3_last_insert_rowid(H->db));
|
||||
}
|
||||
|
||||
/* NB: doesn't handle binary strings... use prepared stmts for that */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue