forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › Data Search Bug
- This topic is empty.
-
AuthorPosts
-
-
January 10, 2012 at 3:50 pm #12557Isomer DesignMember
I have a table with varchar columns that contain strings with a leading and trailing hyphen, e.g. -OMeO-. When I use Data Search it incorrectly finds this string in every row. Searching for -OMeO- works properly.
Even weirder things happen when I go looking for them: searching for this: -OMeO- x is equivalent to searching for this: x.
-
January 10, 2012 at 4:17 pm #33011peterlaursenParticipant
“-” is a 'minus- operator working similar to same in Google advanced search. Data Sync is per design 'google search for databases'. DO NOT think SQL when using it!.
Program documentation:
“Also the '+' and '-' operators are supported. +string or +”some string” will not append a '%'-wildcard to the ends of the specified search string. So '+' is an exact match with the search string you specified. For instance +mysql will find rows where a column exactly matches 'mysql' – and not 'mysql server' for instance. '-' behaves like '+' except that the LIKE clause will be replaced with a NOT LIKE clause. Note that '+' and '-' only work as operators when they have no whitespace to their right. +lion will find exact matches on 'lion' whilst + lion will find rows where there are fuzzy matches on BOTH 'lion' AND '+' in same columns of the database objects searched.”
Release Blogs:
http://www.webyog.co…our-finger-tips
http://www.webyog.co…d-in-sqlyog-9-2
If this does not explain what you see please elaborate your case (table structure, INSERT statements, screenshots). I do not fully understand.
Please also ensure that you have read the paragraph on Data Search in program documentation (help .. help menu).
-
January 10, 2012 at 4:20 pm #33012peterlaursenParticipant
To suppres “-” being interpreted as an operator quote the search string like “-OMeO-“ or just search on OMeO (if I understand the problem).
-
January 10, 2012 at 6:30 pm #33013peterlaursenParticipant
In other words
searching on “-OMeO-” (without quotes) will generate a WHERE clause like “.. WHERE column NOT LIKE '%OMeO-%”
-
January 10, 2012 at 9:28 pm #33014Isomer DesignMember'peterlaursen' wrote:
To suppres “-” being interpreted as an operator quote the search string like “-OMeO-“ or just search on OMeO (if I understand the problem).
Ah, that explains it. My mistake. I read this, then stopped reading: “After entering some text in the text-box, click 'Search' or push enter. SQLyog will find all data that matches the search string entered.”
I admit this is clearly a case of RTFM, but might I suggest some clue on that first help page, or better still on the Data Search tab itself, that what you type is not necessarily what you'll find? Even something as perplexing as “DO NOT think SQL when using it!” might help.
Many thanks,
/Steve
-
January 11, 2012 at 8:23 am #33015peterlaursenParticipant
A cotrrection: actually when using + and – operators we don't attach wildcards to the end of the string, so the WHERE clause would be “.. WHERE column NOT LIKE 'OMeO-'”
-
-
AuthorPosts
- You must be logged in to reply to this topic.