<commit_before><?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";

$parser = new PHPSQLParser();

$sql = 'SELECT colA From test a
union
SELECT colB from test 
as b';
$p = $parser->parse($sql, true);
$expected = getExpectedValue(dirname(__FILE__), 'union1.serialized');
eq_array($p, $expected, 'simple union');


// TODO: the order-by clause has not been parsed
$sql = '(SELECT colA From test a)
        union all
        (SELECT colB from test b) order by 1';
$p = $parser->parse($sql, true);
print_r($p);
echo serialize($p);
$expected = getExpectedValue(dirname(__FILE__), 'union2.serialized');
eq_array($p, $expected, 'mysql union with order-by');

?><commit_msg>CHG: the debug output has been removed.<commit_after><?php

require_once dirname(__FILE__) . "/../../../src/PHPSQLParser.php";
require_once dirname(__FILE__) . "/../../test-more.php";

$parser = new PHPSQLParser();

$sql = 'SELECT colA From test a
union
SELECT colB from test 
as b';
$p = $parser->parse($sql, true);
$expected = getExpectedValue(dirname(__FILE__), 'union1.serialized');
eq_array($p, $expected, 'simple union');


// TODO: the order-by clause has not been parsed
$sql = '(SELECT colA From test a)
        union all
        (SELECT colB from test b) order by 1';
$p = $parser->parse($sql, true);
$expected = getExpectedValue(dirname(__FILE__), 'union2.serialized');
eq_array($p, $expected, 'mysql union with order-by');

?>
{'fraction_non_alphanumeric': 0.17397167902899527, 'fraction_numerical': 0.004045853000674309, 'mean_word_length': 4.35740072202166, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4485295', 'n_tokens_mistral': 491, 'n_tokens_neox': 488, 'n_words': 147}