mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
PDO MySQL: Use mysqlnd column names
mysqlnd already creates interned zend_strings for us, so let's make use of them. This also required updating the PDO case changing code to work with potentially shared strings. For the lowercasing, use the optimized zend_string_tolower() implementation.
This commit is contained in:
parent
1a66d64717
commit
205d209de9
3 changed files with 27 additions and 11 deletions
|
@ -619,7 +619,11 @@ static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
|
|||
if (S->H->fetch_table_names) {
|
||||
cols[i].name = strpprintf(0, "%s.%s", S->fields[i].table, S->fields[i].name);
|
||||
} else {
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
cols[i].name = zend_string_copy(S->fields[i].sname);
|
||||
#else
|
||||
cols[i].name = zend_string_init(S->fields[i].name, S->fields[i].name_length, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
cols[i].precision = S->fields[i].decimals;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue