Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

删除 oracle engine 中 filter_sql 实现 #2797

Merged
merged 4 commits into from
Sep 11, 2024
Merged

Conversation

hhw007
Copy link
Contributor

@hhw007 hhw007 commented Sep 9, 2024

  1. oracle.py646行filter_sql函数作用是限制查询返回行数。如果查询SQL的查询字段列表包含同名列,经过filter_sql函数处理之后的SQL,
    由于查询字段列表sql_audit.*中存在同名列,在Oracle数据库中执行会报错 ORA-00918:未明确定义列。原查询SQL的查询字段列表虽然也包含同名列,
    但因为有不同的表别名作区分,因此在数据库中执行不会报错。例如原SQL:
select a.*,b.* from a,b where a.custid=b.custid;

该SQL在Oracle数据库中可以正常执行,但在archery平台上执行会报错。

  1. oracle.py中689行cursor.fetchmany(int(limit_num))已经有限制查询返回行数的作用,所以不必通过oracle.py646行的filter_sql函数来再次限制查询返回行数

Copy link

codecov bot commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.05%. Comparing base (083e841) to head (2b32e43).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2797      +/-   ##
==========================================
- Coverage   78.08%   78.05%   -0.04%     
==========================================
  Files         122      122              
  Lines       17311    17286      -25     
==========================================
- Hits        13518    13493      -25     
  Misses       3793     3793              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hhw007
Copy link
Contributor Author

hhw007 commented Sep 9, 2024

上面的描述信息显示有些问题,星号“*”被忽略掉了。例如原SQL:select a.星号,b.星号 from a,b where a.custid=b.custid;

@LeoQuote
Copy link
Collaborator

LeoQuote commented Sep 9, 2024

不要注释,没有作用的代码直接删除即可

@hhw007
Copy link
Contributor Author

hhw007 commented Sep 9, 2024

好的,我这边重新修改,重新提交PR吧

@hhw007
Copy link
Contributor Author

hhw007 commented Sep 9, 2024

注释的代码,我已经去掉了,麻烦审阅一下

@hhw007
Copy link
Contributor Author

hhw007 commented Sep 10, 2024

代码你看下能否合并吗?这个问题出现很久了

@LeoQuote LeoQuote changed the title 注释oracle.py中filter_sql函数操作以及sql\engines\tests.py中关于Oracle引擎中filter_sql函数的断言 删除 oracle engine 中 filter_sql 实现 Sep 10, 2024
@hhw007
Copy link
Contributor Author

hhw007 commented Sep 10, 2024

我已经删除oracle.py中filter_sql函数了

sql/query.py Outdated Show resolved Hide resolved
@hhw007
Copy link
Contributor Author

hhw007 commented Sep 10, 2024

应该没问题了

@hhw007
Copy link
Contributor Author

hhw007 commented Sep 11, 2024

大佬再帮忙看下,应该没问题了

@LeoQuote LeoQuote merged commit 54bb3dc into hhyo:master Sep 11, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants