Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backported CORE-6091: Errors when processing correct SQL statements i…
…n engine12 provider loaded by FB4 server
- Loading branch information
1 parent
a380b00
commit 2da0a6e
Showing
7 changed files
with
96 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* The contents of this file are subject to the Initial | ||
* Developer's Public License Version 1.0 (the "License"); | ||
* you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at | ||
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl. | ||
* | ||
* Software distributed under the License is distributed AS IS, | ||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing rights | ||
* and limitations under the License. | ||
* | ||
* The Original Code was created by Mark O'Donohue | ||
* for the Firebird Open Source RDBMS project. | ||
* | ||
* Copyright (c) 2002 Mark O'Donohue <skywalker@users.sourceforge.net> | ||
* and all contributors signed below. | ||
* | ||
* All Rights Reserved. | ||
* Contributor(s): ______________________________________. | ||
* | ||
* 2005.05.19 Claudio Valderrama: signal tokens that aren't reserved in the | ||
* engine thanks to special handling. | ||
* Adriano dos Santos Fernandes | ||
*/ | ||
|
||
#include "firebird.h" | ||
|
||
#ifdef HAVE_STRING_H | ||
#include <string.h> | ||
#endif | ||
|
||
#include "keywordsStub.h" | ||
|
||
// This method is currently used in isql/isql.epp to check if a | ||
// user field is a reserved word, and hence needs to be quoted. | ||
// Obviously a hash table would make this a little quicker. | ||
// MOD 29-June-2002 | ||
|
||
extern "C" { | ||
|
||
int API_ROUTINE KEYWORD_stringIsAToken(const char* in_str) | ||
{ | ||
for (const TOK* tok_ptr = keywordGetTokens(); tok_ptr->tok_string; ++tok_ptr) | ||
{ | ||
if (!tok_ptr->nonReserved && !strcmp(tok_ptr->tok_string, in_str)) | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
Tokens API_ROUTINE KEYWORD_getTokens() | ||
{ | ||
// This function should not be used but appeared in FB3. | ||
// As long as we keep TOK structure as is we may have it deprecated. | ||
// Later sooner of all it will be removed at all. | ||
return keywordGetTokens(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* The contents of this file are subject to the Interbase Public | ||
* License Version 1.0 (the "License"); you may not use this file | ||
* except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.Inprise.com/IPL.html | ||
* | ||
* Software distributed under the License is distributed on an | ||
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing | ||
* rights and limitations under the License. | ||
* | ||
* The Original Code was created by Inprise Corporation | ||
* and its predecessors. Portions created by Inprise Corporation are | ||
* Copyright (C) Inprise Corporation. | ||
* | ||
* All Rights Reserved. | ||
* Contributor(s): ______________________________________. | ||
* 2001.08.03 John Bellardo changed LIMIT token to SKIP | ||
* 2001.07.28 John Bellardo added tokens for FIRST and LIMIT | ||
See dsql/parse.y for a chronological list. */ | ||
|
||
#include "../common/keywords.h" | ||
#include "ibase.h" | ||
|
||
// These symbols are exported | ||
extern "C" | ||
{ | ||
int API_ROUTINE KEYWORD_stringIsAToken(const char*); | ||
Tokens FB_API_DEPRECATED API_ROUTINE KEYWORD_getTokens(); | ||
} |