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__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
8MySQLPDOTest::skip();
9?>
10--FILE--
11<?php
12    require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
13    $db = MySQLPDOTest::factory();
14
15    try {
16
17        $db->exec('DROP TABLE IF EXISTS test');
18        $db->exec('CREATE TABLE test(id INT, label CHAR(255)) ENGINE=MyISAM');
19        $db->exec('CREATE FULLTEXT INDEX idx1 ON test(label)');
20
21        $stmt = $db->prepare('SELECT id, label FROM test WHERE MATCH label AGAINST (:placeholder)');
22        $stmt->execute(array(':placeholder' => 'row'));
23        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
24
25        $stmt = $db->prepare('SELECT id, label FROM test WHERE MATCH label AGAINST (:placeholder)');
26        $stmt->execute(array('placeholder' => 'row'));
27        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
28
29        $stmt = $db->prepare('SELECT id, label FROM test WHERE MATCH label AGAINST (?)');
30        $stmt->execute(array('row'));
31        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
32
33    } catch (PDOException $e) {
34
35        printf("[001] %s, [%s} %s\n",
36            $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
37
38    }
39
40    print "done!";
41?>
42--CLEAN--
43<?php
44require __DIR__ . '/mysql_pdo_test.inc';
45$db = MySQLPDOTest::factory();
46$db->exec('DROP TABLE IF EXISTS test');
47?>
48--EXPECT--
49array(0) {
50}
51array(0) {
52}
53array(0) {
54}
55done!
56