Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360714 - Formatting screws up SQL statements
Summary: Formatting screws up SQL statements
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Yun Feng Ma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-12 14:29 EDT by Justin Spadea CLA
Modified: 2017-02-23 14:16 EST (History)
3 users (show)

See Also:


Attachments
Patch (8.53 KB, patch)
2011-10-19 23:41 EDT, Yun Feng Ma CLA
lasher: iplog+
Details | Diff
Patch for preference page /IO statement (3.58 KB, patch)
2011-10-20 04:25 EDT, Xiao Bin Chen CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Spadea CLA 2011-10-12 14:29:20 EDT
The following statements get screwed up, probably due to parser changes:

add
delete
execute
foreach
prepare
replace

Examples:


library test

	function foo()
		expr string;
		ds SQLDataSource?;
		rs SQLResultSet?;
		stmt SQLStatement?;
		r rec;
		
		add r to ds;
		delete r from ds using expr for r with expr;
//		delete from ds; // Causes NPE - target is not required for delete
		execute from rs with stmt;
		prepare stmt from ds with #sql{};
		prepare stmt from ds with expr;
		replace r to ds using expr for r;
		replace r to ds with expr for r;
		
		forEach(r from rs)
		end
	end
end

record rec
	i int{@Id};
end
Comment 1 Jing Qian CLA 2011-10-18 10:09:28 EDT
Jimmy,

the formatter code needs to match the parser definition the egl.cup file 
if there are parser changes in egl.cup, then please update the formatter visitor, etc to update them
Comment 2 Justin Spadea CLA 2011-10-18 10:21:42 EDT
The egl.cup file did have a few changes for new/changed syntax in EDT. For example, the "with" clause can be a WithExpressionClause in addition to the already-existing WithInlineSQLClause ("with myVariable" instead of "with #sql{}").
Comment 3 Jing Qian CLA 2011-10-18 10:41:54 EDT
then while fixing this bug, it should also include the with clause
Comment 4 Yun Feng Ma CLA 2011-10-19 23:41:40 EDT
Created attachment 205574 [details]
Patch

Here is a patch. Thanks.
Comment 5 Xiao Bin Chen CLA 2011-10-20 04:25:53 EDT
Created attachment 205591 [details]
Patch for preference page /IO statement
Comment 6 Yun Feng Ma CLA 2011-10-20 23:18:15 EDT
Hi Jing, the "with" issue is fixed in this patch. Now tix is in. Thanks.
Comment 7 Justin Spadea CLA 2011-11-04 14:37:35 EDT
Verified