Issue 106104 - [cws hsqldb19] SQL statement errors generates confusins error messages
Summary: [cws hsqldb19] SQL statement errors generates confusins error messages
Status: CONFIRMED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: DEV300m61
Hardware: Unknown All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-20 18:17 UTC by drewjensen.inbox
Modified: 2013-08-07 15:45 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
bug document (5.16 KB, application/vnd.sun.xml.base)
2009-10-20 18:18 UTC, drewjensen.inbox
no flags Details
bug document with example table (3.49 KB, application/vnd.sun.xml.base)
2009-10-21 23:01 UTC, drewjensen.inbox
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description drewjensen.inbox 2009-10-20 18:17:36 UTC
Tested on Win 7, OO.o 3.2 CWSHSQLdb 10-16-09, hsqldb.jar 10-20-09

To reproduce:
Open attached Bug Doc
Go to Tables
Select New view
Switch to SQL view
Enable SQL direct
Copy the following stateemnt

SELECT cu.customer_id AS ID, CONCAT(cu.first_name, ' ', cu.last_name) AS name,
a.address AS address, a.postal_code AS "zip code",
	a.phone AS phone, city.city AS city, country.country AS country, IF(cu.active,
'active', '') AS notes, cu.store_id AS SID
FROM customer AS cu JOIN address AS a ON cu.address_id = a.address_id JOIN city
ON a.city_id = city.city_id
	JOIN country ON city.country_id = country.country_id
	
Run the query

---------------------------
Debug Output
---------------------------
Error: ASSERT:
	TransactionManager...
	"Owner instance not right initialized yet. Call was rejected! Normaly it's an
algorithm error ... wrong usin of class!"

From File
d:/src/cws/hsqldb19/ooo/framework/source/threadhelp/transactionmanager.cxx at
Line 385

After selecting ignore OO.o displays an error dialog with error:
user lacks privlidges or object not found CONCAT
Comment 1 drewjensen.inbox 2009-10-20 18:18:49 UTC
Created attachment 65479 [details]
bug document
Comment 2 drewjensen.inbox 2009-10-20 18:19:19 UTC
Assign to developer
Comment 3 drewjensen.inbox 2009-10-20 20:10:35 UTC
This might be more appropriate as an error in the error message.

The first statement does have a mistake in the CONCAT funciton.

Fix that with:

SELECT cu.customer_id AS ID, 
	CONCAT(CONCAT(cu.first_name, ' '), cu.last_name) AS name, 
	a.address AS address, a.postal_code AS "zip code",
	a.phone AS phone, 
	city.city AS city, 
	country.country AS country, 
	IF(cu.active, 'active', '') AS notes, 
	cu.store_id AS SID
FROM customer AS cu JOIN address AS a ON cu.address_id = a.address_id 
JOIN city ON a.city_id = city.city_id
	JOIN country ON city.country_id = country.country_id

So - the IF is wrong for the HSQLdb dialect, but try to run it and the same
error as above is generated from the C++ runtime, the OO.o error dialog box
however now shows:

user lacks privlidges or object not found IF

Finally - if I clean it up and just pull out (what seems like a legit IF clause
to me) the query runs, and creates the view.

SELECT cu.customer_id AS ID, 
	COALESCE(cu.first_name || ' ' || cu.last_name,
			cu.last_name,
			cu.first_name,
			'') AS name, 
	a.address AS address, 
	a.postal_code AS "zip code",
	a.phone AS phone, 
	city.city AS city, 
	country.country AS country, 
--	IF cu.active <> FALSE THEN  
--		'active' 
--	ELSE 
--		''
--	 END AS notes, 
	'active' AS notes, 
	cu.store_id AS SID
FROM customer AS cu JOIN address AS a ON cu.address_id = a.address_id JOIN city
ON a.city_id = city.city_id
	JOIN country ON city.country_id = country.country_id
	

Comment 4 drewjensen.inbox 2009-10-21 23:01:33 UTC
Created attachment 65523 [details]
bug document with example table
Comment 5 ocke.janssen 2009-10-28 07:45:53 UTC
Adjust target
Comment 6 ocke.janssen 2010-07-08 12:33:27 UTC
Change target to 3.4.
Comment 7 ocke.janssen 2011-02-01 11:53:20 UTC
Just change target.