mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
MFH: const pointer was used in non-const context
This commit is contained in:
parent
e45c0bb900
commit
4bccb4565d
1 changed files with 12 additions and 4 deletions
|
@ -282,6 +282,8 @@ static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsi
|
|||
static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC)
|
||||
{
|
||||
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
|
||||
const char *_str;
|
||||
size_t _str_len;
|
||||
char *str;
|
||||
zval *flags;
|
||||
|
||||
|
@ -318,14 +320,20 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, long colno, zval *return_v
|
|||
break;
|
||||
}
|
||||
|
||||
str = (char*)sqlite3_column_decltype(S->stmt, colno);
|
||||
if (str) {
|
||||
_str = sqlite3_column_decltype(S->stmt, colno);
|
||||
_str_len = strlen(_str);
|
||||
if (_str) {
|
||||
str = emalloc(_str_len);
|
||||
strcpy(str, _str);
|
||||
add_assoc_string(return_value, "sqlite:decl_type", str, 1);
|
||||
}
|
||||
|
||||
#ifdef SQLITE_ENABLE_COLUMN_METADATA
|
||||
str = sqlite3_column_table_name(S->stmt, colno);
|
||||
if (str) {
|
||||
_str = sqlite3_column_table_name(S->stmt, colno);
|
||||
_str_len = strlen(_str);
|
||||
if (_str) {
|
||||
str = emalloc(_str_len);
|
||||
strcpy(str, _str);
|
||||
add_assoc_string(return_value, "table", str, 1);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue