mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fix GH-8267: MySQLi uses unsupported format specifier on Windows
This commit is contained in:
commit
22f8886038
6
NEWS
6
NEWS
@ -17,7 +17,11 @@ PHP NEWS
|
||||
- Hash:
|
||||
. Fixed bug #81714 (segfault when serializing finalized HashContext). (cmb)
|
||||
|
||||
31 Mar 2022, PHP 8.1.5
|
||||
- MySQLi:
|
||||
. Fixed bug GH-8267 (MySQLi uses unsupported format specifier on Windows).
|
||||
(cmb)
|
||||
|
||||
14 Apr 2022, PHP 8.1.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug GH-8176 (Enum values in property initializers leak). (Bob)
|
||||
|
@ -127,8 +127,6 @@ typedef struct {
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_MYSQLI_API __declspec(dllexport)
|
||||
#define MYSQLI_LLU_SPEC "%I64u"
|
||||
#define MYSQLI_LL_SPEC "%I64d"
|
||||
#ifndef L64
|
||||
#define L64(x) x##i64
|
||||
#endif
|
||||
@ -139,16 +137,17 @@ typedef __int64 my_longlong;
|
||||
# else
|
||||
# define PHP_MYSQLI_API
|
||||
# endif
|
||||
/* we need this for PRIu64 and PRId64 */
|
||||
#include <inttypes.h>
|
||||
#define MYSQLI_LLU_SPEC "%" PRIu64
|
||||
#define MYSQLI_LL_SPEC "%" PRId64
|
||||
#ifndef L64
|
||||
#define L64(x) x##LL
|
||||
#endif
|
||||
typedef int64_t my_longlong;
|
||||
#endif
|
||||
|
||||
/* we need this for PRIu64 and PRId64 */
|
||||
#include <inttypes.h>
|
||||
#define MYSQLI_LLU_SPEC "%" PRIu64
|
||||
#define MYSQLI_LL_SPEC "%" PRId64
|
||||
|
||||
#ifdef ZTS
|
||||
#include "TSRM.h"
|
||||
#endif
|
||||
|
23
ext/mysqli/tests/gh8267.phpt
Normal file
23
ext/mysqli/tests/gh8267.phpt
Normal file
@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug GH-8267 (MySQLi uses unsupported format specifier on Windows)
|
||||
--EXTENSIONS--
|
||||
mysqli
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once("skipifconnectfailure.inc");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysqli = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysqli->query("DROP TABLE IF EXISTS foo");
|
||||
$mysqli->query("CREATE TABLE foo (id BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY (id))");
|
||||
$mysqli->query("INSERT INTO foo VALUES (9223372036854775807)");
|
||||
var_dump($mysqli->insert_id);
|
||||
$mysqli->query("INSERT INTO foo VALUES (0)");
|
||||
var_dump($mysqli->insert_id);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(19) "9223372036854775807"
|
||||
string(19) "9223372036854775808"
|
Loading…
Reference in New Issue
Block a user