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

解析sql 报字段不存在 #689

Open
yansdnfe opened this issue Nov 26, 2024 · 0 comments
Open

解析sql 报字段不存在 #689

yansdnfe opened this issue Nov 26, 2024 · 0 comments

Comments

@yansdnfe
Copy link

描述
select a.id,b.id from (select * from t1) a , t1 b where a.id=b.id
类似sql,同一个表的情况下,前一个表为子查询无法解析出a.id 字段

列 'a.id' 不存在.

重现
import pymysql

ince_dict={
"host":'127.0.0.1',
"port":4000
}

connect=pymysql.connect(**ince_dict)

cur=connect.cursor()

host="10.11.12.15"
user="archery"
port=3306
password="123456"

db_name="test3"
sql="select a.id,b.id from (select * from t1) a , t1 b where a.id=b.id;"
sql = f"""/--user={user};--password={password};--host={host};--port={port};--masking=1;/
inception_magic_start;
use {db_name};
{sql}
inception_magic_commit;"""

cur.execute(sql)

rows=cur.fetchall()

环境

  • 数据库: [mysql]
  • 版本: [例如 5.7.21]

参数
可能与问题相关的设置参数

@yansdnfe yansdnfe changed the title 解析不出字段 解析sql 报字段不存在 Nov 26, 2024
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

No branches or pull requests

1 participant