forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › still problems with \ character in PK
- This topic is empty.
-
AuthorPosts
-
-
June 21, 2005 at 6:08 pm #9065peterlaursenParticipant
Just tested the SJA 4.07 beta1 with my data to see if a char/varchar field containing a Windows' filename can now be use as a PK with SJA. It still can't!
Both servers MySQL 4.0.24 – it is a one-way sync from localhost to my webhost using HTTP-tunnelling
When syncing with another PK (25 charcater varchar containing only hex-numbers and the “-“character like “0003820E-791C-42DC-BC3C-9”) I get this (correct with my settings) result:
Table SrcRows TgtRows Inserted Updated Deleted
========================= ======= ======= ======== ======= =======
`mp3_filer` 38306 38215 152 157 44
When using a complete windows filename (255 character varchar containg “”s) as the PK I get (after a few seconds)
Table SrcRows TgtRows Inserted Updated Deleted
========================= ======= ======= ======== ======= =======
`mp3_filer_copy` 38306 38215 0 0 0
The data of the two tables are totally identical except for the PK-definition! Trying different settings for COLUMNS_ALL and SQLWHERE (and omitting these completely) does not change anyting.
I still have a copy of both sets of data as they were and can give you access to them.
-
June 21, 2005 at 7:46 pm #18216peterlaursenParticipant
I just repated trying to sync the table between two DB's on my localhost using SJA (just to be sure that it was not involving some mess with my ridiculous webhost!). It won't work either when PK is a Windows' filename. No matter whether HTTP-tunnelling is used or not.
However, if I start with an EMPTY TARGET DATABASE (emptying the “mp3_filer_copy” table), all rows from table “mp3_filer” are synced (inserted). It seems to be same issue as reported here
http://www.webyog.com/forums/index.php?act…st=0&#entry6004
If you still have connection details to my test DB on my webhost there is now a table “mp3_filer” containing result of a succesfull sync (not using filname as PK) and another table “mp3_filer_copy” with the data on target before the sync. (Please note the different PK's with the two tables). Some field identifiers are in Danish Language. Hope you can handle that 😉
If use use the field “Filnavn” (means “File Name”) as the PK you will not be able to sync with table “mp3_filer” as the sorce and “mp3_filer_copy” as the target. It gives 0 inserts, 0 updates, 0 deletes.
-
June 21, 2005 at 8:01 pm #18217peterlaursenParticipant
I can mail you DUMPS of the two tables as well. ZIP-file approx. 5 MB.
-
June 22, 2005 at 1:56 am #18218peterlaursenParticipant
Same behaviour with MySQL 5.07
When syncing to a target that is empty, rows are INSERTED as they should
But when target is NOT empty result is (as before)
Table SrcRows TgtRows Inserted Updated Deleted
========================= ======= ======= ======== ======= =======
`mp3_filer_copy` 38306 38215 0 0 0
Total time taken – 16 sec(s)
-
June 22, 2005 at 2:54 am #18219RiteshMember
I still have the connection details of your server. I will look into the matter as soon as possible.
-
June 22, 2005 at 3:39 am #18220RiteshMember
Is it possible to reduce the set of data to reproduce the error more easily?
-
June 22, 2005 at 3:42 am #18221peterlaursenParticipant
honestly I don't know. I will give it a try … wait ½ hour …
-
June 22, 2005 at 4:02 am #18222peterlaursenParticipant
Yes it is! Its the same with enclosed ZIP-file. It has 2 .sql-files in it
source.sql has 14 rows – target.sql has 10 rows.
It is a MySQL 5.x dump – to import to earlier versions delete string “DEFAULT CHARSET=latin1” from table definition.
-
June 22, 2005 at 4:07 am #18223peterlaursenParticipant
you can create any subset of data from the server yourself with this SQL
Code:Create table tbl_name select * from mp3_filer where kunstner like 'something';For instance this reduced dataset was created with
Code:Create table table_name select * from mp3_filer where kunstner like 'aba%'; -
June 22, 2005 at 4:21 am #18224peterlaursenParticipant
Hold it!
I believe it was the wrong files! 10 minutes more!
-
June 22, 2005 at 4:34 am #18225peterlaursenParticipant
This one should be better:
there are now 17 rows in source, 14 in target.
Result with SJA:
Table SrcRows TgtRows Inserted Updated Deleted
========================= ======= ======= ======== ======= =======
`testsync2` 17 14 0 0 0
Total time taken – 1 sec(s)
Correct would be: 3 insert, 2 updates, 0 deletes
and still the same with an empty target: rows are inserted correctly.
-
June 22, 2005 at 7:29 am #18226peterlaursenParticipant
Just info for those reading here:
This:
http://www.webyog.com/forums/index.php?act…t=ST&f=6&t=1503
and maybe this
http://www.webyog.com/forums/index.php?act…st=0&#entry6004
seem related with this issue. It does not seem to be an issue with SQLyog.
-
June 23, 2005 at 4:43 pm #18227peterlaursenParticipant
Maybe this is not a PK-problem, but rather a problem with escapes and wildcards used in conjunction!!
I consider posting this to MySQL bug system, but I'll let you read it first:
********************************************************************************
*******
Another way to reproduce:
STEP ONE: import this dump:
create database if not exists `music`;
USE `music`;
/*Table structure for table `test` */
DROP TABLE if exists `test`;
CREATE TABLE `test` (
`filename` varchar(255) NOT NULL,
`title` varchar(255) default NULL,
`artist` varchar(255) default NULL,
`album` varchar(255) default NULL,
PRIMARY KEY (`filename`)
);
insert into `test` values ('M:\Peters Musik\Abaji\Oriental Voyage\10 Tchai.mp3','Tchai','Abaji','Oriental Voyage');
STEP TWO: queries
Two queries that WORK:
1)
mysql> select title, filename from test where artist = 'abaji';
+
+
+| title | filename |
+
+
+| Tchai | M:MusicAbajiOriental Voyage10 Tchai.mp3 |
+
+
+1 row in set (0.00 sec)
2)
mysql> select title, filename from test where filename like '%\abaji%';
+
+
+| title | filename |
+
+
+| Tchai | M:MusicAbajiOriental Voyage10 Tchai.mp3 |
+
+
+1 row in set (0.00 sec)
Two queries that DON'T WORK:
3)
mysql> select title, filename from test where filename like '%\abaji\%';
Empty set (0.00 sec)
4)
mysql> select title, filename from test where filename like '%abaji\%';
Empty set (0.00 sec)
Please tell me what's wrong with the use of escaping with these two ??
However this one works:
5)
mysql> select title, filename from test where filename like '%\abaji\%';
+
+
+| title | filename |
+
+
+| Tchai | M:MusicAbajiOriental Voyage10 Tchai.mp3 |
+
+
+1 row in set (0.00 sec)
But why is it necessary to escape the % character here ??
The MySQL manual says
“To test for literal instances of a wildcard character, precede the character with the escape character. If you don't specify the ESCAPE character, '' is assumed.”
However this is not how it behaves in this case!! It seems that escape and wildcard charcters don't always behave as they should when used in combination. with these examples here it does not change anything to change the PK. So maybe it's not a problem related to the PK-setup.
Attached: data shown in graphical client (Open Office 2 Base);
-
June 23, 2005 at 5:50 pm #18228peterlaursenParticipant
I believe now that there is a trivial problem with MySQL's parser where there are two many -characters in a char or varchar field! (some buffer-overrun ??). That takes effect when used with a WHERE and maybe elsewhere ….
In the attached pic only the last query returns correct result! The others return nothing.
-
June 23, 2005 at 6:01 pm #18229RiteshMember
I guess I will need to call up MySQL AB's support team to discuss on this issue. I have no clue why its behaving like this.
Quote:data shown in graphical client (Open Office 2 Base);You can use SQLyog for the same purpose 😮
-
June 23, 2005 at 6:05 pm #18230peterlaursenParticipantQuote:You can use SQLyog for the same purpose
I know! But I don't know if MySQL has some “policy” about exposing third-party clients like SQLyog in their bug-tracking system.
-
June 23, 2005 at 6:21 pm #18231peterlaursenParticipant
and besides …
Open Office Base supports VIEWs when used with JDBC 😛
-
June 26, 2005 at 7:37 am #18232peterlaursenParticipant
/* SOME SUMMARIZING ON THE ISSUE */
/*
SQLyog Enterprise v4.07 BETA 2
Host – 5.0.7-beta-nt-max : Database – test
*********************************************************************
Server version : 5.0.7-beta-nt-max
*/
create database if not exists `test`;
USE `test`;
/*Table structure for table `test` */
drop table if exists `test`;
CREATE TABLE `test` (
`kunstner` varchar(255) NOT NULL,
`albumtitel` varchar(255) default NULL,
`titel` varchar(255) default NULL,
`filnavn` char(255) NOT NULL,
PRIMARY KEY (`filnavn`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*Data for the table `test` */
insert into `test` values ('Abaji','Oriental Voyage','maa','M:\Peters Musik\Abaji\Oriental Voyage\11 maa.mp3 ');
/* Queries that don't work but should – NOTE: no % character at the end*/
select * from test.test where filnavn like '%mp3';
select * from test.test where filnavn like '%\11 maa.mp3';
select * from test.test where filnavn like '%voyage\11 maa.mp3';
/* Queries that work (and should too!) – NOTE: % character at the end */
select * from test.test where filnavn like '%mp3%';
select * from test.test where filnavn like '%\11 maa.mp3%';
/* As we have seen before this works */
select * from test.test where filnavn like '%\Oriental Voyage\%';
/* but why must % character be escaped ? – */
/* this should match string 'Oriental Voyage%' only */
/* None of these work*/
select * from test.test where filnavn like '%\Oriental Voyage\11 maa.mp3%';
select * from test.test where filnavn like '%\oriental voyage\11 maa.mp3%';
/* Pattern with trailing % character broken with example on line 18 */
/* It seems to confirm theory that 'too many' -characters in data raises error*/
/* NOTE: Result the same no matter what column is the PK (or if there are any)! */
-
June 26, 2005 at 10:54 am #18233peterlaursenParticipant
My God I am becoming crazy with this!
There might have been some errors with some of my data in some previous examples.
So let's have a fresh start.
However this is now VERY CAREFULLY checked.
And simplifies matters as much as possible I believe.
(example edited a little ½ hour after first posting with a few more examples)
BTW: could it be that LIKE and concat_ws uses part of same algorithms ??
That could explain that SJA is affected!
********************************************************
create database if not exists `test`;
USE `test`;
/*Table structure for table `test` */
drop table if exists `test`;
CREATE TABLE `test` (
`artist` varchar(255) default NULL,
`albumtitle` varchar(255) default NULL,
`title` varchar(255) default NULL,
`filename` char(255) default NULL
);
/*Data for the table `test` */
insert into `test` values ('Abaji','Oriental Voyage','maa','M:\Music\Abaji\Oriental Voyage\11 maa.mp3');
/* Queries that work as expected */
/*1*/ select * from test.test where filename like 'M:%';
/*2*/ select * from test.test where filename like '%mp3';
/*3*/ select * from test.test where filename like '%\11 maa.mp3';
/* Queries that don't work but should */
/* It seems like that 'too many' -characters in data and/or query influences error */
/*4*/ select * from test.test where filename like '%Voyage\11 maa.mp3';
/*5*/ select * from test.test where filename like '%\Oriental Voyage\11 maa.mp3';
/*6*/ select * from test.test where filename like '%\Abaji\Oriental Voyage\11 maa.mp3';
/*7*/ select * from test.test where filename like '%\Oriental Voyage\%';
/* However these two works – but I think they should not! */
/* – 8 should match string 'Oriental Voyage%' since % is the escape sequence of of a literal %-character */
/*8*/ select * from test.test where filename like '%\Oriental Voyage\%';
/*9*/ select * from test.test where filename like 'M:\%';
/* there isn't much logic, since these two don't work – again 'too many' characters ? */
/*10*/ select * from test.test where filename like 'M:\Music\%';
/*11*/ select * from test.test where filename like 'M:\Music\Abaji\Oriental Voyage\%';
/* these don't work either */
/*12*/ select * from test.test where filename like 'M:\%';
/*13*/ select * from test.test where filename like 'M:\Music%';
/*14*/ select * from test.test where filename like 'M:\Music\Abaji\Oriental Voyage\%';
/*15*/ select * from test.test where filename like 'M:\Music\Abaji\Oriental Voyage\11 maa.mp3';
/* this one works here – compare with 15! */
/*16*/ select * from test.test where filename = 'M:\Music\Abaji\Oriental Voyage\11 maa.mp3';
/* NOTE: Result the same with this case no matter what column is the PK (or if there are any PK or indexes at all!) */
/* and inserts, updates and deletes function/malfunction the same way with the same WHERE-clauses */
-
June 26, 2005 at 3:25 pm #18234peterlaursenParticipant
what do you think of above case (10:54 AM) ?
It should be fairly easily reproducable. I have made a layout so that you can just copy the whole of it into SQL-pane in SQLyog and execute 1st statement, then 2nd statement etc.
The case that you posted at bugs.mysql.com was easily reproducable too, but unfortunately this Victoria doesn't seem to have tested it seriously. I believe that this case should not be rejected the same easy way. What would be best, do yo think:
1) I post it to bugs.mysql.com
2) You post it to bugs.mysql.com
3) You will have it brought to attention of MySQL AB some other way (using your contacts with MySQL ?)
It probably is not the whole truth about this issue. But it should be sufficient to demonstrate that there is a need for some research into the reasons for this.
From your point of view, I think that – if it's is a bug with MySQL that also causes SJA to fail under certain circumstances (what I believe it is) – the issue is important. Some failure with ordinary SQL can be tested with command-line client or some other client, but there is no other tool to test with if SJA fails. And thus users will blame SJA, negatively affecting the reputation of the program – even in cases where it is an issue with the MySQL server. There just is no easy way to prove it!
So what next ?
-
June 26, 2005 at 3:59 pm #18235RiteshMemberQuote:You will have it brought to attention of MySQL AB some other way (using your contacts with MySQL ?)
We are Authorised Gold Partners of MySQL AB. I have already started a conversation with MySQL AB developers on this issue and talks are going on. I will reply here once I get a concrete solution to the problem.
-
June 26, 2005 at 4:01 pm #18236peterlaursenParticipant
fine with me – I won't do any further then unless requested!
-
June 26, 2005 at 11:26 pm #18237peterlaursenParticipant
We're not alone!
-
June 27, 2005 at 3:53 am #18238RiteshMember
😀
-
June 27, 2005 at 5:18 pm #18239peterlaursenParticipant
Some variations on the theme (continuation from Jun 26 2005, 10:54 AM)
to me it seems completely impredictable when to use \ and when to use \\ 🙁
/*5 works not */ select from test.test where filename like '%\Oriental Voyage\11 maa.mp3';
/*5a works */ select * from test.test where filename like '%\Oriental Voyage\\11 maa.mp3';
/*5b works not */ select * from test.test where filename like '%\\Oriental Voyage\11 maa.mp3';
/*5c works */ select * from test.test where filename like '%\\Oriental Voyage\\11 maa.mp3';
/*6 works not */ select * from test.test where filename like '%\Abaji\Oriental Voyage\11 maa.mp3';
/*6a works not */ select * from test.test where filename like '%\Abaji\Oriental Voyage\\11 maa.mp3';
/*6b works */ select * from test.test where filename like '%\Abaji\\Oriental Voyage\\11 maa.mp3';
/*6c works not */ select * from test.test where filename like '%\\Abaji\\Oriental Voyage\11 maa.mp3';
/*6d works */ select * from test.test where filename like '%\\Abaji\\Oriental Voyage\\11 maa.mp3';
/*7 works not */ select * from test.test where filename like '%\Oriental Voyage\%';
/*7a works not */ select * from test.test where filename like '%\\Oriental Voyage\%';
/*7b works */ select * from test.test where filename like '%\Oriental Voyage\\%';
/*7c works */ select * from test.test where filename like '%\\Oriental Voyage\\%';
-
June 27, 2005 at 5:34 pm #18240RiteshMember
Mr. Lachlan Mulchahy of MySQL AB says:
Quote:The problem with the above is not actually a bug in MySQL, it is actually an error in your query. This is tricky to understand, so I will try to explain it simply.When you are using a query to match a LIKE clause the following occurs:
1. You issue the query: select * from tablename1 where id like 'M:\%'
2. The MySQL parser, strips out the slashes to leave only escaped characters. So the query looks like this:
select * from tablename1 where id like 'M:%'
3. The LIKE pattern matching parser, converts all escaped characters to their literal meanings — There is no meaning for an escaped % so this gets converted to nothing. The query then looks more like this:
select * from tablename1 where id like 'M:'
Note: This isn't exactly what occurs inside the server code, but more a good means of understanding how the escaped characters are working.
So the bottom line is that in order for you to match a literal '' within a like clause, you must escape once for the query parser, leaving you with '\' and then again for the LIKE pattern matcher, leaving you with '\\'.
In summary, the correct query for what you desire is as follows:
select * from tablename1 where id like 'M:\\%'
-
June 27, 2005 at 5:44 pm #18241peterlaursenParticipant
wellllllll ….
I think they should consider inproving their doc's then!
but does it explain these examples with my data
Code:/*5a works */ select * from test.test where filename like '%\Oriental Voyage\\11 maa.mp3';
/*5b works not */ select * from test.test where filename like '%\\Oriental Voyage\11 maa.mp3';BTW: All the discussions originated from my problems using a windows filename as a PK with SJA. I don't believe that SJA uses WHERE .. LIKE ??
-
June 27, 2005 at 6:34 pm #18242RiteshMemberQuote:I don't believe that SJA uses WHERE .. LIKE
It does and thats crux of all the problem 🙁
-
June 27, 2005 at 6:41 pm #18243peterlaursenParticipant
From my examples it seems like it will be safe to always escape the -character like “\\” when used with WHERE … LIKE.
-
June 28, 2005 at 1:34 am #18244peterlaursenParticipant
found this:
http://bugs.mysql.com/bug.php?id=11594
is this related somehow to our SJA issue ?
(funnily enough it's about using concat_ws() with WHERE…LIKE and music data (though no -character involved!))
-
June 28, 2005 at 3:04 am #18245RiteshMemberpeterlaursen wrote on Jun 27 2005, 06:41 PM:From my examples it seems like it will be safe to always escape the -character like “\\” when used with WHERE … LIKE.
Only when you have data like yours i.e. data with .
-
June 28, 2005 at 3:07 am #18246RiteshMemberpeterlaursen wrote on Jun 28 2005, 01:34 AM:found this:
http://bugs.mysql.com/bug.php?id=11594
is this related somehow to our SJA issue ?
(funnily enough it's about using concat_ws() with WHERE…LIKE and music data (though no -character involved!))
Nope.
This is a different kind of query.
-
June 28, 2005 at 6:28 am #18247peterlaursenParticipant
I shall try to hold back a little, but I believe this is too interesting …
I now believe that I understand that to search for literal string 'Oriental Voyage11 maa.mp3' where there are no chrs after “mp3”
you must write ” … like '%Oriental Voyage\\11 maa.mp3' ” in the WHERE-stmt
/* 1: – it works here */
select artist, albumtitle, title, filename
from test.test where filename like '%Oriental Voyage\\11 maa.mp3'
/* returns
artist albumtitle title filename
Abaji Oriental Voyage maa M:MusicAbajiOriental Voyage11 maa.mp3
*/;
/* 2: – but not here */
select Kunstner, Albumtitel, Titel, Filnavn
from musik.test where Filnavn like '%Oriental Voyage\\11 maa.mp3'
/* returns nothing */;
/* 3: – but adding a trailing % gets result. I really don't understand this! */
select Kunstner, Albumtitel, Titel, Filnavn
from musik.test where Filnavn like '%Oriental Voyage\\11 maa.mp3%'
/* returns
Kunstner Albumtitel Titel Filnavn
Abaji Oriental Voyage maa M:Peters MusikAbajiOriental Voyage11 maa.mp3 */;
/* create statements are identical or am I blind ? */
/* create statement for musik.test */
CREATE TABLE `test` (
`Kunstner` varchar(255) default NULL,
`Albumtitel` varchar(255) default NULL,
`Titel` varchar(255) default NULL,
`Filnavn` varchar(255) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
;
/* create statement for test.test */
CREATE TABLE `test` (
`artist` varchar(255) default NULL,
`albumtitle` varchar(255) default NULL,
`title` varchar(255) default NULL,
`filename` char(255) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
;
/* tried with and without PK's – and even tried renaming columns to identical names */
/* the only difference I can see with data and SQL in case 1 and 2-3 respectively is */
select count(*) from musik.test /* returns 38326 */;
select count(*) from test.test /* returns 1* /;
-
June 28, 2005 at 6:47 am #18248peterlaursenParticipant
Yes I was somewhat blind
but
CREATE TABLE `test` (
`artist` varchar(255) default NULL,
`albumtitle` varchar(255) default NULL,
`title` varchar(255) default NULL,
`filename` char(255) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
;
and
CREATE TABLE `test` (
`artist` varchar(255) default NULL,
`albumtitle` varchar(255) default NULL,
`title` varchar(255) default NULL,
`filename` varchar(255) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
(char –> varchar) yields same result!
all 3 queries were tested with SQLyog and Command-Line client as well.
But after adding some trailing blanks to that single record (there weren't any from the start) and removing them again even /*2*/ gets data !!
-
June 28, 2005 at 7:51 am #18249RiteshMemberpeterlaursen wrote on Jun 27 2005, 05:44 PM:Code:/*5a works */ select * from test.test where filename like '%\Oriental Voyage\\11 maa.mp3';
/*5b works not */ select * from test.test where filename like '%\\Oriental Voyage\11 maa.mp3';Nope.
I gotta ask the MySQL AB people on this issue.
-
June 28, 2005 at 7:58 am #18250RiteshMemberQuote:(char –> varchar) yields same result!
CHAR and VARCHAR just defines how the data is stored in the disk. Otherwise, there is no difference in the implementation.
-
June 28, 2005 at 8:00 am #18251peterlaursenParticipant
well I thought I understood
starting with
select * from test.test where filename like '%\Oriental Voyage\\11 maa.mp3';
stripped by the parser >>
select * from test.test where filename like '%Oriental Voyage\11 maa.mp3';
evaluated by MySQL server >>
select * from test.test where filename like '%Oriental Voyage11 maa.mp3';
should find one record!
starting with
select * from test.test where filename like '%\\Oriental Voyage\11 maa.mp3';
stripped by the parser >>
select * from test.test where filename like '%\Oriental Voyage11 maa.mp3';
evaluated by MySQL server >>
select * from test.test where filename like '%Oriental Voyage11 maa.mp3';
should find nothing.
That's how it works with the test.test table in above example – but not with the musik.test table!!
Most crazy: adding trailing blanks, saving and removing trailing blanks it works with musik.test too!
Is there some non-visual “binary garbage” in the table ?!
-
June 28, 2005 at 8:01 am #18252peterlaursenParticipantQuote:Otherwise, there is no difference in the implementation.
I know. But I just wanted to make the cases are TOTALLY identical !!
-
June 28, 2005 at 8:33 am #18253RiteshMember
I guess they need to update their docs on LIKE clause and usage. I will research on your problem a little more and let you know the details.
-
June 28, 2005 at 8:34 am #18254peterlaursenParticipant
BTW: I have also tried some experiments with putting where-clause in HAVING and INSTR()-function.
select kunstner, albumtitel, titel, filnavn
from musik.test having filnavn like '%Oriental Voyage\\10 Tchai.mp3'
/* doesn't find data */;
select kunstner, albumtitel, titel, filnavn
from musik.test where filnavn like '%Oriental Voyage\\10 Tchai.mp3'
/* doesn't find data */;
select kunstner, albumtitel, titel, filnavn
from musik.test Where Instr(filnavn,'Oriental Voyage\10 Tchai.mp3')
/* NB: finds data !!!! NOTE: LIKE-parser not active with INSTR!! I stille believe there is a problem with the parser*/;
select artist, albumtitle, title, filename
from test.test where filename like '%Oriental Voyage\\11 maa.mp3'
/*finds data*/;
select artist, albumtitle, title, filename
from test.test having filename like '%Oriental Voyage\\11 maa.mp3'
/*finds data*/;
select artist, albumtitle, title, filename
from test.test where Instr(filename,'Oriental Voyage\11 maa.mp3')
/*finds data*/;
/*(Now I can't use file ” …11 maa.mp3″ to test with music.test anymore – hope you understand that point!*/
-
June 28, 2005 at 8:44 am #18255peterlaursenParticipantQuote:I will research on your problem a little more and let you know the details.
Thanks. But I found a workaround long ago (exporting an Access binary replication type to a MySQL char/varchar type that can be used as a PK as well). So it should not be done for my blue eyes! For your own (if you have them blue 😀 ). As long as this behaviour is not completely understood you can't know what errors it will generate in the future. It could very well be very critical errors with corruption of data. Untill now the only error that has occurred with SJA is that no sync took place where it should. But no guarantee for the future!
And remember: user “Davowb” had an issue where SJA would work with an empty target, but not a target with data in it (what was also my experience). My intuition tells me that this is part of the same problem. And yes: I am a very intuitive person. Even more than most women! And I have pretty good results with it!
-
June 28, 2005 at 9:00 am #18256peterlaursenParticipant
However (just like before)
select kunstner, albumtitel, titel, filnavn
from musik.test having filnavn like '%Oriental Voyage\\10 Tchai.mp3%'
/* finds data */;
select kunstner, albumtitel, titel, filnavn
from musik.test where filnavn like '%Oriental Voyage\\10 Tchai.mp3%'
/* finds data */;
See attached pic. You can see the cursor. It's moved as much rightward as possible, which tells that there are no trailing blanks! So that's not the reason why the trailing %-character is needed in WHERE..LIKE!
-
June 28, 2005 at 9:45 am #18257peterlaursenParticipant
I just did a test with data on my webhost (MySQL 4.0.24).
upper SQLyog-window: “production”-database. Data imported with SQLyog from text-file. See complete DATA-history above!
Edited:
Quote:Synced aprox. 4 times with SJA.Wrong!!! I did a fresh import about two days ago to test the “export NULL” issue. SJA has not been in use with these data!
lower SQLyog-window: database with one row of data entered from the keyboard into SQLyog DATA-pane..
-
June 28, 2005 at 11:01 am #18258peterlaursenParticipant
then look here !! There IS some “binary garbage” at the end of data in file that has been imported from text-file. There is not when data is entered from keyboard.
Thus the problem with the trailing % is not related to the the WHERE…LIKE problem
-
June 28, 2005 at 11:34 am #18259peterlaursenParticipant
And it is something equivalent to EXACTLY one character that is at the end.
-
June 28, 2005 at 11:53 am #18260peterlaursenParticipant
I believe I can now understand, predict and verify the behaviour of all the example queries that I posted here.
Some examples are allready given.
here some of the most tricky ones:
/* First this one */
select * from musik.test where filnavn like '%\Oriental Voyage\%'
stripped by parser >>
select * from musik.test where filnavn like '%Oriental Voyage\%'
evaluted by Mysql server >>
select * from musik.test where filnavn like '%Oriental Voyage%' /* O simply resolves to O and \ to (literal) */
/* finds all tracks in album */
/* This however: */
select * from musik.test where filnavn like '%\Oriental Voyage\%'
stripped by parser >>
select * from musik.test where filnavn like '%Oriental Voyage%'
evaluated by MySQL server >>
select * from musik.test where filnavn like '%Oriental Voyage%' /* trailing % is here LITERAL % and O simply resolves to O */
/* finds nothing since there is no literal instance of 'Oriental Voyage%'*/
/* And finally */
select * from musik.test where filename like 'M:\Music\%'
stripped by parser >>
select * from musik.test where filename like 'M:Music\%'
evaluated by mySQL server
select * from musik.test where filename like 'M:Music%' /* M simply resolves to M */
/* finds nothing since there is no literal instance of 'M:Music' */
-
June 28, 2005 at 12:09 pm #18261peterlaursenParticipant
My conclusion:
Parser is OK (you might even find it logical!), but error with data import (trailing “invisible” blanks)!
Since that is reproduced with 4.0.24 and 5.0.7 I really doubt that this is an issue with MySQL.
-
June 28, 2005 at 1:02 pm #18262RiteshMemberQuote:Parser is OK (you might even find it logical!), but error with data import (trailing “invisible” blanks)!
I will give a detailed report on this issue by evening.
-
June 28, 2005 at 1:10 pm #18263peterlaursenParticipant
I shall shut up until then!
I am fully confident that you will solve the problems
…………….. – with some help :wub:
-
June 28, 2005 at 4:34 pm #18264RiteshMember
If you check the SQL file for your table dump, you will see that there is an extra
-