xref: /PHP-8.2/ext/mysqli/tests/bug73800.phpt (revision b5a14e6c)
1--TEST--
2Bug #73800 (sporadic segfault with MYSQLI_OPT_INT_AND_FLOAT_NATIVE)
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once('skipifconnectfailure.inc');
8if (PHP_INT_SIZE != 8) die('skip requires 64-bit');
9if (!defined('MYSQLI_OPT_INT_AND_FLOAT_NATIVE')) die('skip requires mysqlnd');
10?>
11--FILE--
12<?php
13
14require_once("connect.inc");
15$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
16
17$link->query('SET @@global.max_allowed_packet = 67108864');
18$link->close();
19
20$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
21$link->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, 1);
22
23$res = $link->query("SELECT RPAD('1',9000000,'1') as a,RPAD('1',9000000,'1') as b, 9223372036854775807 as c");
24$r = $res->fetch_array();
25
26var_dump($r['c']);
27?>
28--EXPECT--
29int(9223372036854775807)
30