hhyo / hhyo/Archery

SQL查询结果集导出为SQL文本内容有误

Open
#2,192 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7k
Forks
1.9k
Avg merge
2d 11h
Merged PRs (30d)
6

Description

### 重现步骤

SQL查询结果集导出为SQL文本时存在的问题:
1、表名不对(未显示实际表名,只是用了`Table`代替)
INSERT INTO `Table` (`EMPNO`,`ENAME`,`JOB`,`MGR`,`HIREDATE`,`SAL`,`COMM`,`DEPTNO`) VALUES ('7369','SMITH','CLERK','7902','1980-12-17 00:00:00','801','(null)','20'),('7499','ALLEN','SALESMAN','7698','1981-02-20 00:00:00','1601','300','30'),('7521','WARD','SALESMAN','7698','1981-02-22 00:00:00','1251','500','30');

2、导出多条结果集时,只生成一条insert语句,MySQL支持该写法,但是Oracle不支持。

### 预期外的结果

确保导出的SQL语句可以直接到数据库里执行:
1、表名正确
2、Oracle导出时一条数据生成一条insert

### 日志文本

_No response_

### 版本

1.9.1

### 部署方式

Docker

### 是否还有其他可以辅助定位问题的信息?比如数据库版本等

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing SQL-result export in the Docker deployment using the reported 1.9.1 behavior, then trace the export entry point and its handling of table metadata and database type. Done means the actual table name is emitted and Oracle output uses one INSERT statement per row while supported MySQL output remains executable.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, python, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.