1--TEST--
2Bug #41876 (bindParam() and bindValue() do not work with MySQL MATCH () AGAINST ())
3--EXTENSIONS--
4pdo_mysql
5--SKIPIF--
6<?php
7require_once __DIR__ . '/inc/mysql_pdo_test.inc';
8MySQLPDOTest::skip();
9?>
10--FILE--
11<?php
12    require_once __DIR__ . '/inc/mysql_pdo_test.inc';
13    $db = MySQLPDOTest::factory();
14
15    try {
16        $db->exec('CREATE TABLE test_prepare_match_against(id INT, label CHAR(255)) ENGINE=MyISAM');
17        $db->exec('CREATE FULLTEXT INDEX idx1 ON test_prepare_match_against(label)');
18
19        $stmt = $db->prepare('SELECT id, label FROM test_prepare_match_against WHERE MATCH label AGAINST (:placeholder)');
20        $stmt->execute(array(':placeholder' => 'row'));
21        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
22
23        $stmt = $db->prepare('SELECT id, label FROM test_prepare_match_against WHERE MATCH label AGAINST (:placeholder)');
24        $stmt->execute(array('placeholder' => 'row'));
25        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
26
27        $stmt = $db->prepare('SELECT id, label FROM test_prepare_match_against WHERE MATCH label AGAINST (?)');
28        $stmt->execute(array('row'));
29        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
30    } catch (PDOException $e) {
31        printf("[001] %s, [%s} %s\n",
32            $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
33    }
34
35    print "done!";
36?>
37--CLEAN--
38<?php
39require_once __DIR__ . '/inc/mysql_pdo_test.inc';
40$db = MySQLPDOTest::factory();
41$db->exec('DROP TABLE IF EXISTS test_prepare_match_against');
42?>
43--EXPECT--
44array(0) {
45}
46array(0) {
47}
48array(0) {
49}
50done!
51