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.

asked 16 Aug '12, 15:53

Andr%C3%A9%20Freitas's gravatar image

André Freitas
1964510
accept rate: 0%

Hi André,

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

(16 Aug '12, 16:30) Tim McClements
Replies hidden
1

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

http://pastebin.com/XSD9kvFU

(16 Aug '12, 16:35) André Freitas

Hi André,

Your repro is good - thank you!

(17 Aug '12, 17:01) Tim McClements

Thank you André for reporting this bug.

This has been fixed as of 12.0.1.3781.

permanent link

answered 21 Aug '12, 12:45

Tim%20McClements's gravatar image

Tim McClements
1.9k1827
accept rate: 38%

Thanks Tim!

(21 Aug '12, 14:56) André Freitas
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×141
×44
×13

question asked: 16 Aug '12, 15:53

question was seen: 862 times

last updated: 21 Aug '12, 14:56