diff options
Diffstat (limited to 'test/scanners/sql')
-rw-r--r-- | test/scanners/sql/create_tables.expected.raydebug | 94 | ||||
-rw-r--r-- | test/scanners/sql/create_tables.in.sql | 94 | ||||
-rw-r--r-- | test/scanners/sql/maintenance.expected.raydebug | 24 | ||||
-rw-r--r-- | test/scanners/sql/maintenance.in.sql | 24 | ||||
-rw-r--r-- | test/scanners/sql/mysql-comments.expected.raydebug | 2 | ||||
-rw-r--r-- | test/scanners/sql/mysql-comments.in.sql | 2 | ||||
-rw-r--r-- | test/scanners/sql/mysql-long-queries.expected.raydebug | 254 | ||||
-rw-r--r-- | test/scanners/sql/mysql-long-queries.in.sql | 254 | ||||
-rw-r--r-- | test/scanners/sql/norwegian.expected.raydebug | 48 | ||||
-rw-r--r-- | test/scanners/sql/norwegian.in.sql | 48 | ||||
-rw-r--r-- | test/scanners/sql/reference.expected.raydebug | 109 | ||||
-rw-r--r-- | test/scanners/sql/reference.in.sql | 109 | ||||
-rw-r--r-- | test/scanners/sql/selects.expected.raydebug | 46 | ||||
-rw-r--r-- | test/scanners/sql/selects.in.sql | 46 | ||||
-rw-r--r-- | test/scanners/sql/suite.rb | 2 |
15 files changed, 0 insertions, 1156 deletions
diff --git a/test/scanners/sql/create_tables.expected.raydebug b/test/scanners/sql/create_tables.expected.raydebug deleted file mode 100644 index a4b7f47..0000000 --- a/test/scanners/sql/create_tables.expected.raydebug +++ /dev/null @@ -1,94 +0,0 @@ -comment(--RANDOM SQL QUERIES THAT DO NOTHING INTERESTING) -comment(--Copyright (C\) 2009 - Keith Pitt <keith@keithpitt.com>) - -comment(--This program is free software: you can redistribute it and/or modify) -comment(--it under the terms of the GNU General Public License as published by) -comment(--the Free Software Foundation, either version 3 of the License, or) -comment(--(at your option\) any later version.) - -comment(--This program is distributed in the hope that it will be useful,) -comment(--but WITHOUT ANY WARRANTY; without even the implied warranty of) -comment(--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the) -comment(--GNU General Public License for more details.) - -comment(--You should have received a copy of the GNU General Public License) -comment(--along with this program. If not, see <http://www.gnu.org/licenses/>.) - -comment(-- Comment: Drop table) -class(DROP) type(TABLE) reserved(IF) reserved(EXISTS) string<delimiter(`)content(general_lookups)delimiter(`)>operator(;) - -comment(-- Create table) -class(CREATE) type(TABLE) string<delimiter(`)content(general_lookups)delimiter(`)> operator(() - string<delimiter(`)content(name)delimiter(`)> pre_type(varchar)operator(()integer(255)operator(\)) directive(default) pre_constant(NULL) -operator(\)) reserved(ENGINE)operator(=)ident(InnoDB) directive(DEFAULT) directive(CHARSET)operator(=)ident(latin1)operator(;) - -comment(-- Drop table again) -class(DROP) type(TABLE) reserved(IF) reserved(EXISTS) ident(customer)operator(;) - -comment(-- Create customers) -class(CREATE) type(TABLE) ident(customer) operator(() - ident(first_name) pre_type(char)operator(()integer(50)operator(\))operator(,) - ident(last_name) pre_type(char)operator(()integer(50)operator(\))operator(,) - ident(address) pre_type(char)operator(()integer(50)operator(\))operator(,) - ident(city) pre_type(char)operator(()integer(50)operator(\))operator(,) - ident(country) pre_type(char)operator(()integer(25)operator(\))operator(,) - ident(birth_date) pre_type(date)operator(,) - ident(created_at) pre_type(timestamp)operator(,) comment(-- Differnt sort of date here) - ident(updated_at) pre_type(timestamp) -operator(\)) - -comment(-- Create business) -class(CREATE) type(TABLE) ident(business) operator(() - ident(compant_name) pre_type(char)operator(()integer(50)operator(\))operator(,) - ident(address) pre_type(char)operator(()integer(50)operator(\)) directive(default) string<delimiter(')content(Address Unknown)delimiter(')>operator(,) comment(-- Oohh, defaults..) - ident(city) pre_type(char)operator(()integer(50)operator(\)) directive(default) string<delimiter(')content(Adelaide)delimiter(')>operator(,) - ident(country) pre_type(char)operator(()integer(150)operator(\)) directive(default) string<delimiter(')content(Australia)delimiter(')> -operator(\)) - -comment(-- Some random table) - -class(DROP) type(TABLE) reserved(IF) reserved(EXISTS) ident(customer_statuses)operator(;) - -class(CREATE) type(TABLE) string<delimiter(`)content(customer_statuses)delimiter(`)> operator(() - comment(-- Auto incrementing IDs) - string<delimiter(`)content(id)delimiter(`)> pre_type(smallint)operator(()integer(6)operator(\)) pre_type(unsigned) reserved(NOT) pre_constant(NULL) directive(auto_increment)operator(,) - string<delimiter(`)content(customer_id)delimiter(`)> pre_type(int)operator(()integer(10)operator(\)) pre_type(unsigned) reserved(NOT) pre_constant(NULL) directive(default) string<delimiter(')content(0)delimiter(')>operator(,) - string<delimiter(`)content(customer_client_code)delimiter(`)> pre_type(varchar)operator(()integer(15)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(entry_date)delimiter(`)> pre_type(date) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(status_id)delimiter(`)> pre_type(smallint)operator(()integer(6)operator(\)) pre_type(unsigned) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(comments)delimiter(`)> pre_type(varchar)operator(()integer(100)operator(\)) directive(default) pre_constant(NULL)operator(,) - reserved(PRIMARY) reserved(KEY) operator(()string<delimiter(`)content(id)delimiter(`)>operator(\)) -operator(\)) reserved(ENGINE)operator(=)ident(InnoDB) directive(DEFAULT) directive(CHARSET)operator(=)ident(latin1)operator(;) - -comment(-- Try creating an index.) -class(CREATE) type(INDEX) ident(customer_status_status_id) reserved(ON) ident(customer_statuses) operator(()ident(status_id)operator(\)) - -comment(/* Now lets try and make a really big table */) - -class(DROP) type(TABLE) reserved(IF) reserved(EXISTS) string<delimiter(`)content(legacy_clients)delimiter(`)>operator(;) -class(CREATE) type(TABLE) string<delimiter(`)content(legacy_clients)delimiter(`)> operator(() - string<delimiter(`)content(id)delimiter(`)> pre_type(int)operator(()integer(10)operator(\)) pre_type(unsigned) reserved(NOT) pre_constant(NULL) directive(auto_increment)operator(,) - string<delimiter(`)content(client_code)delimiter(`)> pre_type(varchar)operator(()integer(15)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(first_name)delimiter(`)> pre_type(varchar)operator(()integer(20)operator(\)) reserved(NOT) pre_constant(NULL) directive(default) string<delimiter(')delimiter(')>operator(,) - string<delimiter(`)content(other_name)delimiter(`)> pre_type(varchar)operator(()integer(20)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(surname)delimiter(`)> pre_type(varchar)operator(()integer(30)operator(\)) reserved(NOT) pre_constant(NULL) directive(default) string<delimiter(')delimiter(')>operator(,) - string<delimiter(`)content(address)delimiter(`)> pre_type(varchar)operator(()integer(50)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(suburb)delimiter(`)> pre_type(varchar)operator(()integer(50)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(postcode)delimiter(`)> pre_type(varchar)operator(()integer(10)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(location_id)delimiter(`)> pre_type(smallint)operator(()integer(3)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(home_phone)delimiter(`)> pre_type(varchar)operator(()integer(15)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(work_phone)delimiter(`)> pre_type(varchar)operator(()integer(15)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(fax)delimiter(`)> pre_type(varchar)operator(()integer(15)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(mobile)delimiter(`)> pre_type(varchar)operator(()integer(15)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(email)delimiter(`)> pre_type(varchar)operator(()integer(50)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(date_of_birth)delimiter(`)> pre_type(date) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(business_id)delimiter(`)> pre_type(int)operator(()integer(11)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(comments)delimiter(`)> pre_type(varchar)operator(()integer(100)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(state)delimiter(`)> pre_type(char)operator(()integer(3)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(sex)delimiter(`)> pre_type(char)operator(()integer(1)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(location_temp)delimiter(`)> pre_type(varchar)operator(()integer(50)operator(\)) directive(default) pre_constant(NULL)operator(,) - string<delimiter(`)content(employer_temp)delimiter(`)> pre_type(varchar)operator(()integer(50)operator(\)) directive(default) pre_constant(NULL)operator(,) - reserved(PRIMARY) reserved(KEY) operator(()string<delimiter(`)content(id)delimiter(`)>operator(\)) -operator(\)) reserved(ENGINE)operator(=)ident(InnoDB) directive(DEFAULT) directive(CHARSET)operator(=)ident(latin1)operator(;) - - diff --git a/test/scanners/sql/create_tables.in.sql b/test/scanners/sql/create_tables.in.sql deleted file mode 100644 index 1844af0..0000000 --- a/test/scanners/sql/create_tables.in.sql +++ /dev/null @@ -1,94 +0,0 @@ ---RANDOM SQL QUERIES THAT DO NOTHING INTERESTING ---Copyright (C) 2009 - Keith Pitt <keith@keithpitt.com> - ---This program is free software: you can redistribute it and/or modify ---it under the terms of the GNU General Public License as published by ---the Free Software Foundation, either version 3 of the License, or ---(at your option) any later version. - ---This program is distributed in the hope that it will be useful, ---but WITHOUT ANY WARRANTY; without even the implied warranty of ---MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ---GNU General Public License for more details. - ---You should have received a copy of the GNU General Public License ---along with this program. If not, see <http://www.gnu.org/licenses/>. - --- Comment: Drop table -DROP TABLE IF EXISTS `general_lookups`; - --- Create table -CREATE TABLE `general_lookups` ( - `name` varchar(255) default NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- Drop table again -DROP TABLE IF EXISTS customer; - --- Create customers -CREATE TABLE customer ( - first_name char(50), - last_name char(50), - address char(50), - city char(50), - country char(25), - birth_date date, - created_at timestamp, -- Differnt sort of date here - updated_at timestamp -) - --- Create business -CREATE TABLE business ( - compant_name char(50), - address char(50) default 'Address Unknown', -- Oohh, defaults.. - city char(50) default 'Adelaide', - country char(150) default 'Australia' -) - --- Some random table - -DROP TABLE IF EXISTS customer_statuses; - -CREATE TABLE `customer_statuses` ( - -- Auto incrementing IDs - `id` smallint(6) unsigned NOT NULL auto_increment, - `customer_id` int(10) unsigned NOT NULL default '0', - `customer_client_code` varchar(15) default NULL, - `entry_date` date default NULL, - `status_id` smallint(6) unsigned default NULL, - `comments` varchar(100) default NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- Try creating an index. -CREATE INDEX customer_status_status_id ON customer_statuses (status_id) - -/* Now lets try and make a really big table */ - -DROP TABLE IF EXISTS `legacy_clients`; -CREATE TABLE `legacy_clients` ( - `id` int(10) unsigned NOT NULL auto_increment, - `client_code` varchar(15) default NULL, - `first_name` varchar(20) NOT NULL default '', - `other_name` varchar(20) default NULL, - `surname` varchar(30) NOT NULL default '', - `address` varchar(50) default NULL, - `suburb` varchar(50) default NULL, - `postcode` varchar(10) default NULL, - `location_id` smallint(3) default NULL, - `home_phone` varchar(15) default NULL, - `work_phone` varchar(15) default NULL, - `fax` varchar(15) default NULL, - `mobile` varchar(15) default NULL, - `email` varchar(50) default NULL, - `date_of_birth` date default NULL, - `business_id` int(11) default NULL, - `comments` varchar(100) default NULL, - `state` char(3) default NULL, - `sex` char(1) default NULL, - `location_temp` varchar(50) default NULL, - `employer_temp` varchar(50) default NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - - diff --git a/test/scanners/sql/maintenance.expected.raydebug b/test/scanners/sql/maintenance.expected.raydebug deleted file mode 100644 index 6cfb72a..0000000 --- a/test/scanners/sql/maintenance.expected.raydebug +++ /dev/null @@ -1,24 +0,0 @@ -comment(--RANDOM SQL QUERIES THAT DO NOTHING INTERESTING) -comment(--Copyright (C\) 2009 - Keith Pitt <keith@keithpitt.com>) - -comment(--This program is free software: you can redistribute it and/or modify) -comment(--it under the terms of the GNU General Public License as published by) -comment(--the Free Software Foundation, either version 3 of the License, or) -comment(--(at your option\) any later version.) - -comment(--This program is distributed in the hope that it will be useful,) -comment(--but WITHOUT ANY WARRANTY; without even the implied warranty of) -comment(--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the) -comment(--GNU General Public License for more details.) - -comment(--You should have received a copy of the GNU General Public License) -comment(--along with this program. If not, see <http://www.gnu.org/licenses/>.) - -class(INSERT) class(INTO) ident(users) operator(()ident(first_name)operator(,) ident(last_name)operator(\)) reserved(VALUES) operator(()string<delimiter(')content(John)delimiter(')>operator(,) string<delimiter(')content(Doe)delimiter(')>operator(\))operator(;) - -class(INSERT) class(INTO) ident(users) operator(()ident(first_name)operator(,) ident(last_name)operator(\)) reserved(VALUES) operator(()string<delimiter(")content(John)delimiter(")>operator(,) string<delimiter(")content(Doe)delimiter(")>operator(\))operator(;) - -class(UPDATE) ident(users) class(SET) ident(first_name) operator(=) string<delimiter(')content(Keith)delimiter(')> reserved(WHERE) ident(first_name) operator(=) string<delimiter(')content(JOHN)delimiter(')>operator(;) - -class(DELETE) reserved(FROM) ident(users) reserved(WHERE) ident(first_name) operator(=) string<delimiter(')content(Keith)delimiter(')>operator(;) - diff --git a/test/scanners/sql/maintenance.in.sql b/test/scanners/sql/maintenance.in.sql deleted file mode 100644 index 7b06db6..0000000 --- a/test/scanners/sql/maintenance.in.sql +++ /dev/null @@ -1,24 +0,0 @@ ---RANDOM SQL QUERIES THAT DO NOTHING INTERESTING ---Copyright (C) 2009 - Keith Pitt <keith@keithpitt.com> - ---This program is free software: you can redistribute it and/or modify ---it under the terms of the GNU General Public License as published by ---the Free Software Foundation, either version 3 of the License, or ---(at your option) any later version. - ---This program is distributed in the hope that it will be useful, ---but WITHOUT ANY WARRANTY; without even the implied warranty of ---MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ---GNU General Public License for more details. - ---You should have received a copy of the GNU General Public License ---along with this program. If not, see <http://www.gnu.org/licenses/>. - -INSERT INTO users (first_name, last_name) VALUES ('John', 'Doe'); - -INSERT INTO users (first_name, last_name) VALUES ("John", "Doe"); - -UPDATE users SET first_name = 'Keith' WHERE first_name = 'JOHN'; - -DELETE FROM users WHERE first_name = 'Keith'; - diff --git a/test/scanners/sql/mysql-comments.expected.raydebug b/test/scanners/sql/mysql-comments.expected.raydebug deleted file mode 100644 index 38f738c..0000000 --- a/test/scanners/sql/mysql-comments.expected.raydebug +++ /dev/null @@ -1,2 +0,0 @@ -class(SELECT) directive(/*! STRAIGHT_JOIN */) ident(col1) reserved(FROM) ident(table1)operator(,)ident(table2) reserved(WHERE) operator(.)operator(.)operator(.) -class(CREATE) directive(/*!32302 TEMPORARY */) type(TABLE) ident(t) operator(()ident(a) pre_type(INT)operator(\))operator(;) diff --git a/test/scanners/sql/mysql-comments.in.sql b/test/scanners/sql/mysql-comments.in.sql deleted file mode 100644 index fe7cd83..0000000 --- a/test/scanners/sql/mysql-comments.in.sql +++ /dev/null @@ -1,2 +0,0 @@ -SELECT /*! STRAIGHT_JOIN */ col1 FROM table1,table2 WHERE ... -CREATE /*!32302 TEMPORARY */ TABLE t (a INT); diff --git a/test/scanners/sql/mysql-long-queries.expected.raydebug b/test/scanners/sql/mysql-long-queries.expected.raydebug deleted file mode 100644 index a0d0886..0000000 --- a/test/scanners/sql/mysql-long-queries.expected.raydebug +++ /dev/null @@ -1,254 +0,0 @@ -comment(/* This is a modified copy of the - query linked above to test other keywords: */) -class(SELECT) ident(sd)operator(.)ident(qbclass)operator(,) comment(-- Comments Test) - predefined(Sum)operator(()ident(sd)operator(.)ident(amount)operator(\)) reserved(AS) ident(invoiceamount)operator(,) comment(# Comments Test) - predefined(Sum)operator(()ident(scd1)operator(.)ident(amount)operator(\)) reserved(AS) ident(paymentsperiod1)operator(,) - predefined(Sum)operator(()ident(scd2)operator(.)ident(amount)operator(\)) reserved(AS) ident(paymentsperiod2)operator(,) - predefined(Sum)operator(()ident(scd3)operator(.)ident(amount)operator(\)) reserved(AS) ident(paymentsperiod3) -reserved(FROM) ident(studentdebit) reserved(AS) ident(sd) - reserved(LEFT) reserved(JOIN) operator(()class(SELECT) ident(studentcreditdetail)operator(.)ident(studentdebitid)operator(,) - ident(studentcreditdetail)operator(.)ident(amount)operator(,) - ident(studentcredit)operator(.)pre_type(date)operator(,) - ident(credittype)operator(.)ident(credittype) - reserved(FROM) ident(studentcreditdetail) - reserved(INNER) reserved(JOIN) ident(studentcredit) - reserved(ON) ident(studentcreditdetail)operator(.)ident(studentcreditid) operator(=) ident(studentcredit)operator(.)ident(studentcreditid) - reserved(AND) ident(studentcredit)operator(.)ident(obsolete) operator(=) integer(0) comment(/* Not Deleted */) - reserved(AND) ident(studentcredit)operator(.)ident(status) operator(=) integer(1) comment(/* Successful */) - comment(/* PERIOD 1 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(<) predefined(Now)operator(()operator(\)) - comment(/* PERIOD 1 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(>) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(1) ident(MONTH) - reserved(LEFT) reserved(JOIN) ident(credittype) - reserved(USING)operator(()ident(credittypeid)operator(\))operator(\)) reserved(AS) ident(scd1) - reserved(ON) ident(sd)operator(.)ident(studentdebitid) operator(=) ident(scd1)operator(.)ident(studentdebitid) - reserved(LEFT) reserved(JOIN) operator(()class(SELECT) ident(studentcreditdetail)operator(.)ident(studentdebitid)operator(,) - ident(studentcreditdetail)operator(.)ident(amount)operator(,) - ident(studentcredit)operator(.)pre_type(date)operator(,) - ident(credittype)operator(.)ident(credittype) - reserved(FROM) ident(studentcreditdetail) - reserved(INNER) reserved(JOIN) ident(studentcredit) - reserved(ON) ident(studentcreditdetail)operator(.)ident(studentcreditid) operator(=) ident(studentcredit)operator(.)ident(studentcreditid) - reserved(AND) ident(studentcredit)operator(.)ident(obsolete) operator(=) integer(0) comment(/* Not Deleted */) - reserved(AND) ident(studentcredit)operator(.)ident(status) operator(=) integer(1) comment(/* Successful */) - comment(/* PERIOD 2 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(<) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(1) ident(MONTH) - comment(/* PERIOD 2 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(>) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(2) ident(MONTH) - reserved(LEFT) reserved(OUTER) reserved(JOIN) ident(credittype) - reserved(USING)operator(()ident(credittypeid)operator(\))operator(\)) reserved(AS) ident(scd2) - reserved(ON) ident(sd)operator(.)ident(studentdebitid) operator(=) ident(scd2)operator(.)ident(studentdebitid) - reserved(RIGHT) reserved(JOIN) operator(()class(SELECT) ident(studentcreditdetail)operator(.)ident(studentdebitid)operator(,) - ident(studentcreditdetail)operator(.)ident(amount)operator(,) - ident(studentcredit)operator(.)pre_type(date)operator(,) - ident(credittype)operator(.)ident(credittype) - reserved(FROM) ident(studentcreditdetail) - reserved(INNER) reserved(JOIN) ident(studentcredit) - reserved(ON) ident(studentcreditdetail)operator(.)ident(studentcreditid) operator(=) ident(studentcredit)operator(.)ident(studentcreditid) - reserved(AND) ident(studentcredit)operator(.)ident(obsolete) operator(=) integer(0) comment(/* Not Deleted */) - reserved(AND) ident(studentcredit)operator(.)ident(status) operator(=) integer(1) comment(/* Successful */) - comment(/* PERIOD 3 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(<) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(2) ident(MONTH) - comment(/* PERIOD 3 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(>) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(3) ident(MONTH) - reserved(LEFT) reserved(JOIN) ident(credittype) - reserved(USING)operator(()ident(credittypeid)operator(\))operator(\)) reserved(AS) ident(scd3) - reserved(ON) ident(sd)operator(.)ident(studentdebitid) operator(=) ident(scd3)operator(.)ident(studentdebitid) -reserved(WHERE) ident(sd)operator(.)ident(obsolete) operator(=) integer(0) comment(/* Not Deleted */) - reserved(AND) ident(sd)operator(.)ident(status) operator(=) integer(0) comment(/* Normal */) - comment(/* Exclude Voided Invoices */) - reserved(AND) ident(sd)operator(.)ident(adjustsdebitid) reserved(IS) pre_constant(NULL) - reserved(AND) ident(sd)operator(.)ident(studentdebitid) reserved(NOT) ident(IN) operator(()class(SELECT) ident(adjustsdebitid) - reserved(FROM) ident(studentdebit) - reserved(WHERE) ident(adjustsdebitid) reserved(IS) reserved(NOT) pre_constant(NULL)operator(\)) - comment(/* FULL PERIOD */) - reserved(AND) ident(sd)operator(.)pre_type(DATE) operator(<) predefined(Now)operator(()operator(\)) - comment(/* FULL PERIOD */) - reserved(AND) ident(sd)operator(.)pre_type(DATE) operator(>) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(3) ident(MONTH) -reserved(GROUP) reserved(BY) ident(sd)operator(.)ident(qbclass) -comment(/* Formatting only */) -reserved(UNION) reserved(ALL) -class(SELECT) string<delimiter(')content(---)delimiter(')>operator(,) - string<delimiter(')content(---)delimiter(')>operator(,) - string<delimiter(')content(---)delimiter(')>operator(,) - string<delimiter(')content(---)delimiter(')>operator(,) - string<delimiter(')content(---)delimiter(')> -comment(/* Payment Types Summary */) -reserved(UNION) reserved(DISTINCT) -class(SELECT) ident(credittype)operator(,) - ident(invoiceamount)operator(,) - predefined(Sum)operator(()ident(paymentsperiod1)operator(\))operator(,) - predefined(Sum)operator(()ident(paymentsperiod2)operator(\))operator(,) - predefined(Sum)operator(()ident(paymentsperiod3)operator(\)) -reserved(FROM) operator(()class(SELECT) ident(scd)operator(.)ident(credittype)operator(,) - string<delimiter(')delimiter(')> reserved(AS) ident(invoiceamount)operator(,) - predefined(Sum)operator(()ident(scd)operator(.)ident(amount)operator(\)) reserved(AS) ident(paymentsperiod1)operator(,) - string<delimiter(')delimiter(')> reserved(AS) ident(paymentsperiod2)operator(,) - string<delimiter(')delimiter(')> reserved(AS) ident(paymentsperiod3) - reserved(FROM) ident(studentdebit) reserved(AS) ident(sd) - reserved(INNER) reserved(JOIN) operator(()class(SELECT) ident(studentcreditdetail)operator(.)ident(studentdebitid)operator(,) - ident(studentcreditdetail)operator(.)ident(amount)operator(,) - ident(studentcredit)operator(.)pre_type(date)operator(,) - ident(credittype)operator(.)ident(credittype) - reserved(FROM) ident(studentcreditdetail) - reserved(INNER) reserved(JOIN) ident(studentcredit) - reserved(ON) ident(studentcreditdetail)operator(.)ident(studentcreditid) operator(=) ident(studentcredit)operator(.)ident(studentcreditid) - reserved(AND) ident(studentcredit)operator(.)ident(obsolete) operator(=) integer(0) comment(/* Not Deleted */) - reserved(AND) ident(studentcredit)operator(.)ident(status) operator(=) integer(1) comment(/* Successful */) - comment(/* PERIOD 1 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(<) predefined(Now)operator(()operator(\)) - comment(/* PERIOD 1 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(>) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(1) ident(MONTH) - reserved(LEFT) reserved(JOIN) ident(credittype) - reserved(USING)operator(()ident(credittypeid)operator(\))operator(\)) reserved(AS) ident(scd) - reserved(ON) ident(sd)operator(.)ident(studentdebitid) operator(=) ident(scd)operator(.)ident(studentdebitid) - reserved(WHERE) ident(sd)operator(.)ident(obsolete) operator(=) integer(0) comment(/* Not Deleted */) - reserved(AND) ident(sd)operator(.)ident(status) operator(=) integer(0) comment(/* Normal */) - comment(/* Exclude Voided Invoices */) - reserved(AND) ident(sd)operator(.)ident(adjustsdebitid) reserved(IS) pre_constant(NULL) - reserved(AND) ident(sd)operator(.)ident(studentdebitid) reserved(NOT) ident(IN) operator(()class(SELECT) ident(adjustsdebitid) - reserved(FROM) ident(studentdebit) - reserved(WHERE) ident(adjustsdebitid) reserved(IS) reserved(NOT) pre_constant(NULL)operator(\)) - reserved(AND) ident(sd)operator(.)pre_type(DATE) operator(<) predefined(Now)operator(()operator(\)) - reserved(AND) ident(sd)operator(.)pre_type(DATE) operator(>) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(3) ident(MONTH) - reserved(GROUP) reserved(BY) ident(scd)operator(.)ident(credittype) - reserved(UNION) reserved(ALL) - class(SELECT) ident(scd)operator(.)ident(credittype)operator(,) - string<delimiter(')delimiter(')> reserved(AS) ident(invoiceamount)operator(,) - string<delimiter(')delimiter(')> reserved(AS) ident(paymentsperiod1)operator(,) - predefined(Sum)operator(()ident(scd)operator(.)ident(amount)operator(\)) reserved(AS) ident(paymentsperiod2)operator(,) - string<delimiter(')delimiter(')> reserved(AS) ident(paymentsperiod3) - reserved(FROM) ident(studentdebit) reserved(AS) ident(sd) - reserved(INNER) reserved(JOIN) operator(()class(SELECT) ident(studentcreditdetail)operator(.)ident(studentdebitid)operator(,) - ident(studentcreditdetail)operator(.)ident(amount)operator(,) - ident(studentcredit)operator(.)pre_type(date)operator(,) - ident(credittype)operator(.)ident(credittype) - reserved(FROM) ident(studentcreditdetail) - reserved(INNER) reserved(JOIN) ident(studentcredit) - reserved(ON) ident(studentcreditdetail)operator(.)ident(studentcreditid) operator(=) ident(studentcredit)operator(.)ident(studentcreditid) - reserved(AND) ident(studentcredit)operator(.)ident(obsolete) operator(=) integer(0) comment(/* Not Deleted */) - reserved(AND) ident(studentcredit)operator(.)ident(status) operator(=) integer(1) comment(/* Successful */) - comment(/* PERIOD 2 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(<) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(1) ident(MONTH) - comment(/* PERIOD 2 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(>) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(2) ident(MONTH) - reserved(LEFT) reserved(JOIN) ident(credittype) - reserved(USING)operator(()ident(credittypeid)operator(\))operator(\)) reserved(AS) ident(scd) - reserved(ON) ident(sd)operator(.)ident(studentdebitid) operator(=) ident(scd)operator(.)ident(studentdebitid) - reserved(WHERE) ident(sd)operator(.)ident(obsolete) operator(=) integer(0) comment(/* Not Deleted */) - reserved(AND) ident(sd)operator(.)ident(status) operator(=) integer(0) comment(/* Normal */) - comment(/* Exclude Voided Invoices */) - reserved(AND) ident(sd)operator(.)ident(adjustsdebitid) reserved(IS) pre_constant(NULL) - reserved(AND) ident(sd)operator(.)ident(studentdebitid) reserved(NOT) ident(IN) operator(()class(SELECT) ident(adjustsdebitid) - reserved(FROM) ident(studentdebit) - reserved(WHERE) ident(adjustsdebitid) reserved(IS) reserved(NOT) pre_constant(NULL)operator(\)) - reserved(AND) ident(sd)operator(.)pre_type(DATE) operator(<) predefined(Now)operator(()operator(\)) - reserved(AND) ident(sd)operator(.)pre_type(DATE) operator(>) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(3) ident(MONTH) - reserved(GROUP) reserved(BY) ident(scd)operator(.)ident(credittype) - reserved(UNION) reserved(ALL) - class(SELECT) ident(scd)operator(.)ident(credittype)operator(,) - string<delimiter(')delimiter(')> reserved(AS) ident(invoiceamount)operator(,) - string<delimiter(')delimiter(')> reserved(AS) ident(paymentsperiod1)operator(,) - string<delimiter(')delimiter(')> reserved(AS) ident(paymentsperiod2)operator(,) - predefined(Sum)operator(()ident(scd)operator(.)ident(amount)operator(\)) reserved(AS) ident(paymentsperiod3) - reserved(FROM) ident(studentdebit) reserved(AS) ident(sd) - reserved(INNER) reserved(JOIN) operator(()class(SELECT) ident(studentcreditdetail)operator(.)ident(studentdebitid)operator(,) - ident(studentcreditdetail)operator(.)ident(amount)operator(,) - ident(studentcredit)operator(.)pre_type(date)operator(,) - ident(credittype)operator(.)ident(credittype) - reserved(FROM) ident(studentcreditdetail) - reserved(INNER) reserved(JOIN) ident(studentcredit) - reserved(ON) ident(studentcreditdetail)operator(.)ident(studentcreditid) operator(=) ident(studentcredit)operator(.)ident(studentcreditid) - reserved(AND) ident(studentcredit)operator(.)ident(obsolete) operator(=) integer(0) comment(/* Not Deleted */) - reserved(AND) ident(studentcredit)operator(.)ident(status) operator(=) integer(1) comment(/* Successful */) - comment(/* PERIOD 3 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(<) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(2) ident(MONTH) - comment(/* PERIOD 3 */) - reserved(AND) ident(studentcredit)operator(.)pre_type(date) operator(>) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(3) ident(MONTH) - reserved(LEFT) reserved(JOIN) ident(credittype) - reserved(USING)operator(()ident(credittypeid)operator(\))operator(\)) reserved(AS) ident(scd) - reserved(ON) ident(sd)operator(.)ident(studentdebitid) operator(=) ident(scd)operator(.)ident(studentdebitid) - reserved(WHERE) ident(sd)operator(.)ident(obsolete) operator(=) integer(0) comment(/* Not Deleted */) - reserved(AND) ident(sd)operator(.)ident(status) operator(=) integer(0) comment(/* Normal */) - comment(/* Exclude Voided Invoices */) - reserved(AND) ident(sd)operator(.)ident(adjustsdebitid) reserved(IS) pre_constant(NULL) - reserved(AND) ident(sd)operator(.)ident(studentdebitid) reserved(NOT) ident(IN) operator(()class(SELECT) ident(adjustsdebitid) - reserved(FROM) ident(studentdebit) - reserved(WHERE) ident(adjustsdebitid) reserved(IS) reserved(NOT) pre_constant(NULL)operator(\)) - reserved(AND) ident(sd)operator(.)pre_type(date) operator(<) predefined(Now)operator(()operator(\)) - reserved(AND) ident(sd)operator(.)pre_type(date) operator(>) predefined(Now)operator(()operator(\)) operator(-) ident(INTERVAL) integer(3) ident(MONTH) - reserved(GROUP) reserved(BY) ident(scd)operator(.)ident(credittype)operator(\)) reserved(AS) ident(ct) -reserved(GROUP) reserved(BY) ident(ct)operator(.)ident(credittype) - -class(SELECT) string<delimiter(')content(mediaid)delimiter(')> reserved(AS) string<delimiter(`)content(idtype)delimiter(`)>operator(,) - string<delimiter(`)content(m)delimiter(`)>operator(.)string<delimiter(`)content(mediaid)delimiter(`)> reserved(AS) string<delimiter(`)content(id)delimiter(`)>operator(,) - string<delimiter(`)content(m)delimiter(`)>operator(.)string<delimiter(`)content(title)delimiter(`)> reserved(AS) string<delimiter(`)content(title)delimiter(`)>operator(,) - string<delimiter(`)content(m)delimiter(`)>operator(.)string<delimiter(`)content(description)delimiter(`)> reserved(AS) string<delimiter(`)content(description)delimiter(`)>operator(,) - string<delimiter(`)content(m)delimiter(`)>operator(.)string<delimiter(`)content(source)delimiter(`)> reserved(AS) string<delimiter(`)content(source)delimiter(`)>operator(,) - string<delimiter(`)content(m)delimiter(`)>operator(.)string<delimiter(`)content(date)delimiter(`)> reserved(AS) string<delimiter(`)content(startdate)delimiter(`)>operator(,) - string<delimiter(`)content(m)delimiter(`)>operator(.)string<delimiter(`)content(date)delimiter(`)> reserved(AS) string<delimiter(`)content(enddate)delimiter(`)>operator(,) - string<delimiter(`)content(c)delimiter(`)>operator(.)string<delimiter(`)content(class)delimiter(`)> reserved(AS) string<delimiter(`)content(class)delimiter(`)>operator(,) - string<delimiter(`)content(c)delimiter(`)>operator(.)string<delimiter(`)content(classname)delimiter(`)> reserved(AS) string<delimiter(`)content(classname)delimiter(`)>operator(,) - string<delimiter(`)content(per)delimiter(`)>operator(.)string<delimiter(`)content(firstname)delimiter(`)> reserved(AS) string<delimiter(`)content(firstname)delimiter(`)>operator(,) - string<delimiter(`)content(per)delimiter(`)>operator(.)string<delimiter(`)content(lastname)delimiter(`)> reserved(AS) string<delimiter(`)content(lastname)delimiter(`)>operator(,) - string<delimiter(`)content(c)delimiter(`)>operator(.)string<delimiter(`)content(description)delimiter(`)> reserved(AS) string<delimiter(`)content(classdesc)delimiter(`)>operator(,) - string<delimiter(`)content(p)delimiter(`)>operator(.)string<delimiter(`)content(programid)delimiter(`)> reserved(AS) string<delimiter(`)content(programid)delimiter(`)>operator(,) - reserved(If)operator(()operator(()string<delimiter(`)content(p)delimiter(`)>operator(.)string<delimiter(`)content(subprogramof)delimiter(`)> reserved(IS) reserved(NOT) pre_constant(NULL)operator(\))operator(,)string<delimiter(`)content(mp)delimiter(`)>operator(.)string<delimiter(`)content(programname)delimiter(`)>operator(,) - string<delimiter(`)content(p)delimiter(`)>operator(.)string<delimiter(`)content(programname)delimiter(`)>operator(\)) reserved(AS) string<delimiter(`)content(programname)delimiter(`)>operator(,) - string<delimiter(')content(Recorded)delimiter(')> reserved(AS) string<delimiter(`)content(longname)delimiter(`)> -reserved(FROM) operator(()operator(()operator(()operator(()operator(()operator(()operator(()operator(()string<delimiter(`)content(media)delimiter(`)> string<delimiter(`)content(m)delimiter(`)> - reserved(JOIN) string<delimiter(`)content(mediaaudience)delimiter(`)> string<delimiter(`)content(ma)delimiter(`)> - reserved(ON) operator(()operator(()operator(()string<delimiter(`)content(m)delimiter(`)>operator(.)string<delimiter(`)content(mediaid)delimiter(`)> operator(=) string<delimiter(`)content(ma)delimiter(`)>operator(.)string<delimiter(`)content(mediaid)delimiter(`)>operator(\)) - reserved(AND) operator(()string<delimiter(`)content(ma)delimiter(`)>operator(.)string<delimiter(`)content(audiencetype)delimiter(`)> operator(=) string<delimiter(')content(Public)delimiter(')>operator(\)) - reserved(AND) operator(()operator(()string<delimiter(`)content(ma)delimiter(`)>operator(.)string<delimiter(`)content(enddate)delimiter(`)> operator(<) predefined(Now)operator(()operator(\))operator(\)) - reserved(OR) ident(Isnull)operator(()string<delimiter(`)content(ma)delimiter(`)>operator(.)string<delimiter(`)content(enddate)delimiter(`)>operator(\))operator(\))operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(mediapresenter)delimiter(`)> string<delimiter(`)content(mpp)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(m)delimiter(`)>operator(.)string<delimiter(`)content(mediaid)delimiter(`)> operator(=) string<delimiter(`)content(mpp)delimiter(`)>operator(.)string<delimiter(`)content(mediaid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(person)delimiter(`)> string<delimiter(`)content(per)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(mpp)delimiter(`)>operator(.)string<delimiter(`)content(personid)delimiter(`)> operator(=) string<delimiter(`)content(per)delimiter(`)>operator(.)string<delimiter(`)content(personid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(mediaaudience)delimiter(`)> string<delimiter(`)content(mad)delimiter(`)> - reserved(ON) operator(()operator(()operator(()string<delimiter(`)content(ma)delimiter(`)>operator(.)string<delimiter(`)content(mediaid)delimiter(`)> operator(=) string<delimiter(`)content(mad)delimiter(`)>operator(.)string<delimiter(`)content(mediaid)delimiter(`)>operator(\)) - reserved(AND) operator(()string<delimiter(`)content(mad)delimiter(`)>operator(.)string<delimiter(`)content(audiencetype)delimiter(`)> operator(=) string<delimiter(')content(classid)delimiter(')>operator(\))operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(class)delimiter(`)> string<delimiter(`)content(c)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(mad)delimiter(`)>operator(.)string<delimiter(`)content(audienceid)delimiter(`)> operator(=) string<delimiter(`)content(c)delimiter(`)>operator(.)string<delimiter(`)content(classid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(program_class)delimiter(`)> string<delimiter(`)content(pc)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(c)delimiter(`)>operator(.)string<delimiter(`)content(classid)delimiter(`)> operator(=) string<delimiter(`)content(pc)delimiter(`)>operator(.)string<delimiter(`)content(classid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(program)delimiter(`)> string<delimiter(`)content(p)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(pc)delimiter(`)>operator(.)string<delimiter(`)content(programid)delimiter(`)> operator(=) string<delimiter(`)content(p)delimiter(`)>operator(.)string<delimiter(`)content(programid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(program)delimiter(`)> string<delimiter(`)content(mp)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(p)delimiter(`)>operator(.)string<delimiter(`)content(subprogramof)delimiter(`)> operator(=) string<delimiter(`)content(mp)delimiter(`)>operator(.)string<delimiter(`)content(programid)delimiter(`)>operator(\))operator(\))operator(\)) -reserved(UNION) -class(SELECT) string<delimiter(')content(sectionid)delimiter(')> reserved(AS) string<delimiter(`)content(idtype)delimiter(`)>operator(,) - string<delimiter(`)content(cc)delimiter(`)>operator(.)string<delimiter(`)content(sectionid)delimiter(`)> reserved(AS) string<delimiter(`)content(id)delimiter(`)>operator(,) - string<delimiter(`)content(cc)delimiter(`)>operator(.)string<delimiter(`)content(title)delimiter(`)> reserved(AS) string<delimiter(`)content(title)delimiter(`)>operator(,) - string<delimiter(`)content(cc)delimiter(`)>operator(.)string<delimiter(`)content(description)delimiter(`)> reserved(AS) string<delimiter(`)content(description)delimiter(`)>operator(,) - string<delimiter(`)content(l)delimiter(`)>operator(.)string<delimiter(`)content(mapurl)delimiter(`)> reserved(AS) string<delimiter(`)content(mapurl)delimiter(`)>operator(,) - string<delimiter(`)content(cc)delimiter(`)>operator(.)string<delimiter(`)content(starttime)delimiter(`)> reserved(AS) string<delimiter(`)content(startdate)delimiter(`)>operator(,) - string<delimiter(`)content(cc)delimiter(`)>operator(.)string<delimiter(`)content(endtime)delimiter(`)> reserved(AS) string<delimiter(`)content(enddate)delimiter(`)>operator(,) - string<delimiter(`)content(c)delimiter(`)>operator(.)string<delimiter(`)content(class)delimiter(`)> reserved(AS) string<delimiter(`)content(class)delimiter(`)>operator(,) - string<delimiter(`)content(c)delimiter(`)>operator(.)string<delimiter(`)content(classname)delimiter(`)> reserved(AS) string<delimiter(`)content(classname)delimiter(`)>operator(,) - string<delimiter(`)content(per)delimiter(`)>operator(.)string<delimiter(`)content(firstname)delimiter(`)> reserved(AS) string<delimiter(`)content(firstname)delimiter(`)>operator(,) - string<delimiter(`)content(per)delimiter(`)>operator(.)string<delimiter(`)content(lastname)delimiter(`)> reserved(AS) string<delimiter(`)content(lastname)delimiter(`)>operator(,) - string<delimiter(`)content(c)delimiter(`)>operator(.)string<delimiter(`)content(description)delimiter(`)> reserved(AS) string<delimiter(`)content(classdesc)delimiter(`)>operator(,) - string<delimiter(`)content(p)delimiter(`)>operator(.)string<delimiter(`)content(programid)delimiter(`)> reserved(AS) string<delimiter(`)content(programid)delimiter(`)>operator(,) - reserved(If)operator(()operator(()string<delimiter(`)content(p)delimiter(`)>operator(.)string<delimiter(`)content(subprogramof)delimiter(`)> reserved(IS) reserved(NOT) pre_constant(NULL)operator(\))operator(,)string<delimiter(`)content(mp)delimiter(`)>operator(.)string<delimiter(`)content(programname)delimiter(`)>operator(,) - string<delimiter(`)content(p)delimiter(`)>operator(.)string<delimiter(`)content(programname)delimiter(`)>operator(\)) reserved(AS) string<delimiter(`)content(programname)delimiter(`)>operator(,) - string<delimiter(`)content(d)delimiter(`)>operator(.)string<delimiter(`)content(longname)delimiter(`)> reserved(AS) string<delimiter(`)content(longname)delimiter(`)> -reserved(FROM) operator(()operator(()operator(()operator(()operator(()operator(()operator(()operator(()string<delimiter(`)content(calendarcache)delimiter(`)> string<delimiter(`)content(cc)delimiter(`)> - reserved(JOIN) string<delimiter(`)content(section)delimiter(`)> string<delimiter(`)content(s)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(cc)delimiter(`)>operator(.)string<delimiter(`)content(sectionid)delimiter(`)> operator(=) string<delimiter(`)content(s)delimiter(`)>operator(.)string<delimiter(`)content(sectionid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(person)delimiter(`)> string<delimiter(`)content(per)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(s)delimiter(`)>operator(.)string<delimiter(`)content(teacherid)delimiter(`)> operator(=) string<delimiter(`)content(per)delimiter(`)>operator(.)string<delimiter(`)content(personid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(division)delimiter(`)> string<delimiter(`)content(d)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(s)delimiter(`)>operator(.)string<delimiter(`)content(divisionid)delimiter(`)> operator(=) string<delimiter(`)content(d)delimiter(`)>operator(.)string<delimiter(`)content(divisionid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(location)delimiter(`)> string<delimiter(`)content(l)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(s)delimiter(`)>operator(.)string<delimiter(`)content(locationid)delimiter(`)> operator(=) string<delimiter(`)content(l)delimiter(`)>operator(.)string<delimiter(`)content(locationid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(class)delimiter(`)> string<delimiter(`)content(c)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(s)delimiter(`)>operator(.)string<delimiter(`)content(classid)delimiter(`)> operator(=) string<delimiter(`)content(c)delimiter(`)>operator(.)string<delimiter(`)content(classid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(program_class)delimiter(`)> string<delimiter(`)content(pc)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(c)delimiter(`)>operator(.)string<delimiter(`)content(classid)delimiter(`)> operator(=) string<delimiter(`)content(pc)delimiter(`)>operator(.)string<delimiter(`)content(classid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(program)delimiter(`)> string<delimiter(`)content(p)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(pc)delimiter(`)>operator(.)string<delimiter(`)content(programid)delimiter(`)> operator(=) string<delimiter(`)content(p)delimiter(`)>operator(.)string<delimiter(`)content(programid)delimiter(`)>operator(\))operator(\))operator(\)) - reserved(LEFT) reserved(JOIN) string<delimiter(`)content(program)delimiter(`)> string<delimiter(`)content(mp)delimiter(`)> - reserved(ON) operator(()operator(()string<delimiter(`)content(p)delimiter(`)>operator(.)string<delimiter(`)content(subprogramof)delimiter(`)> operator(=) string<delimiter(`)content(mp)delimiter(`)>operator(.)string<delimiter(`)content(programid)delimiter(`)>operator(\))operator(\))operator(\)) -reserved(WHERE) operator(()reserved(NOT) operator(()operator(()string<delimiter(`)content(cc)delimiter(`)>operator(.)string<delimiter(`)content(description)delimiter(`)> reserved(LIKE) string<delimiter(')content(%{cs}%)delimiter(')>operator(\))operator(\))operator(\))
\ No newline at end of file diff --git a/test/scanners/sql/mysql-long-queries.in.sql b/test/scanners/sql/mysql-long-queries.in.sql deleted file mode 100644 index 5704d6b..0000000 --- a/test/scanners/sql/mysql-long-queries.in.sql +++ /dev/null @@ -1,254 +0,0 @@ -/* This is a modified copy of the - query linked above to test other keywords: */ -SELECT sd.qbclass, -- Comments Test - Sum(sd.amount) AS invoiceamount, # Comments Test - Sum(scd1.amount) AS paymentsperiod1, - Sum(scd2.amount) AS paymentsperiod2, - Sum(scd3.amount) AS paymentsperiod3 -FROM studentdebit AS sd - LEFT JOIN (SELECT studentcreditdetail.studentdebitid, - studentcreditdetail.amount, - studentcredit.date, - credittype.credittype - FROM studentcreditdetail - INNER JOIN studentcredit - ON studentcreditdetail.studentcreditid = studentcredit.studentcreditid - AND studentcredit.obsolete = 0 /* Not Deleted */ - AND studentcredit.status = 1 /* Successful */ - /* PERIOD 1 */ - AND studentcredit.date < Now() - /* PERIOD 1 */ - AND studentcredit.date > Now() - INTERVAL 1 MONTH - LEFT JOIN credittype - USING(credittypeid)) AS scd1 - ON sd.studentdebitid = scd1.studentdebitid - LEFT JOIN (SELECT studentcreditdetail.studentdebitid, - studentcreditdetail.amount, - studentcredit.date, - credittype.credittype - FROM studentcreditdetail - INNER JOIN studentcredit - ON studentcreditdetail.studentcreditid = studentcredit.studentcreditid - AND studentcredit.obsolete = 0 /* Not Deleted */ - AND studentcredit.status = 1 /* Successful */ - /* PERIOD 2 */ - AND studentcredit.date < Now() - INTERVAL 1 MONTH - /* PERIOD 2 */ - AND studentcredit.date > Now() - INTERVAL 2 MONTH - LEFT OUTER JOIN credittype - USING(credittypeid)) AS scd2 - ON sd.studentdebitid = scd2.studentdebitid - RIGHT JOIN (SELECT studentcreditdetail.studentdebitid, - studentcreditdetail.amount, - studentcredit.date, - credittype.credittype - FROM studentcreditdetail - INNER JOIN studentcredit - ON studentcreditdetail.studentcreditid = studentcredit.studentcreditid - AND studentcredit.obsolete = 0 /* Not Deleted */ - AND studentcredit.status = 1 /* Successful */ - /* PERIOD 3 */ - AND studentcredit.date < Now() - INTERVAL 2 MONTH - /* PERIOD 3 */ - AND studentcredit.date > Now() - INTERVAL 3 MONTH - LEFT JOIN credittype - USING(credittypeid)) AS scd3 - ON sd.studentdebitid = scd3.studentdebitid -WHERE sd.obsolete = 0 /* Not Deleted */ - AND sd.status = 0 /* Normal */ - /* Exclude Voided Invoices */ - AND sd.adjustsdebitid IS NULL - AND sd.studentdebitid NOT IN (SELECT adjustsdebitid - FROM studentdebit - WHERE adjustsdebitid IS NOT NULL) - /* FULL PERIOD */ - AND sd.DATE < Now() - /* FULL PERIOD */ - AND sd.DATE > Now() - INTERVAL 3 MONTH -GROUP BY sd.qbclass -/* Formatting only */ -UNION ALL -SELECT '---', - '---', - '---', - '---', - '---' -/* Payment Types Summary */ -UNION DISTINCT -SELECT credittype, - invoiceamount, - Sum(paymentsperiod1), - Sum(paymentsperiod2), - Sum(paymentsperiod3) -FROM (SELECT scd.credittype, - '' AS invoiceamount, - Sum(scd.amount) AS paymentsperiod1, - '' AS paymentsperiod2, - '' AS paymentsperiod3 - FROM studentdebit AS sd - INNER JOIN (SELECT studentcreditdetail.studentdebitid, - studentcreditdetail.amount, - studentcredit.date, - credittype.credittype - FROM studentcreditdetail - INNER JOIN studentcredit - ON studentcreditdetail.studentcreditid = studentcredit.studentcreditid - AND studentcredit.obsolete = 0 /* Not Deleted */ - AND studentcredit.status = 1 /* Successful */ - /* PERIOD 1 */ - AND studentcredit.date < Now() - /* PERIOD 1 */ - AND studentcredit.date > Now() - INTERVAL 1 MONTH - LEFT JOIN credittype - USING(credittypeid)) AS scd - ON sd.studentdebitid = scd.studentdebitid - WHERE sd.obsolete = 0 /* Not Deleted */ - AND sd.status = 0 /* Normal */ - /* Exclude Voided Invoices */ - AND sd.adjustsdebitid IS NULL - AND sd.studentdebitid NOT IN (SELECT adjustsdebitid - FROM studentdebit - WHERE adjustsdebitid IS NOT NULL) - AND sd.DATE < Now() - AND sd.DATE > Now() - INTERVAL 3 MONTH - GROUP BY scd.credittype - UNION ALL - SELECT scd.credittype, - '' AS invoiceamount, - '' AS paymentsperiod1, - Sum(scd.amount) AS paymentsperiod2, - '' AS paymentsperiod3 - FROM studentdebit AS sd - INNER JOIN (SELECT studentcreditdetail.studentdebitid, - studentcreditdetail.amount, - studentcredit.date, - credittype.credittype - FROM studentcreditdetail - INNER JOIN studentcredit - ON studentcreditdetail.studentcreditid = studentcredit.studentcreditid - AND studentcredit.obsolete = 0 /* Not Deleted */ - AND studentcredit.status = 1 /* Successful */ - /* PERIOD 2 */ - AND studentcredit.date < Now() - INTERVAL 1 MONTH - /* PERIOD 2 */ - AND studentcredit.date > Now() - INTERVAL 2 MONTH - LEFT JOIN credittype - USING(credittypeid)) AS scd - ON sd.studentdebitid = scd.studentdebitid - WHERE sd.obsolete = 0 /* Not Deleted */ - AND sd.status = 0 /* Normal */ - /* Exclude Voided Invoices */ - AND sd.adjustsdebitid IS NULL - AND sd.studentdebitid NOT IN (SELECT adjustsdebitid - FROM studentdebit - WHERE adjustsdebitid IS NOT NULL) - AND sd.DATE < Now() - AND sd.DATE > Now() - INTERVAL 3 MONTH - GROUP BY scd.credittype - UNION ALL - SELECT scd.credittype, - '' AS invoiceamount, - '' AS paymentsperiod1, - '' AS paymentsperiod2, - Sum(scd.amount) AS paymentsperiod3 - FROM studentdebit AS sd - INNER JOIN (SELECT studentcreditdetail.studentdebitid, - studentcreditdetail.amount, - studentcredit.date, - credittype.credittype - FROM studentcreditdetail - INNER JOIN studentcredit - ON studentcreditdetail.studentcreditid = studentcredit.studentcreditid - AND studentcredit.obsolete = 0 /* Not Deleted */ - AND studentcredit.status = 1 /* Successful */ - /* PERIOD 3 */ - AND studentcredit.date < Now() - INTERVAL 2 MONTH - /* PERIOD 3 */ - AND studentcredit.date > Now() - INTERVAL 3 MONTH - LEFT JOIN credittype - USING(credittypeid)) AS scd - ON sd.studentdebitid = scd.studentdebitid - WHERE sd.obsolete = 0 /* Not Deleted */ - AND sd.status = 0 /* Normal */ - /* Exclude Voided Invoices */ - AND sd.adjustsdebitid IS NULL - AND sd.studentdebitid NOT IN (SELECT adjustsdebitid - FROM studentdebit - WHERE adjustsdebitid IS NOT NULL) - AND sd.date < Now() - AND sd.date > Now() - INTERVAL 3 MONTH - GROUP BY scd.credittype) AS ct -GROUP BY ct.credittype - -SELECT 'mediaid' AS `idtype`, - `m`.`mediaid` AS `id`, - `m`.`title` AS `title`, - `m`.`description` AS `description`, - `m`.`source` AS `source`, - `m`.`date` AS `startdate`, - `m`.`date` AS `enddate`, - `c`.`class` AS `class`, - `c`.`classname` AS `classname`, - `per`.`firstname` AS `firstname`, - `per`.`lastname` AS `lastname`, - `c`.`description` AS `classdesc`, - `p`.`programid` AS `programid`, - If((`p`.`subprogramof` IS NOT NULL),`mp`.`programname`, - `p`.`programname`) AS `programname`, - 'Recorded' AS `longname` -FROM ((((((((`media` `m` - JOIN `mediaaudience` `ma` - ON (((`m`.`mediaid` = `ma`.`mediaid`) - AND (`ma`.`audiencetype` = 'Public') - AND ((`ma`.`enddate` < Now()) - OR Isnull(`ma`.`enddate`))))) - LEFT JOIN `mediapresenter` `mpp` - ON ((`m`.`mediaid` = `mpp`.`mediaid`))) - LEFT JOIN `person` `per` - ON ((`mpp`.`personid` = `per`.`personid`))) - LEFT JOIN `mediaaudience` `mad` - ON (((`ma`.`mediaid` = `mad`.`mediaid`) - AND (`mad`.`audiencetype` = 'classid')))) - LEFT JOIN `class` `c` - ON ((`mad`.`audienceid` = `c`.`classid`))) - LEFT JOIN `program_class` `pc` - ON ((`c`.`classid` = `pc`.`classid`))) - LEFT JOIN `program` `p` - ON ((`pc`.`programid` = `p`.`programid`))) - LEFT JOIN `program` `mp` - ON ((`p`.`subprogramof` = `mp`.`programid`))) -UNION -SELECT 'sectionid' AS `idtype`, - `cc`.`sectionid` AS `id`, - `cc`.`title` AS `title`, - `cc`.`description` AS `description`, - `l`.`mapurl` AS `mapurl`, - `cc`.`starttime` AS `startdate`, - `cc`.`endtime` AS `enddate`, - `c`.`class` AS `class`, - `c`.`classname` AS `classname`, - `per`.`firstname` AS `firstname`, - `per`.`lastname` AS `lastname`, - `c`.`description` AS `classdesc`, - `p`.`programid` AS `programid`, - If((`p`.`subprogramof` IS NOT NULL),`mp`.`programname`, - `p`.`programname`) AS `programname`, - `d`.`longname` AS `longname` -FROM ((((((((`calendarcache` `cc` - JOIN `section` `s` - ON ((`cc`.`sectionid` = `s`.`sectionid`))) - LEFT JOIN `person` `per` - ON ((`s`.`teacherid` = `per`.`personid`))) - LEFT JOIN `division` `d` - ON ((`s`.`divisionid` = `d`.`divisionid`))) - LEFT JOIN `location` `l` - ON ((`s`.`locationid` = `l`.`locationid`))) - LEFT JOIN `class` `c` - ON ((`s`.`classid` = `c`.`classid`))) - LEFT JOIN `program_class` `pc` - ON ((`c`.`classid` = `pc`.`classid`))) - LEFT JOIN `program` `p` - ON ((`pc`.`programid` = `p`.`programid`))) - LEFT JOIN `program` `mp` - ON ((`p`.`subprogramof` = `mp`.`programid`))) -WHERE (NOT ((`cc`.`description` LIKE '%{cs}%')))
\ No newline at end of file diff --git a/test/scanners/sql/norwegian.expected.raydebug b/test/scanners/sql/norwegian.expected.raydebug deleted file mode 100644 index 1222709..0000000 --- a/test/scanners/sql/norwegian.expected.raydebug +++ /dev/null @@ -1,48 +0,0 @@ -class(select) integer(1) reserved(from)comment(-- Skapa en ny tabell med de endast de språkkoder vi accepterar) -class(CREATE) type(TABLE) ident(public)operator(.)ident(languages) operator(() - ident(language_code) pre_type(char)operator(()integer(2)operator(\)) reserved(PRIMARY) reserved(KEY) -operator(\))operator(;) -class(INSERT) class(INTO) ident(public)operator(.)ident(languages) reserved(VALUES) operator(()string<delimiter(')content(sv)delimiter(')>operator(\))operator(,)operator(()string<delimiter(')content(de)delimiter(')>operator(\))operator(,)operator(()string<delimiter(')content(da)delimiter(')>operator(\))operator(,)operator(()string<delimiter(')content(no)delimiter(')>operator(\))operator(,)operator(()string<delimiter(')content(fi)delimiter(')>operator(\))operator(;) -class(COMMENT) reserved(ON) type(COLUMN) ident(public)operator(.)ident(languages)operator(.)ident(language_code) reserved(IS) string<delimiter(')content(Codes according to ISO 639)delimiter(')>operator(;) -class(GRANT) class(SELECT) reserved(ON) ident(public)operator(.)ident(languages) reserved(TO) reserved(GROUP) ident(readonly)operator(;) -class(GRANT) reserved(ALL) reserved(ON) ident(public)operator(.)ident(languages) reserved(TO) reserved(GROUP) ident(readwrite)operator(;) - -comment(-- Lägg till en ny column i color_description som hanterar language_code instället för) -comment(-- locale som idag.) -comment(-- 1. Lägg till kolumnen.) -comment(-- 2. Fyll den med data från locale kolumnen.) -comment(-- 3. Ändra så att columnen inte får vara tom) -comment(-- 4. Lägg till constraint mot tidigare skapade tabellen languages.) -comment(-- 5. Sätt kommentar på locale kolumnen om att den inte bör användas.) -class(ALTER) type(TABLE) ident(products)operator(.)ident(color_description) class(ADD) type(COLUMN) ident(language_code) pre_type(char)operator(()integer(2)operator(\))operator(;) -class(UPDATE) ident(products)operator(.)ident(color_description) -class(SET) ident(language_code) operator(=) operator(()reserved(CASE) reserved(WHEN) ident(locale) reserved(like) string<delimiter(')content(ty%)delimiter(')> - reserved(THEN) string<delimiter(')content(de)delimiter(')> - reserved(ELSE) predefined(SUBSTRING)operator(()ident(locale) reserved(FROM) integer(1) reserved(FOR) integer(2)operator(\)) reserved(END)operator(\))operator(;) -class(ALTER) type(TABLE) ident(products)operator(.)ident(color_description) class(ALTER) type(COLUMN) ident(language_code) class(SET) reserved(NOT) pre_constant(NULL)operator(;) -class(ALTER) type(TABLE) ident(products)operator(.)ident(color_description) - class(ADD) reserved(CONSTRAINT) ident(products_color_description_lang_ref) - reserved(FOREIGN) reserved(KEY) operator(()ident(language_code)operator(\)) reserved(REFERENCES) ident(public)operator(.)ident(languages)operator(()ident(language_code)operator(\))operator(;) -class(COMMENT) reserved(ON) type(COLUMN) ident(products)operator(.)ident(color_description)operator(.)ident(locale) -reserved(IS) string<delimiter(')content(<¡> PAHSE OUT, use language_code instead)delimiter(')>operator(;) - - - -comment(-- Lägg till en ny column i frame_description som hanterar language_code instället för) -comment(-- locale som idag.) -comment(-- 1. Lägg till kolumnen.) -comment(-- 2. Fyll den med data från locale kolumnen.) -comment(-- 3. Ändra så att columnen inte får vara tom) -comment(-- 4. Lägg till constraint mot tidigare skapade tabellen languages.) -comment(-- 5. Sätt kommentar på locale kolumnen om att den inte bör användas.) -class(ALTER) type(TABLE) ident(products)operator(.)ident(frame_description) class(ADD) type(COLUMN) ident(language_code) pre_type(char)operator(()integer(2)operator(\))operator(;) -class(UPDATE) ident(products)operator(.)ident(frame_description) -class(SET) ident(language_code) operator(=) operator(()reserved(CASE) reserved(WHEN) ident(locale) reserved(like) string<delimiter(')content(ty%)delimiter(')> - reserved(THEN) string<delimiter(')content(de)delimiter(')> - reserved(ELSE) predefined(SUBSTRING)operator(()ident(locale) reserved(FROM) integer(1) reserved(FOR) integer(2)operator(\)) reserved(END)operator(\))operator(;) -class(ALTER) type(TABLE) ident(products)operator(.)ident(frame_description) class(ALTER) type(COLUMN) ident(language_code) class(SET) reserved(NOT) pre_constant(NULL)operator(;) -class(ALTER) type(TABLE) ident(products)operator(.)ident(frame_description) - class(ADD) reserved(CONSTRAINT) ident(products_frame_description_lang_ref) - reserved(FOREIGN) reserved(KEY) operator(()ident(language_code)operator(\)) reserved(REFERENCES) ident(public)operator(.)ident(languages)operator(()ident(language_code)operator(\))operator(;) -class(COMMENT) reserved(ON) type(COLUMN) ident(products)operator(.)ident(frame_description)operator(.)ident(locale) -reserved(IS) string<delimiter(')content(<¡> PAHSE OUT, use language_code instead)delimiter(')>operator(;) diff --git a/test/scanners/sql/norwegian.in.sql b/test/scanners/sql/norwegian.in.sql deleted file mode 100644 index b1241b8..0000000 --- a/test/scanners/sql/norwegian.in.sql +++ /dev/null @@ -1,48 +0,0 @@ -select 1 from-- Skapa en ny tabell med de endast de språkkoder vi accepterar -CREATE TABLE public.languages ( - language_code char(2) PRIMARY KEY -); -INSERT INTO public.languages VALUES ('sv'),('de'),('da'),('no'),('fi'); -COMMENT ON COLUMN public.languages.language_code IS 'Codes according to ISO 639'; -GRANT SELECT ON public.languages TO GROUP readonly; -GRANT ALL ON public.languages TO GROUP readwrite; - --- Lägg till en ny column i color_description som hanterar language_code instället för --- locale som idag. --- 1. Lägg till kolumnen. --- 2. Fyll den med data från locale kolumnen. --- 3. Ändra så att columnen inte får vara tom --- 4. Lägg till constraint mot tidigare skapade tabellen languages. --- 5. Sätt kommentar på locale kolumnen om att den inte bör användas. -ALTER TABLE products.color_description ADD COLUMN language_code char(2); -UPDATE products.color_description -SET language_code = (CASE WHEN locale like 'ty%' - THEN 'de' - ELSE SUBSTRING(locale FROM 1 FOR 2) END); -ALTER TABLE products.color_description ALTER COLUMN language_code SET NOT NULL; -ALTER TABLE products.color_description - ADD CONSTRAINT products_color_description_lang_ref - FOREIGN KEY (language_code) REFERENCES public.languages(language_code); -COMMENT ON COLUMN products.color_description.locale -IS '<¡> PAHSE OUT, use language_code instead'; - - - --- Lägg till en ny column i frame_description som hanterar language_code instället för --- locale som idag. --- 1. Lägg till kolumnen. --- 2. Fyll den med data från locale kolumnen. --- 3. Ändra så att columnen inte får vara tom --- 4. Lägg till constraint mot tidigare skapade tabellen languages. --- 5. Sätt kommentar på locale kolumnen om att den inte bör användas. -ALTER TABLE products.frame_description ADD COLUMN language_code char(2); -UPDATE products.frame_description -SET language_code = (CASE WHEN locale like 'ty%' - THEN 'de' - ELSE SUBSTRING(locale FROM 1 FOR 2) END); -ALTER TABLE products.frame_description ALTER COLUMN language_code SET NOT NULL; -ALTER TABLE products.frame_description - ADD CONSTRAINT products_frame_description_lang_ref - FOREIGN KEY (language_code) REFERENCES public.languages(language_code); -COMMENT ON COLUMN products.frame_description.locale -IS '<¡> PAHSE OUT, use language_code instead'; diff --git a/test/scanners/sql/reference.expected.raydebug b/test/scanners/sql/reference.expected.raydebug deleted file mode 100644 index 443c59b..0000000 --- a/test/scanners/sql/reference.expected.raydebug +++ /dev/null @@ -1,109 +0,0 @@ -comment(# All of the values below are valid MySQL syntax accoring to) -comment(# the Reference Manual:) -comment(# http://dev.mysql.com/doc/refman/5.1/en/language-structure.html) -comment(# unless stated otherwise.) - -comment(# strings) -class(SELECT) string<delimiter(')content(a string)delimiter(')>operator(;) -class(SELECT) string<delimiter(")content(another string)delimiter(")>operator(;) - -class(SELECT) string<modifier(_latin1)delimiter(')content(string)delimiter(')>operator(;) -class(SELECT) string<modifier(_latin1)delimiter(')content(string)delimiter(')> reserved(COLLATE) ident(latin1_danish_ci)operator(;) - -class(SELECT) string<modifier(N)delimiter(')content(some text)delimiter(')>operator(;) -class(SELECT) string<modifier(n)delimiter(')content(some text)delimiter(')>operator(;) -class(SELECT) string<modifier(_utf8)delimiter(')content(some text)delimiter(')>operator(;) - -class(SELECT) string<delimiter(")char(\\0)char(\\')char(\\")content(''"")char(\\b)char(\\n)char(\\r)char(\\t)char(\\Z)char(\\\\)char(\\%)char(\\_)delimiter(")>operator(;) comment(# ") -class(SELECT) string<delimiter(')char(\\0)char(\\')char(\\")content(''"")char(\\b)char(\\n)char(\\r)char(\\t)char(\\Z)char(\\\\)char(\\%)char(\\_)delimiter(')>operator(;) comment(# ') - -class(SELECT) string<delimiter(")char(\\B)char(\\x)delimiter(")>operator(;) comment(# ") -class(SELECT) string<delimiter(')char(\\B)char(\\x)delimiter(')>operator(;) comment(# ') - -class(SELECT) string<delimiter(')content(hello)delimiter(')>operator(,) string<delimiter(')content("hello")delimiter(')>operator(,) string<delimiter(')content(""hello"")delimiter(')>operator(,) string<delimiter(')content(hel''lo)delimiter(')>operator(,) string<delimiter(')char(\\')content(hello)delimiter(')>operator(;) comment(-- ') -class(SELECT) string<delimiter(")content(hello)delimiter(")>operator(,) string<delimiter(")content('hello')delimiter(")>operator(,) string<delimiter(")content(''hello'')delimiter(")>operator(,) string<delimiter(")content(hel""lo)delimiter(")>operator(,) string<delimiter(")char(\\")content(hello)delimiter(")>operator(;) comment(-- ") - -class(SELECT) string<delimiter(')content(This)char(\\n)content(Is)char(\\n)content(Four)char(\\n)content(Lines)delimiter(')>operator(;) -class(SELECT) string<delimiter(')content(disappearing)char(\\ )content(backslash)delimiter(')>operator(;) - -comment(# numbers) -class(select) integer(1221)operator(;) -class(select) integer(0)operator(;) -class(select) operator(-)integer(32)error(:) - -class(select) float(294.42)error(:) -class(select) operator(-)float(32032.6809e+10)operator(;) -class(select) float(148.00)operator(;) - -class(select) float(10e+10)operator(;) -class(select) float(10e10)operator(;) - -comment(# hexadecimal) -class(SELECT) string<modifier(X)delimiter(')content(4D7953514C)delimiter(')>operator(;) -class(SELECT) hex(0x0a)operator(+)integer(0)operator(;) -class(SELECT) hex(0x5061756c)operator(;) -class(SELECT) hex(0x41)operator(,) predefined(CAST)operator(()hex(0x41) reserved(AS) pre_type(UNSIGNED)operator(\))operator(;) -class(SELECT) pre_type(HEX)operator(()string<delimiter(')content(cat)delimiter(')>operator(\))operator(;) -class(SELECT) hex(0x636174)operator(;) -class(insert) class(into) ident(t) operator(()ident(md5)operator(\)) reserved(values) operator(()hex(0xad65)operator(\))operator(;) -class(SELECT) operator(*) reserved(FROM) ident(SomeTable) reserved(WHERE) ident(BinaryColumn) operator(=) predefined(CAST)operator(() string<modifier(x)delimiter(')content(a0f44ef7a52411de)delimiter(')> reserved(AS) pre_type(BINARY) operator(\))operator(;) -class(select) string<modifier(x)delimiter(')content(000bdddc0e9153f5a93447fc3310f710)delimiter(')>operator(,) string<modifier(x)delimiter(')content(0bdddc0e9153f5a93447fc3310f710)delimiter(')>operator(;) - -class(SELECT) pre_constant(TRUE)operator(,) pre_constant(true)operator(,) pre_constant(FALSE)operator(,) pre_constant(false)operator(;) -class(SELECT) pre_constant(NULL)operator(,) pre_constant(null)operator(,) pre_constant(nuLL)operator(,) pre_constant(\\N)operator(;) -class(SELECT) error(\\)ident(n)operator(;) comment(# invalid!) - -comment(# bit-field) -class(CREATE) type(TABLE) ident(t) operator(()ident(b) pre_type(BIT)operator(()integer(8)operator(\))operator(\))operator(;) -class(INSERT) class(INTO) ident(t) class(SET) ident(b) operator(=) string<modifier(b)delimiter(')content(11111111)delimiter(')>operator(;) -class(INSERT) class(INTO) ident(t) class(SET) ident(b) operator(=) string<modifier(b)delimiter(')content(1010)delimiter(')>operator(;) -class(INSERT) class(INTO) ident(t) class(SET) ident(b) operator(=) string<modifier(b)delimiter(')content(0101)delimiter(')>operator(;) -class(SELECT) ident(b)operator(+)integer(0)operator(,) pre_type(BIN)operator(()ident(b)operator(+)integer(0)operator(\))operator(,) pre_type(OCT)operator(()ident(b)operator(+)integer(0)operator(\))operator(,) pre_type(HEX)operator(()ident(b)operator(+)integer(0)operator(\)) reserved(FROM) ident(t)operator(;) - -class(SET) variable(@v1) operator(=) string<modifier(b)delimiter(')content(1000001)delimiter(')>operator(;) -class(SET) variable(@v2) operator(=) predefined(CAST)operator(()string<modifier(b)delimiter(')content(1000001)delimiter(')> reserved(AS) pre_type(UNSIGNED)operator(\))operator(,) variable(@v3) operator(=) string<modifier(b)delimiter(')content(1000001)delimiter(')>operator(+)integer(0)operator(;) -class(SELECT) variable(@v1)operator(,) variable(@v2)operator(,) variable(@v3)operator(;) - -class(INSERT) class(INTO) ident(my_table) operator(()ident(phone)operator(\)) reserved(VALUES) operator(()pre_constant(NULL)operator(\))operator(;) -class(INSERT) class(INTO) ident(my_table) operator(()ident(phone)operator(\)) reserved(VALUES) operator(()string<delimiter(')delimiter(')>operator(\))operator(;) - -comment(# schema object names) -class(SELECT) operator(*) reserved(FROM) string<delimiter(`)content(select)delimiter(`)> reserved(WHERE) string<delimiter(`)content(select)delimiter(`)>operator(.)ident(id) operator(>) integer(100)operator(;) - -class(CREATE) type(TABLE) string<delimiter(`)content(a``b)delimiter(`)> operator(()string<delimiter(`)content(c"d)delimiter(`)> pre_type(INT)operator(\))operator(;) -class(SELECT) integer(1) reserved(AS) string<delimiter(`)content(one)delimiter(`)>operator(,) integer(2) reserved(AS) string<delimiter(')content(two)delimiter(')>operator(;) - -class(select) ident(foo) reserved(from) ident(foo)operator(;) -class(select) string<delimiter(`)content(foo)delimiter(`)> reserved(from) ident(foo)operator(;) -class(select) ident(foo)operator(.)ident(bar) reserved(from) ident(foo)operator(;) -class(select) string<delimiter(`)content(foo)delimiter(`)>operator(.)ident(bar) reserved(from) ident(foo)operator(;) -class(select) ident(foo)operator(.)string<delimiter(`)content(bar)delimiter(`)> reserved(from) ident(foo)operator(;) -class(select) string<delimiter(`)content(foo.bar)delimiter(`)> reserved(from) ident(foo)operator(;) -class(select) string<delimiter(`)content(foo)delimiter(`)>operator(.)string<delimiter(`)content(bar)delimiter(`)> reserved(from) ident(foo)operator(;) - -comment(# How to handle ANSI_QUOTES?) -class(CREATE) type(TABLE) string<delimiter(")content(test)delimiter(")> operator(()ident(col) pre_type(INT)operator(\))operator(;) -class(SET) ident(sql_mode)operator(=)string<delimiter(')content(ANSI_QUOTES)delimiter(')>operator(;) -class(CREATE) type(TABLE) string<delimiter(")content(test)delimiter(")> operator(()ident(col) pre_type(INT)operator(\))operator(;) - -comment(# identifiers) -class(SELECT) operator(*) reserved(FROM) ident(my_table) reserved(WHERE) ident(MY_TABLE)operator(.)ident(col)operator(=)integer(1)operator(;) -class(SHOW) type(COLUMNS) reserved(FROM) string<delimiter(`)content(#mysql50#a@b)delimiter(`)>operator(;) - -comment(# Function Name Parsing and Resolution) - - -class(SELECT) predefined(COUNT)operator(()operator(*)operator(\)) reserved(FROM) ident(mytable)operator(;) comment(-- the first reference to count is a function call) -class(CREATE) type(TABLE) predefined(count) operator(()ident(i) pre_type(INT)operator(\))operator(;) comment(-- whereas the second reference is a table name) -class(CREATE) type(TABLE) string<delimiter(`)content(count)delimiter(`)>operator(()ident(i) pre_type(INT)operator(\))operator(;) comment(-- this too) -class(CREATE) type(TABLE) string<delimiter(`)content(count)delimiter(`)> operator(()ident(i) pre_type(INT)operator(\))operator(;) comment(-- this too) - -comment(# IGNORE_SPACE) -class(SELECT) predefined(COUNT)operator(()operator(*)operator(\)) reserved(FROM) ident(mytable)operator(;) -class(SELECT) predefined(COUNT) operator(()operator(*)operator(\)) reserved(FROM) ident(mytable)operator(;) - -comment(# reserved words) -class(CREATE) type(TABLE) ident(interval) operator(()reserved(begin) pre_type(INT)operator(,) reserved(end) pre_type(INT)operator(\))operator(;) comment(-- errror) -class(CREATE) type(TABLE) string<delimiter(`)content(interval)delimiter(`)> operator(()reserved(begin) pre_type(INT)operator(,) reserved(end) pre_type(INT)operator(\))operator(;) comment(-- valid) -class(CREATE) type(TABLE) ident(mydb)operator(.)ident(interval) operator(()reserved(begin) pre_type(INT)operator(,) reserved(end) pre_type(INT)operator(\))operator(;) comment(-- valid) -class(SELECT) string<delimiter(`)content(foo)delimiter(`)>operator(,) string<delimiter(`)content(bar)delimiter(`)> reserved(FROM) string<delimiter(`)content(baz)delimiter(`)> reserved(WHERE) string<delimiter(`)content(bal)delimiter(`)> operator(=) string<delimiter(`)content(quiche)delimiter(`)>operator(;) comment(-- valid) diff --git a/test/scanners/sql/reference.in.sql b/test/scanners/sql/reference.in.sql deleted file mode 100644 index e301570..0000000 --- a/test/scanners/sql/reference.in.sql +++ /dev/null @@ -1,109 +0,0 @@ -# All of the values below are valid MySQL syntax accoring to -# the Reference Manual: -# http://dev.mysql.com/doc/refman/5.1/en/language-structure.html -# unless stated otherwise. - -# strings -SELECT 'a string'; -SELECT "another string"; - -SELECT _latin1'string'; -SELECT _latin1'string' COLLATE latin1_danish_ci; - -SELECT N'some text'; -SELECT n'some text'; -SELECT _utf8'some text'; - -SELECT "\0\'\"''""\b\n\r\t\Z\\\%\_"; # " -SELECT '\0\'\"''""\b\n\r\t\Z\\\%\_'; # ' - -SELECT "\B\x"; # " -SELECT '\B\x'; # ' - -SELECT 'hello', '"hello"', '""hello""', 'hel''lo', '\'hello'; -- ' -SELECT "hello", "'hello'", "''hello''", "hel""lo", "\"hello"; -- " - -SELECT 'This\nIs\nFour\nLines'; -SELECT 'disappearing\ backslash'; - -# numbers -select 1221; -select 0; -select -32: - -select 294.42: -select -32032.6809e+10; -select 148.00; - -select 10e+10; -select 10e10; - -# hexadecimal -SELECT X'4D7953514C'; -SELECT 0x0a+0; -SELECT 0x5061756c; -SELECT 0x41, CAST(0x41 AS UNSIGNED); -SELECT HEX('cat'); -SELECT 0x636174; -insert into t (md5) values (0xad65); -SELECT * FROM SomeTable WHERE BinaryColumn = CAST( x'a0f44ef7a52411de' AS BINARY ); -select x'000bdddc0e9153f5a93447fc3310f710', x'0bdddc0e9153f5a93447fc3310f710'; - -SELECT TRUE, true, FALSE, false; -SELECT NULL, null, nuLL, \N; -SELECT \n; # invalid! - -# bit-field -CREATE TABLE t (b BIT(8)); -INSERT INTO t SET b = b'11111111'; -INSERT INTO t SET b = b'1010'; -INSERT INTO t SET b = b'0101'; -SELECT b+0, BIN(b+0), OCT(b+0), HEX(b+0) FROM t; - -SET @v1 = b'1000001'; -SET @v2 = CAST(b'1000001' AS UNSIGNED), @v3 = b'1000001'+0; -SELECT @v1, @v2, @v3; - -INSERT INTO my_table (phone) VALUES (NULL); -INSERT INTO my_table (phone) VALUES (''); - -# schema object names -SELECT * FROM `select` WHERE `select`.id > 100; - -CREATE TABLE `a``b` (`c"d` INT); -SELECT 1 AS `one`, 2 AS 'two'; - -select foo from foo; -select `foo` from foo; -select foo.bar from foo; -select `foo`.bar from foo; -select foo.`bar` from foo; -select `foo.bar` from foo; -select `foo`.`bar` from foo; - -# How to handle ANSI_QUOTES? -CREATE TABLE "test" (col INT); -SET sql_mode='ANSI_QUOTES'; -CREATE TABLE "test" (col INT); - -# identifiers -SELECT * FROM my_table WHERE MY_TABLE.col=1; -SHOW COLUMNS FROM `#mysql50#a@b`; - -# Function Name Parsing and Resolution - - -SELECT COUNT(*) FROM mytable; -- the first reference to count is a function call -CREATE TABLE count (i INT); -- whereas the second reference is a table name -CREATE TABLE `count`(i INT); -- this too -CREATE TABLE `count` (i INT); -- this too - -# IGNORE_SPACE -SELECT COUNT(*) FROM mytable; -SELECT COUNT (*) FROM mytable; - -# reserved words -CREATE TABLE interval (begin INT, end INT); -- errror -CREATE TABLE `interval` (begin INT, end INT); -- valid -CREATE TABLE mydb.interval (begin INT, end INT); -- valid -SELECT `foo`, `bar` FROM `baz` WHERE `bal` = `quiche`; -- valid diff --git a/test/scanners/sql/selects.expected.raydebug b/test/scanners/sql/selects.expected.raydebug deleted file mode 100644 index ef1f051..0000000 --- a/test/scanners/sql/selects.expected.raydebug +++ /dev/null @@ -1,46 +0,0 @@ -comment(--RANDOM SQL QUERIES THAT DO NOTHING INTERESTING) -comment(--Copyright (C\) 2009 - Keith Pitt <keith@keithpitt.com>) - -comment(--This program is free software: you can redistribute it and/or modify) -comment(--it under the terms of the GNU General Public License as published by) -comment(--the Free Software Foundation, either version 3 of the License, or) -comment(--(at your option\) any later version.) - -comment(--This program is distributed in the hope that it will be useful,) -comment(--but WITHOUT ANY WARRANTY; without even the implied warranty of) -comment(--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the) -comment(--GNU General Public License for more details.) - -comment(--You should have received a copy of the GNU General Public License) -comment(--along with this program. If not, see <http://www.gnu.org/licenses/>.) - -class(SELECT) operator(*) reserved(FROM) ident(users)operator(;) - -class(select) operator(*) reserved(from) ident(users)operator(;) - -class(SELECT) string<delimiter(`)content(First Name)delimiter(`)>operator(,) string<delimiter(`)content(Last Name)delimiter(`)> reserved(FROM) string<delimiter(`)content(User Table)delimiter(`)>operator(;) - -class(select) ident(first_name)operator(,) ident(last_name) reserved(FROM) ident(users)operator(;) - -class(select) ident(first_name) operator(|)operator(|) string<delimiter(')content( )delimiter(')> operator(|)operator(|) ident(last_name) reserved(from) ident(users)operator(;) - -class(select) ident(first_name) operator(|)operator(|) string<delimiter(")content( )delimiter(")> operator(|)operator(|) ident(last_name) reserved(from) ident(users)operator(;) - -class(SELECT) operator(*) reserved(FROM) ident(users) reserved(JOIN) ident(companies) reserved(USING) operator(()ident(company_id)operator(\)) reserved(WHERE) ident(company_type) operator(=) string<delimiter(')content(Fortune 500)delimiter(')>operator(;) - -class(SELECT) operator(*) reserved(FROM) ident(users) reserved(WHERE) ident(name_first) reserved(LIKE) string<delimiter(')content(%Keith%)delimiter(')>operator(;) - -class(SELECT) reserved(CASE) reserved(WHEN) ident(foo)operator(.)ident(bar) operator(=) string<delimiter(')content(PY)delimiter(')> - reserved(THEN) string<delimiter(')content(BAR)delimiter(')> - reserved(ELSE) string<delimiter(')content(FOO)delimiter(')> - reserved(END) reserved(as) ident(bar_type)operator(,) - ident(user_id)operator(,) - ident(company_id)operator(,) - predefined(sum)operator(() - reserved(case) reserved(when) ident(foo)operator(.)ident(bar) operator(=) string<delimiter(')content(PY)delimiter(')> - reserved(then) operator(-)ident(amt) reserved(else) ident(amt) - reserved(end) - operator(\)) ident(over) operator(()reserved(order) reserved(by) ident(id)operator(,) ident(amt)operator(\)) reserved(as) ident(balance)operator(;) - -class(SELECT) ident(users)operator(.)operator(*)operator(,) operator(()class(SELECT) ident(company_name) reserved(FROM) ident(companies) reserved(WHERE) ident(company_id) operator(=) ident(users)operator(.)ident(company_id)operator(\)) reserved(FROM) ident(users)operator(;) - diff --git a/test/scanners/sql/selects.in.sql b/test/scanners/sql/selects.in.sql deleted file mode 100644 index 3c6203f..0000000 --- a/test/scanners/sql/selects.in.sql +++ /dev/null @@ -1,46 +0,0 @@ ---RANDOM SQL QUERIES THAT DO NOTHING INTERESTING ---Copyright (C) 2009 - Keith Pitt <keith@keithpitt.com> - ---This program is free software: you can redistribute it and/or modify ---it under the terms of the GNU General Public License as published by ---the Free Software Foundation, either version 3 of the License, or ---(at your option) any later version. - ---This program is distributed in the hope that it will be useful, ---but WITHOUT ANY WARRANTY; without even the implied warranty of ---MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ---GNU General Public License for more details. - ---You should have received a copy of the GNU General Public License ---along with this program. If not, see <http://www.gnu.org/licenses/>. - -SELECT * FROM users; - -select * from users; - -SELECT `First Name`, `Last Name` FROM `User Table`; - -select first_name, last_name FROM users; - -select first_name || ' ' || last_name from users; - -select first_name || " " || last_name from users; - -SELECT * FROM users JOIN companies USING (company_id) WHERE company_type = 'Fortune 500'; - -SELECT * FROM users WHERE name_first LIKE '%Keith%'; - -SELECT CASE WHEN foo.bar = 'PY' - THEN 'BAR' - ELSE 'FOO' - END as bar_type, - user_id, - company_id, - sum( - case when foo.bar = 'PY' - then -amt else amt - end - ) over (order by id, amt) as balance; - -SELECT users.*, (SELECT company_name FROM companies WHERE company_id = users.company_id) FROM users; - diff --git a/test/scanners/sql/suite.rb b/test/scanners/sql/suite.rb deleted file mode 100644 index f1122b3..0000000 --- a/test/scanners/sql/suite.rb +++ /dev/null @@ -1,2 +0,0 @@ -class SQL < CodeRay::TestCase -end |