-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
What steps will reproduce the problem?
1. Parse the following query with keyword positions true
2. Error happens
What is the expected output? What do you see instead?
PHP Fatal error: Uncaught exception 'UnableToCalculatePositionException' with
message 'cannot calculate position of as dec within ,
cast(dec*30 as int)/30.0
-- now build mask grid.
-- This is a separate query if no temp tables can be made ' in
/Users/abiusx/Desktop/PHP-SQL-Parser/src/positions/PositionCalculator.php:199
What version of the product are you using? On what operating system?
php-sql-parser-20140108 OS X Yosemite
Please provide any additional information below.
SQL Query:
$sql1=<<<XXX
SELECT cast((ra/cos(cast(dec*30 as int)/30.0))*30 as int)/30.0 as raCosDec,
cast(dec*30 as int)/30.0 as dec,
count(*) as pop
FROM Galaxy as G,
fHTM_Cover('CONVEX J2000 6 175 -5 175 5 185 5 185 -5') as T
WHERE htmID between T.HTMIDstart* power(2,28)and T. HTMIDend*power(2,28)
and ra between 175 and 185
and dec between -5 and 5
and u-g > 1
and r < 21.5
GROUP BY cast((ra/cos(cast(dec*30 as int)/30.0))*30 as int)/30.0,
cast(dec*30 as int)/30.0
-- now build mask grid.
-- This is a separate query if no temp tables can be made
XXX;
Original issue reported on code.google.com by abi...@owasp.org on 25 Sep 2014 at 8:28