Tab "CREATE code" doesn´t shows charset information

[expired user #5151]'s profile image [expired user #5151] posted 13 years ago in General Permalink
The "CREATE code"-tab in r3707 says:
CREATE TABLE `a_text` (
`aBaseId` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
`aTxtChgTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`aTxtChgUser` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
`aTxtText` MEDIUMTEXT NOT NULL,
PRIMARY KEY (`aBaseId`)
)
COLLATE='latin1_german1_ci'
ENGINE=InnoDB;

The statement "SHOW CREATE TABLE a_text" says:
CREATE TABLE `a_text` (
`aBaseId` bigint(20) unsigned NOT NULL default '0',
`aTxtChgTime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`aTxtChgUser` bigint(20) unsigned NOT NULL default '0',
`aTxtText` mediumtext character set utf8,
PRIMARY KEY (`aBaseId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci

It differs in the table charset (latin1) and the charset at column aTxtText (utf8).
Furthermore the "Collation"-column in the column-list underneath is empty in the row for column aTxtText.

On another PC (with r3603) the create code and the column list is OK. Hope that helps.
[expired user #5151]'s profile image [expired user #5151] posted 13 years ago Permalink
r3668 (oldest available version) has the same problem
Code modification/commit from ansgar.becker, 13 years ago, revision 6.0.0.3712
Fix undetected column collation, caused by non rewound collations list. See http://www.heidisql.com/forum.php?t=7893.
ansgar's profile image ansgar posted 13 years ago Permalink
Fixed in r3713
[expired user #5151]'s profile image [expired user #5151] posted 13 years ago Permalink
Thanks.

But it still differs from the "SHOW CREATE TABLE" output
Column:
Heidi = collation
SHOW CREATE = character set

Table:
Heidi = collation
SHOW CREATE = default charset + collation

Is there a reason for that? First I thought it´s an MySQL-Version issue, since it appeared on 4.1.12. But it´s the same on 5.5.9
I don´t think, that this behaviour is a real problem, but it confuses me.
ansgar's profile image ansgar posted 13 years ago Permalink
HeidiSQL generates the CREATE TABLE code by itself, so it's very normal that there are minor differences.

A collation is a subset of a charset, and the charset has a default collation. See that with a SHOW COLLATION, and watch the "Default" column. The collation is therefore the exact thing, and the charset is not required to be mentioned if there is already a collation.
[expired user #5151]'s profile image [expired user #5151] posted 13 years ago Permalink
Yes, that´s why I wrote "I don´t think, that this behaviour is a real problem".
Didn´t know that Heidi doesn´t use SHOW CREATE TABLE

Everything fine now

Please login to leave a reply, or register at first.