summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDeven Bansod <devenbansod.bits@gmail.com>2016-09-28 10:06:27 +0530
committerDeven Bansod <devenbansod.bits@gmail.com>2016-09-28 11:02:05 +0530
commitc2d9745b21f41f673bd7c314b29ba41e90d78fd1 (patch)
treefc5fba318ee2919b2e21a68eb8fc53a669984c88 /tests
parent30b2aab917931cc45b716ec6401103400fbd5537 (diff)
downloadsql-parser-c2d9745b21f41f673bd7c314b29ba41e90d78fd1.zip
sql-parser-c2d9745b21f41f673bd7c314b29ba41e90d78fd1.tar.gz
sql-parser-c2d9745b21f41f673bd7c314b29ba41e90d78fd1.tar.bz2
Fix some errors with INTO keyword more to follow
Add more test cases Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Utils/QueryTest.php10
-rw-r--r--tests/data/parser/parseSelect9.in4
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/Utils/QueryTest.php b/tests/Utils/QueryTest.php
index b3f0ab6..b5135c0 100644
--- a/tests/Utils/QueryTest.php
+++ b/tests/Utils/QueryTest.php
@@ -457,7 +457,7 @@ class QueryTest extends TestCase
);
}
- public function testRepalceClauses()
+ public function testReplaceClauses()
{
$this->assertEquals('', Query::replaceClauses(null, null, array()));
@@ -475,18 +475,18 @@ class QueryTest extends TestCase
$parser = new Parser(
'SELECT c.city_id, c.country_id ' .
+ 'INTO OUTFILE "/dev/null" ' .
'FROM `city` ' .
'WHERE city_id < 1 ' .
'ORDER BY city_id ASC ' .
- 'LIMIT 0, 1 ' .
- 'INTO OUTFILE "/dev/null"'
+ 'LIMIT 0, 1 '
);
$this->assertEquals(
'SELECT c.city_id, c.country_id ' .
+ 'INTO OUTFILE "/dev/null" ' .
'FROM city AS c ' .
'ORDER BY city_id ASC ' .
- 'LIMIT 0, 10 ' .
- 'INTO OUTFILE "/dev/null"',
+ 'LIMIT 0, 10 ',
Query::replaceClauses(
$parser->statements[0],
$parser->list,
diff --git a/tests/data/parser/parseSelect9.in b/tests/data/parser/parseSelect9.in
new file mode 100644
index 0000000..5717fe4
--- /dev/null
+++ b/tests/data/parser/parseSelect9.in
@@ -0,0 +1,4 @@
+SELECT casein_pipe, email_cp, name_first_cp, name_last_cp, purpose_pipe
+FROM (tbl_comp_person INNER JOIN `tbl_pipelist` ON tbl_comp_person.IDp = tbl_pipelist.IDp)
+WHERE casein_pipe > '2016-03-01' AND `campaign_id_pipe` = 24569 AND `weeksonlist_pipe` = 1
+ORDER BY `tbl_pipelist`.`casein_pipe` ASC \ No newline at end of file