summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r--ext/mysqli/mysqli_api.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index dab3cd73a2..175b9b8076 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -1149,21 +1149,17 @@ PHP_FUNCTION(mysqli_stmt_fetch)
static void php_add_field_properties(zval *value, const MYSQL_FIELD *field TSRMLS_DC)
{
#ifdef MYSQLI_USE_MYSQLND
- add_property_str(value, "name", STR_COPY(field->name));
- add_property_str(value, "orgname", STR_COPY(field->org_name));
- add_property_str(value, "table", STR_COPY(field->table));
- add_property_str(value, "orgtable", STR_COPY(field->org_table));
- add_property_str(value, "def", field->def? STR_COPY(field->def) : STR_EMPTY_ALLOC());
- add_property_str(value, "db", STR_COPY(field->db));
+ add_property_str(value, "name", STR_COPY(field->sname));
#else
- add_property_string(value, "name",(field->name ? field->name : ""));
- add_property_string(value, "orgname",(field->org_name ? field->org_name : ""));
- add_property_string(value, "table",(field->table ? field->table : ""));
- add_property_string(value, "orgtable",(field->org_table ? field->org_table : ""));
- add_property_string(value, "def",(field->def ? field->def : ""));
- add_property_string(value, "db",(field->db ? field->db : ""));
+ add_property_string(value, "name",(field->name ? field->name : ""), field->name_length);
#endif
+ add_property_stringl(value, "orgname", (field->org_name ? field->org_name : ""), field->org_name_length);
+ add_property_stringl(value, "table", (field->table ? field->table : ""), field->table_length);
+ add_property_stringl(value, "orgtable", (field->org_table ? field->org_table : ""), field->org_table_length);
+ add_property_stringl(value, "def", (field->def ? field->def : ""), field->def_length);
+ add_property_stringl(value, "db", (field->db ? field->db : ""), field->db_length);
+
/* FIXME: manually set the catalog to "def" due to bug in
* libmysqlclient which does not initialize field->catalog
* and in addition, the catalog is always be "def"