Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Co-authored-by: robert.kubac <[email protected]>
  • Loading branch information
czoIg and robert.kubac authored Aug 11, 2022
1 parent 2d0784f commit 0780ea5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PHPSQLParser/positions/PositionCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ class PositionCalculator {
ExpressionType::SUBPARTITION_HASH, ExpressionType::SUBPARTITION_COUNT,
ExpressionType::CHARSET, ExpressionType::ENGINE, ExpressionType::QUERY,
ExpressionType::INDEX_ALGORITHM, ExpressionType::INDEX_LOCK,
ExpressionType::SUBQUERY_FACTORING, ExpressionType::CUSTOM_FUNCTION
ExpressionType::SUBQUERY_FACTORING, ExpressionType::CUSTOM_FUNCTION,
ExpressionType::SIMPLE_FUNCTION
);

/**
Expand Down
20 changes: 20 additions & 0 deletions tests/cases/creator/issue319Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace PHPSQLParser\Test\Creator;
use PHPSQLParser\PHPSQLParser;
use PHPSQLParser\PHPSQLCreator;

class issue319Test extends \PHPUnit\Framework\TestCase
{
public function testIssue319()
{
$sql = 'SELECT start_date FROM users INNER JOIN vacation ON DATE(start_date) <= DATE(end_date)';

$parser = new PHPSQLParser();
$creator = new PHPSQLCreator();

$parser->parse($sql, true);

$this->assertEquals($sql, $creator->create($parser->parsed));
}
}

0 comments on commit 0780ea5

Please sign in to comment.