Oracle provider does not work correctly when quoted identifiers are used
还没有人认领这个 Issue。
评估
调研方向
首先使用报告中所示的带引号的 Oracle schema、table 和 column 标识符重现该问题,然后跟踪为 provider 生成的 SQL。将失败的不带引号的语句与预期的带引号形式进行比较,并验证针对带引号标识符的查询能够成功,同时不会破坏不带引号的标识符。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Like Firebug (#431) Oracle also has a problem with quoted table names. Actually the same goes for schema names and column names as well. (ref). When a table is created with quoted identifiers:
CREATE TABLE "SchemaName"."table_name"
( "timestamp" TIMESTAMP (6) NOT NULL ENABLE,
"text" NVARCHAR2(50) NOT NULL ENABLE )
Identifiers with quotes are case sensitive. Identifiers without quotes are treated as uppercase. To maintain the casing of the identifier names, they should be referenced everywhere with quotes:
SELECT t."timestamp", t."text" FROM "SchemaName"."table_name" t
To Reproduce
Steps to reproduce the behavior:
- create a table like mentioned above
- create a query to retrieve records from that table
let records =
query {
for t in context.SchemName.TableName do
select ( t.Timestamp, t.Text )
}
It wil fail with Oracle.ManagedDataAccess.Client.OracleException: 'ORA-00942: table or view does not exist' because it creates the query:
SELECT table_name.timestamp as "timestamp", table_name.text as "text" FROM SchemaName.table_name table_name
Which is interpreted by Oracle as something that cannot be found:
SELECT table_name.TIMESTAMP as "timestamp", table_name.TEXT as "text" FROM SCHEMANAME.TABLE_NAME table_name
Expected behavior
The schema object identifiers schema name, table name and column name should be quoted in statements when they were created as quoted identifiers. Preferably automatically otherwise with a flag like the one used in the Firebird solution (#431). The resulting query in this case should look like:
SELECT table_name."timestamp" as "timestamp", table_name."text" as "text" FROM "SchemaName"."table_name" table_name
Desktop (please complete the following information):
- OS: windows 11
- Oracle 12
- SqlProvider 1.3.5
Libraries used for resolution
- Oracle.ManagedDataAccess.dl (version 2.0.19.1)
- System.Diagnostics.PerformanceCounter.dll (targeting netstandard2.0, version 6.0.0)
- System.DirectoryService.dll (targeting netstandard2.0, version 5.0.0)
- System.DirectoryService.Protocols.dll (targeting netstandard2.0, version 5.0.1)
- System.Text.Json.dll (targeting netstandard2.0, version 6.0.0)
- 主要语言
- F#
- 星标
- 627
- 派生
- 147
- 平均合并
- 2 小时 2 分钟
- 30 天内合并 PR
- 1
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fsprojects/SQLProvider 的其他 Issue
-
enhancement
难度 3/5 1-2 天 新手友好度 55/100
fsprojects/SQLProvider#872 · 2 条评论 ·
-
Repo Assist? 未关闭enhancement
难度 5/5 一周以上 新手友好度 10/100
fsprojects/SQLProvider#870 · 1 条评论 ·
-
postgresql
难度 4/5 3-5 天 新手友好度 58/100
fsprojects/SQLProvider#869 · 2 条评论 ·
-
documentation
难度 2/5 1-3 小时 新手友好度 42/100
fsprojects/SQLProvider#868 · 2 条评论 ·
-
sql server
难度 4/5 3-5 天 新手友好度 45/100
fsprojects/SQLProvider#851 · 1 条评论 ·
查看 fsprojects/SQLProvider 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
AstrBotDevs/AstrBot#10205 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 70/100
OHDSI/Data2Evidence#3394 ·
-
难度 2/5 1-3 小时 新手友好度 84/100