forums › forums › SQLyog › Using SQLyog › Problem with "Copy Table Structure / Data"
- This topic is empty.
-
AuthorPosts
-
-
October 12, 2004 at 7:41 am #8603ZendakMember
I copied a table (MyISAM) using Copy Table Structure / Data. The table contains a few VARCHAR(100) columns but these have mutated into CHAR(100) columns in the new copy.
I need quite a lot of copies of this table so manually correcting this would be a pain.
The problem occurs when copying “structure only” and also when copying “structure and data”.
Using v3.71
Apart from that I love this product!
Thanks in advance
-
October 12, 2004 at 11:52 am #16372ShadowMember
Theorectically MySql changes every CHAR column to VARCHAR that exceed 3 characters in length. Are you sure it's not just a display error?
-
October 12, 2004 at 12:04 pm #16373RiteshMember
SQLyog logs up all the queries that it executes in the History Window.
Do you find anything unusual?
-
October 13, 2004 at 8:00 am #16374RiteshMember
We are working on your issue and will revert back soon.
-
October 13, 2004 at 5:25 pm #16375ZendakMemberRitesh wrote on Oct 12 2004, 12:04 PM:SQLyog logs up all the queries that it executes in the History Window.
Do you find anything unusual?
Sorry about the delay..
Here's a test case with a very simple table containing a VARCHAR column:
Code:CREATE TABLE `test` (
`example_col` varchar(100) default NULL
) TYPE=MyISAMHere's the output from the History window when copying this table:
Code:[19:17:36][ 10 ms] use `medialagoon`
[19:17:36][ 10 ms] show full fields from `medialagoon`.`test`
[19:17:36][ 10 ms] show table status from `medialagoon` like 'test'
[19:17:45][ 10 ms] show keys from `medialagoon`.`test`
[19:17:45][ 20 ms] create table `medialagoon`.`test_copy` () type=MyISAM select `example_col` from `medialagoon`.`test` where 1 = 0
[19:17:45][ 20 ms] show full fields from `medialagoon`.`test`
[19:17:47][ 10 ms] show full fields from `medialagoon`.`test_copy`
[19:17:47][ 10 ms] show keys from `medialagoon`.`test_copy`
[19:17:47][ 0 ms] show create table `medialagoon`.`test_copy`
[19:17:47][ 0 ms] use `medialagoon`In the new table 'test_copy' the field 'example_col' now strangely has CHAR(100) as the type.
Thanks
-
October 14, 2004 at 3:12 pm #16376RiteshMember
Which version of MySQL are you using?
In our MySQL server which is 4.1.1-alpha-max-nt, the following SQLs:
Code:create database testdb;use testdb;
CREATE TABLE `test` (
`example_col` varchar(100) default NULL
) TYPE=MyISAM;create table `test_copy` () type=MyISAM select `example_col` from `test` where 1 = 0;
correctly results in `test_copy` being created and `example_col` datatype is varchar(100).
-
October 14, 2004 at 3:34 pm #16377ShadowMember
Considering MySql's silent column changes, a CHAR(100) column is highly interesting!
-
October 14, 2004 at 3:36 pm #16378ShadowMember
Works correctly with MySql 4.1.3 on W2K.
-
October 15, 2004 at 10:27 am #16379ZendakMemberQuote:Which version of MySQL are you using?
Currently using 4.0.14-nt on WinXP locally
I've also tested this connecting to one of my remote sites using 3.23.55-Max-log on Linux, and encountered the exact same behaviour.
-
October 15, 2004 at 11:32 am #16380RiteshMember
Behaviour confirmed on 3.23.54.
I will revert back soon with the reason(s).
-
-
AuthorPosts
- You must be logged in to reply to this topic.