cancel
Showing results for 
Search instead for 
Did you mean: 

Ultralite crashes using query with CASE

Former Member
2,308

Hello,

I have a query that makes Ultralite crash, both on iPad and on Interactive SQL application. I will put here a similar query that allows anyone to reproduce the problem:

select 
 case 
  when T.id < 1000 then 'a' 
  when T.id >= 1000 and T.id < 2000 then 'b' 
  when T.id >= 2000 and T.id < 3000 then 'c' 
  when T.id >= 3000 and T.id < 4000 then 'd' 
 else 'e' end as result
from 
(select cast(6371*acos(cos(radians(-23.596146))*cos(radians(id))*cos(radians(-46.686549)-radians(id))+sin(radians(-23.596146))*sin(radians(id))) as int) as id from testTable) as T(id)

So I have here a table named "testTable", with one int column named "id", and 1000 rows in it with random numbers. The query is used to calculate the distance in km between two coordinates, one of them coming from the table, the other one fixed in the query. I have used a subselect here because of constraints that oblige me to use it in the real application.

The crash doesn't occur if I:

  • Remove the case entirely, and just output the calculated column directly
  • Remove the multiplication (6371*) from the subselect

Both being not-acceptable solutions.

0 Kudos

Hi André,

Could you ulunload your test database (for the query you posted) and attach the .xml file?

Former Member

I can't attach files as I don't have enough "reputation points", but I have put it on pasteBin:

http://pastebin.com/XSD9kvFU

0 Kudos

Hi André,

Your repro is good - thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Thank you André for reporting this bug.

This has been fixed as of 12.0.1.3781.

Former Member
0 Kudos

Thanks Tim!

Answers (0)