From ca00c4ff31e631032388adb15322adcdee4e13dd Mon Sep 17 00:00:00 2001 From: Beno!t POLASZEK Date: Mon, 13 Jan 2020 14:41:30 +0100 Subject: Fix mysqli_fetch_field consistency --- lib/mysql.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/mysql.php b/lib/mysql.php index 924d68f..1ca8434 100644 --- a/lib/mysql.php +++ b/lib/mysql.php @@ -411,7 +411,16 @@ namespace { return false; // @codeCoverageIgnoreEnd } - return mysqli_fetch_field($result); + $res = mysqli_fetch_field($result); + $res->not_null = ($res->flags & MYSQLI_NOT_NULL_FLAG) ? 1 : 0; + $res->primary_key = ($res->flags & MYSQLI_PRI_KEY_FLAG ) ? 1 : 0; + $res->unique_key = ($res->flags & MYSQLI_UNIQUE_KEY_FLAG ) ? 1 : 0; + $res->multiple_key = ($res->flags & MYSQLI_MULTIPLE_KEY_FLAG ) ? 1 : 0; + $res->numeric = ($res->flags & MYSQLI_NUM_FLAG ) ? 1 : 0; + $res->blob = ($res->flags & MYSQLI_BLOB_FLAG ) ? 1 : 0; + $res->unsigned = ($res->flags & MYSQLI_UNSIGNED_FLAG ) ? 1 : 0; + $res->zerofill = ($res->flags & MYSQLI_ZEROFILL_FLAG ) ? 1 : 0; + return $res; } function mysql_field_seek($result, $field) -- cgit v1.1