From 4afbb5958819a61d52c45bd2f262f8720fa0bb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 30 Aug 2010 15:55:52 +0200 Subject: [PATCH] Add testcase for backticked table. --- test/PMA_SQL_parser_test.php | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/PMA_SQL_parser_test.php b/test/PMA_SQL_parser_test.php index 4f956609e..0c26bb4c0 100644 --- a/test/PMA_SQL_parser_test.php +++ b/test/PMA_SQL_parser_test.php @@ -100,5 +100,45 @@ class PMA_SQL_parser_test extends PHPUnit_Framework_TestCase 'len' => 5, )); } + + public function testParse_3() + { + $this->assertParser('SELECT * from `aaa`;', array ( + 'raw' => 'SELECT * from `aaa`;', + 0 => + array ( + 'type' => 'alpha_reservedWord', + 'data' => 'SELECT', + 'pos' => 6, + 'forbidden' => true, + ), + 1 => + array ( + 'type' => 'punct', + 'data' => '*', + 'pos' => 0, + ), + 2 => + array ( + 'type' => 'alpha_reservedWord', + 'data' => 'from', + 'pos' => 13, + 'forbidden' => true, + ), + 3 => + array ( + 'type' => 'quote_backtick', + 'data' => '`aaa`', + 'pos' => 0, + ), + 4 => + array ( + 'type' => 'punct_queryend', + 'data' => ';', + 'pos' => 0, + ), + 'len' => 5, + )); + } } ?>