summaryrefslogtreecommitdiffstats
path: root/tests/Builder/SelectStatementTest.php
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2016-12-22 15:05:52 +0100
committerGitHub <noreply@github.com>2016-12-22 15:05:52 +0100
commita59b441090659c6c42c2044c3e3757ce504ad3e7 (patch)
tree4f0878431aa24ce2a9f02557dacca75957825c5e /tests/Builder/SelectStatementTest.php
parentabfdf58d647aeab7176fc93d4f1c1c83f83a5251 (diff)
parent54970a28d93df4ecdc8c520e7a34c6e4d0de0b3f (diff)
downloadsql-parser-a59b441090659c6c42c2044c3e3757ce504ad3e7.zip
sql-parser-a59b441090659c6c42c2044c3e3757ce504ad3e7.tar.gz
sql-parser-a59b441090659c6c42c2044c3e3757ce504ad3e7.tar.bz2
Merge pull request #107 from devenbansod/fix_105
Fix #105: Fix parsing of FIELDS and LINES options in Select..Into
Diffstat (limited to 'tests/Builder/SelectStatementTest.php')
-rw-r--r--tests/Builder/SelectStatementTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/Builder/SelectStatementTest.php b/tests/Builder/SelectStatementTest.php
index a2dd5af..173ff92 100644
--- a/tests/Builder/SelectStatementTest.php
+++ b/tests/Builder/SelectStatementTest.php
@@ -76,4 +76,21 @@ class SelectStatementTest extends TestCase
$stmt->build()
);
}
+
+
+ public function testBuilderIntoOptions()
+ {
+ /* Assertion 1 */
+ $query = 'SELECT a, b, a+b INTO OUTFILE "/tmp/result.txt"'
+ . ' COLUMNS TERMINATED BY \',\' OPTIONALLY ENCLOSED BY \'"\''
+ . ' LINES TERMINATED BY \'\n\''
+ . ' FROM test_table ';
+ $parser = new Parser($query);
+ $stmt = $parser->statements[0];
+
+ $this->assertEquals(
+ $query,
+ $stmt->build()
+ );
+ }
}