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

Problem with doublequotes in column names #44

Closed
swbr opened this Issue Dec 14, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@swbr

swbr commented Dec 14, 2017

I have a software which automatically creates a MySQL table with doublequotes in the column name, and I can't change this behavior.

HeidiSQL has problems to handle those columns correctly.

Using the MySQL command line client, it is no problem to run this code:

 CREATE TABLE TestLog (
  `myInt` INT,
  `"myFunnyFloat"` FLOAT,
  `"myFunnyString"` VARCHAR(30),
  `"myFunnyInt"` INT,
  `"myFunnyDateTime"` DATETIME
) ENGINE=InnoDB

INSERT INTO TestLog VALUES ('42', '3.141', 'Hello Heidi', '21', '2017-12-14 10:00:00');

SELECT * FROM testlog;
+-------+----------------+-----------------+--------------+---------------------+
| myInt | "myFunnyFloat" | "myFunnyString" | "myFunnyInt" | "myFunnyDateTime"   |
+-------+----------------+-----------------+--------------+---------------------+
|    42 |          3.141 | Hello Heidi     |           21 | 2017-12-14 10:00:00 |
+-------+----------------+-----------------+--------------+---------------------+
1 row in set (0.00 sec)

In HeidiSQL, one can create the table this way, too, but inserting the data fails.
Further more, all columns are displayed blue like integers in the data tab, and apart from the first column, there is no column name. The data itself is displayed as

42 | 3.141 | He.llo. He.idi | 21 | 2.017.-12.-14. 10.:00.:00

which is somewhat weird.

(I'd insert a screenshot here, but Github doesn't let me)

HeidiSQL indeed thinks those columns are INTs without names, as its own CREATE-code shows:

CREATE TABLE `testlog` (
	`myInt` INT(11) NULL DEFAULT NULL,
	`` INT NULL,
	`` INT NULL,
	`` INT NULL,
	`` INT NULL
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB;

Playing with this issue shows that for each row with doublequotes in its column name, HeidiSQL deletes the column name and assigns the data type of the last row without doublequotes.

@ansgarbecker ansgarbecker added the bug label Dec 14, 2017

@ansgarbecker

This comment has been minimized.

Show comment
Hide comment
@ansgarbecker

ansgarbecker Dec 14, 2017

Collaborator

Confirmed. Totally crazy what characters people use in column names :) Well. regular expressions help here.

Collaborator

ansgarbecker commented Dec 14, 2017

Confirmed. Totally crazy what characters people use in column names :) Well. regular expressions help here.

@ansgarbecker

This comment has been minimized.

Show comment
Hide comment
@ansgarbecker

ansgarbecker Dec 14, 2017

Collaborator

Please update to the latest build in a few minutes and check if it works now.

Collaborator

ansgarbecker commented Dec 14, 2017

Please update to the latest build in a few minutes and check if it works now.

@swbr

This comment has been minimized.

Show comment
Hide comment
@swbr

swbr Dec 15, 2017

Wow, that's support!
It work well here, too.

My software is a logging software writing excel-friendly CSV files and now has database support. That somehow causes this doublequotes. (I also saw """tripple-doublequotes""" caused by this software...

Again, thanks for your very fast help!

swbr commented Dec 15, 2017

Wow, that's support!
It work well here, too.

My software is a logging software writing excel-friendly CSV files and now has database support. That somehow causes this doublequotes. (I also saw """tripple-doublequotes""" caused by this software...

Again, thanks for your very fast help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment