for example SELECT schema_name.function_name(a, b) FROM C while SELECT function_name(a, b) FROM C works
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.1.6 or 5.2.3 https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug-20161108
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.
Since past 2 weeks I am seeing this while building my local build via make for any changes I do - [CXX] workdir/YaccTarget/connectivity/source/parse/sqlbison.cxx [CXX] workdir/LexTarget/connectivity/source/parse/sqlflex.cxx [CXX] connectivity/source/parse/sqliterator.cxx [CXX] connectivity/source/parse/sqlnode.cxx /home/devansh/libreoffice/workdir/YaccTarget/connectivity/source/parse/sqlbison.cxx: In static member function ‘static rtl::OString connectivity::OSQLParser::TokenIDToStr(sal_uInt32, const connectivity::IParseContext*)’: /home/devansh/libreoffice/workdir/YaccTarget/connectivity/source/parse/sqlbison.cxx:1142:6: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits] 1142 | (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | ~~^~~~~~~~ /home/devansh/libreoffice/workdir/YaccTarget/connectivity/source/parse/sqlbison.cxx:10930:32: note: in expansion of macro ‘YYTRANSLATE’ 10930 | aStr = yytname[YYTRANSLATE(nTokenID)]; | ^~~~~~~~~~~ After looking for the files in the above message I found this bug.(not related to this) Found these resources - https://www.oreilly.com/library/view/flex-bison/9780596805418/ch04.html [Parsing SQL] https://www.oreilly.com/library/view/flex-bison/9780596805418/ https://dev.blog.documentfoundation.org/2023/09/14/catalog-and-schema-support-for-sql-functions-difficulty-interesting-easyhack/ I am currently working on this :)
Created attachment 193286 [details] Error banner CREATE FUNCTION PUBLIC.GET_NAME(P_ID INT) RETURNS VARCHAR(50) BEGIN ATOMIC DECLARE V_NAME VARCHAR(50); SET V_NAME = (SELECT NAME FROM PUBLIC.TABLE1 WHERE ID = P_ID); RETURN V_NAME; END; I am getting the error while creating the functions in HSQLDB.
Created attachment 193287 [details] Tables with Dummy data I have already added dummy data for two tables (See the SS) I am getting the Error while creating these functions for the HSQLDB CREATE FUNCTION PUBLIC.GET_NAME(P_ID INT) RETURNS VARCHAR(50) BEGIN ATOMIC DECLARE V_NAME VARCHAR(50); SET V_NAME = (SELECT NAME FROM PUBLIC.TABLE1 WHERE ID = P_ID); RETURN V_NAME; END; CREATE FUNCTION PUBLIC.GET_CITY(P_ID INT) RETURNS VARCHAR(50) BEGIN ATOMIC DECLARE V_CITY VARCHAR(50); SET V_CITY = (SELECT CITY FROM PUBLIC.TABLE2 WHERE ID = P_ID); RETURN V_CITY; END;
Created attachment 193292 [details] Error with psql From my terminal - postgres=# \c testdb You are now connected to database "testdb" as user "postgres". testdb=# \df schema2.get_city List of functions Schema | Name | Result data type | Argument data types | Type ---------+----------+-------------------+---------------------+------ schema2 | get_city | character varying | p_id integer | func (1 row) testdb=# \dn List of schemas Name | Owner ---------+---------- public | postgres schema1 | postgres schema2 | postgres (3 rows) testdb=# SELECT schema1.get_name(1); get_name ---------- Ayushman (1 row) testdb=# SELECT nspname FROM pg_namespace WHERE nspname IN ('schema1', 'schema2'); nspname --------- schema1 schema2 (2 rows) But, unable to get same results via the LO Base having this error.
Here is the PR related to this Bug - https://gerrit.libreoffice.org/c/core/+/165279 Need some feedback and if someone can also review it.