forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › Varchar-a Space At The Top Of Data
- This topic is empty.
-
AuthorPosts
-
-
October 7, 2005 at 11:11 pm #9279sdozonoMember
[This happens both 4.2 Beta5 and 4.1]
I'm not sure the exact reason yet. It seems that it causes a trouble of synchronization. What do you think?
Some of my SQLdata had a varchar fields that has a space top of the line.
(Because of my mistake.. 🙁 )
Then, when I exported with 'Export Table As Batch Scripts',
SQLyog removed the first space and added a null character like,
('****-**-**','*****','****','****','****','*','*','07/15:19-8 ','*****','*'),
phpMyAdmin didn't do that.
But both of them don't display the first spaces.
And I have problem with synchronization process now.
It affected the synchronization process, I think.
SQLyog Job Agent Version 4.2
Copyright © Webyog Softworks Pvt. Ltd.. All Rights Reserved.
Sync started at Sat Oct 08 08:08:32 2005
Table SrcRows TgtRows Inserted Updated Deleted
========================= ======= ======= ======== ======= =======
`******` 42494 42362 132 0 131
Total time taken – 88 sec(s)
-
October 8, 2005 at 3:11 am #19441RiteshMember
Can you send me some sample data to reproduce the problem?
-
October 8, 2005 at 7:57 am #19442peterlaursenParticipant
Cna't you fix dat with the TRIM function ?
I have some data having double end-of-string encoding characters.
I remove it with
Code:update track set filnavn = trim(trailing RIGHT(filnavn,1) from filnavn);A TRIM(leading …) at the database having the NULL character should do,
Remember to back up data!
-
October 10, 2005 at 3:43 am #19443sdozonoMemberpeterlaursen wrote on Oct 8 2005, 07:57 AM:Cna't you fix dat with the TRIM function ?
I have some data having double end-of-string encoding characters.
I remove it with
Code:update track set filnavn = trim(trailing RIGHT(filnavn,1) from filnavn);Thanks for this information!
I wish I had known this… I manually fixed almost 100 lines!
🙁
-
October 10, 2005 at 3:45 am #19444sdozonoMember
Can you duplicate the problem?
========= SOURCE(MYSQL 4.1, Tunneling) ==========
DROP TABLE IF EXISTS `TestTest`;
CREATE TABLE `TestTest` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=ujis AUTO_INCREMENT=11 ;
—
— `TestTest`
—
INSERT INTO `TestTest` VALUES (1, ' Test. Test Data.');
INSERT INTO `TestTest` VALUES (2, 'Never Ending Synchronization…');
========= TARGET(MYSQL 4.0, Tunneling) ===========
CREATE TABLE `TestTest` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=11 ;
#
# `TestTest`
#
INSERT INTO `TestTest` VALUES (2, 'Never Ending Synchronization…');
-
October 10, 2005 at 9:36 am #19445peterlaursenParticipantCode:Sync started at Mon Oct 10 11:31:14 2005
Table            SrcRows  TgtRows  Inserted  Updated  Deleted
========================= Â ======= Â ======= Â ======== Â ======= Â =======
`testtest` Â Â Â Â Â Â Â Â Â Â Â 2 Â Â Â Â 1 Â Â Â Â 1 Â Â Â Â 0 Â Â Â Â 1 ÂTotal time taken – 6 sec(s)
MySQL 4.1 (on localhost over a dyndns backloop)> MySQL 4.0 (on another computer on local network). Both http-tunnelled. php is 5.1 RC.
-
October 10, 2005 at 9:55 am #19446peterlaursenParticipant
However after executing this SQL
Code:update testtest set name = trim(leading LEFT(name,1) from name) where LEFT(name,1) = ' ';(1 row affected) 😀
EDIT: there is a much easier use of the TRIM() function when it is a blank character that must be removed! I forgot. But this code of mine will test for and remove ANY leading character.
you get
Code:Sync started at Mon Oct 10 11:49:05 2005Table            SrcRows  TgtRows  Inserted  Updated  Deleted
========================= Â ======= Â ======= Â ======== Â ======= Â =======
`testtest` Â Â Â Â Â Â Â Â Â Â Â 2 Â Â Â Â 1 Â Â Â Â 1 Â Â Â Â 0 Â Â Â Â 0 ÂTotal time taken – 3 sec(s)
and the data in the tables are identical, and charsets different as originally.
You could be a little bit more specific than just writing “Can you duplicate the problem?” WHAT IS YOUR PROBLEM (except for your charset and other localization issues of course 😀 )
-
October 10, 2005 at 11:20 am #19447peterlaursenParticipant
I reproduced with some simple data of my own:
Code:CREATE TABLE `tn2` (
`id` bigint(20) NOT NULL auto_increment,
`t` varchar(20) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;/*Data for the table `tn2` */
insert into `tn2` values (1,'ggg');
insert into `tn2` values (2,'fffff');
insert into `tn2` values (3,' eee');and get
Code:Sync started at Mon Oct 10 13:17:08 2005Table SrcRows TgtRows Inserted Updated Deleted
========================= ======= ======= ======== ======= =======
`tn2` 3 2 1 0 1Total time taken – 8 sec(s)
when using HTTP-tunnel on both MySQL 4.1 and 5.0. The row is first inserted and then deleted! Does not happen with direct connection.
The tunneller can't handle leading blanks!
But I have no problems that query runs forever!
-
October 10, 2005 at 11:23 am #19448RiteshMember
Even I was able to reproduce a similar problem at my end.
Will work on it tomorrow. Maybe requires some changes in the tunnel module.
-
October 10, 2005 at 12:57 pm #19449sdozonoMember
peterlaursen:
Thank you for taking time to experiment!
I appreciate it.
🙄
peterlaursen wrote on Oct 10 2005, 09:55 AM:You could be a little bit more specific than just writing “Can you duplicate the problem?” WHAT IS YOUR PROBLEM (except for your charset and other localization issues of course :D )That comment was for this:
Ritesh wrote on Oct 8 2005, 03:11 AM:Can you send me some sample data to reproduce the problem?[post=”7481″]<{POST_SNAPBACK}>[/post]But, I should have written it specifically!
Good suggestion. Thanks.
-
October 13, 2005 at 6:42 am #19450RiteshMember
This gets interesting. In HTTP Tunneling, SQLyog gets the data from the server in XML format.
It looks like, XML does not seem to correctly recognise leading and trailing whitespace in element data.
E.g. create a XML file with the following data:
Code:and open it in IE. It will always display it as:
Code:The XML parser that we are using (IE XML parser for that matter too) interally seems to be doing just that. Thus during a sync we insert a instead of a and thus the checksum fails as a is different from [ ]a.
Thus syncing of a data with leading and trailing whitespace fails.
I are working on this issue and will keep you updated.
-
-
AuthorPosts
- You must be logged in to reply to this topic.