Bug 95174 - SQL parser doesn't support catalog&schema in function name
Summary: SQL parser doesn't support catalog&schema in function name
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.0.3.1 rc
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp, skillSql
Depends on:
Blocks:
 
Reported: 2015-10-19 10:35 UTC by Lionel Elie Mamane
Modified: 2017-02-14 08:57 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Elie Mamane 2015-10-19 10:35:09 UTC
for example

 SELECT schema_name.function_name(a, b) FROM C

while

 SELECT function_name(a, b) FROM C

works
Comment 1 QA Administrators 2016-11-08 11:10:14 UTC Comment hidden (obsolete)
Comment 2 Lionel Elie Mamane 2016-11-08 11:34:41 UTC
In file connectivity/source/parse/sqlbison.y, rule

function_name:
		string_function
	|	date_function
	|	numeric_function
	|	SQL_TOKEN_NAME

add two new cases, something like

	|	SQL_TOKEN_NAME '.' SQL_TOKEN_NAME 
			{$$ = SQL_NEW_RULE;
			$$->append($1);
			$$->append(newNode(".", SQLNodeType::Punctuation));
			$$->append($3);
			}
	|	SQL_TOKEN_NAME '.' SQL_TOKEN_NAME '.' SQL_TOKEN_NAME
			{$$ = SQL_NEW_RULE;
			$$->append($1);
			$$->append(newNode(".", SQLNodeType::Punctuation));
			$$->append($3);
			$$->append(newNode(".", SQLNodeType::Punctuation));
			$$->append($5);}

Then "git grep -E '(function_name|set_fct_spec)" and examine the code that matches this. If it examines one of these nodes, it expects a single token at the function_name place. It must be adapted to expect a token _or_ a node.