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