bug67983.phpt 828 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Bug #67983: mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to interpret bit columns
  3. --EXTENSIONS--
  4. mysqli
  5. --SKIPIF--
  6. <?php
  7. require_once('skipifconnectfailure.inc');
  8. if (!$IS_MYSQLND) {
  9. die("skip mysqlnd only test");
  10. }
  11. ?>
  12. --FILE--
  13. <?php
  14. require_once("connect.inc");
  15. $connection = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
  16. mysqli_options($connection, MYSQLI_OPT_INT_AND_FLOAT_NATIVE, true);
  17. mysqli_set_charset($connection, 'utf8');
  18. mysqli_query($connection, 'DROP TABLE IF EXISTS test');
  19. mysqli_query($connection, 'CREATE TABLE test (id BIT(8))');
  20. mysqli_query($connection, 'INSERT INTO test VALUES (0), (1), (42)');
  21. $res = mysqli_query($connection, 'SELECT * FROM test');
  22. while ($result = mysqli_fetch_assoc($res)) {
  23. var_dump($result['id']);
  24. }
  25. ?>
  26. --EXPECT--
  27. int(0)
  28. int(1)
  29. int(42)