Annotation of embedaddon/php/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #41876 (bindParam() and bindValue() do not work with MySQL MATCH () AGAINST ())
3: --SKIPIF--
4: <?php
5: require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
6: require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
7: MySQLPDOTest::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
43: require dirname(__FILE__) . '/mysql_pdo_test.inc';
44: $db = MySQLPDOTest::factory();
45: $db->exec('DROP TABLE IF EXISTS test');
46: ?>
47: --EXPECTF--
48: array(0) {
49: }
50: array(0) {
51: }
52: array(0) {
53: }
54: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>