Bug #97169 After altering definitions , "Send to SQL Editor" can not make correct queries

Submitted: 10 Oct 2019 1:53 Modified: 23 Oct 2019 5:51
Reporter: iida イイダ Email Updates:
Status: Won't Fix Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.16, 8.0.18 OS:Ubuntu (18.04.3)
Assigned to: CPU Architecture:Any

[10 Oct 2019 1:53] iida イイダ
Description:
"Send to SQL Editor" in MySQL Workbench will make wrong queries like this pattern.

1. use "Send to SQL Editor" -> Workbench makes correct queries.
2. alter table add column
3. use "Send to SQL Editor" -> Workbench makes wrong queries.

but
1. alter table add column
2. use "Send to SQL Editor" -> Workbench makes correct queries.

Please review this problem.

How to repeat:
1. make table like this.

```
CREATE TABLE test1 (
    id INT NOT NULL AUTO_INCREMENT COMMENT 'ID',
    col1 VARCHAR(10) COLLATE UTF8MB4_BIN NOT NULL COMMENT 'column 1st',
    PRIMARY KEY (`id`)
)  ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE = UTF8MB4_BIN COMMENT='for test';
```

2. "Send to SQL Editor" makes correct query.

SCHEMAS>{schema_name}>Tables>test1>{right click}>Send to SQL Editor>Select All Statement

```
SELECT `test1`.`id`,
    `test1`.`col1`
FROM `test`.`test1`;
```

3. Alter table

add column

```
alter table test1
add col2 VARCHAR(10) COLLATE UTF8MB4_BIN NOT NULL COMMENT 'column 2nd';
```

```
# checked by prompt
mysql> desc test1;
+-------+-------------+------+-----+---------+----------------+
| Field | Type        | Null | Key | Default | Extra          |
+-------+-------------+------+-----+---------+----------------+
| id    | int(11)     | NO   | PRI | NULL    | auto_increment |
| col1  | varchar(10) | NO   |     | NULL    |                |
| col2  | varchar(10) | NO   |     | NULL    |                |
+-------+-------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

```

4. "Send to SQL Editor" makes wrong query.

SCHEMAS>{schema_name}>Tables>test1>{right click}>Send to SQL Editor>Select All Statement

```
SELECT `test1`.`id`,
    `test1`.`col1`
FROM `test`.`test1`;
```
[23 Oct 2019 5:51] MySQL Verification Team
Hello iida takayuki,

Thank you for the report.
Verified as described.

Regards,
Ashwini Patil
[14 Sep 18:05] Omer Barnir
Posted by developer:

This issue applies to the legacy MySQL Workbench 8.x implementation that is no longer supported or maintained.
MySQL Workbench 26.7 is a complete rewrite using a new technology stack and does not use the affected legacy implementation.
Therefore, this issue is not applicable to the current MySQL Workbench product and as such is closed.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.