Bug #34500 Initial Inserts not automatically updated when changing a column name

Submitted: 12 Feb 2008 19:39 Modified: 15 Mar 2008 12:47
Reporter: Hugo Poissant Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.13 OSS Beta OS:Windows (XP Pro 2002 SP2)
Assigned to: Alfredo Kojima CPU Architecture:Any
Tags: inserts

[12 Feb 2008 19:39] Hugo Poissant
Description:
Having a table and inserts already created, when changing a column name of that table the inserts using that columns is not updated automatically.

How to repeat:
Example:

STATE 1 : INITIAL STATE OF THE TABLE

Table Tab
---------
Name:      user_tb
Collation: server default
Engine:    server default

Columns Tab 
-----------
  User_id     INT(10) NOT NULL AUTO_INCREMENT
  Username    VARCHAR(45) NOT NULL
  Password    VARCHAR(45) NOT NULL
  FullName    VARCHAR(100) NULL

Indexes Tab
-----------
  PRIMARY KEY (`Usager_id`)
  UNIQUE INDEX Nom_Usager_idx (`Usager` ASC) )

Inserts tab
-----------

INSERT INTO `user_tb` (User_id, Username, Password, FullName) VALUES (1, 'Me', '********', 'Me Myself');

STATE 2 : CHANGING A COLUMN NAME

Action=> Change column name 'Password' to 'PW'

Issue=> the insert statement (Inserts tab) still unchanged :

INSERT INTO `user_tb` (User_id, Username, Password, FullName) VALUES (1, 'Me', '********', 'Me Myself');

WORKAROUND:

After changing the column name if you click on the Open Editor button and then ok (Inserts Tab->Open Editor->OK) the insert statement is updated.
[12 Feb 2008 21:15] Valeriy Kravchuk
Thank you for a problem report. Verified just as described.
[4 Mar 2008 20:18] Johannes Taxacher
changing is fixed, but when you add a column (i.e. VARCHAR) then the inserts get corrupted because the column is added to the column-section but in the values-section only a comma is added without the '' for the empty value.
[5 Mar 2008 18:18] Alfredo Kojima
I've changed it so that non-filled fields are set to NULL.
It's expected that these INSERTs have to be eventually updated by the user.
[10 Mar 2008 14:56] Johannes Taxacher
inserts are correctly updated when table-structure is changed (SVN 2692)
[15 Mar 2008 12:47] MC Brown
A note has been added to the 5.15 changelog: 

Changing the column name of a table when you have pending inserts to the table did not change the column name in the corresponding INSERT statements.

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

Page generated in 0.054 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.