suspected bug...

2003-03-13 Thread lauren
hi

i posted this to the newsgroups and got told it was probably a sql
parser bug so here goes...

if u try to execute a query such as:

insert into foo (id,textfield) values (54,'\\fred\\')

the query fails

if i add a space after the last \\ it works
this is a real pain personally cos we use a lot of that stuff :(
any workarounds or fixes or whatnots?

many thanks


oh yah the guy who replied to me on the newsgroup said i should submit
this:
JElkOiBzcWxwYXJzZXIubGliLnBocCx2IDEuMTUgMjAwMi8wNy8yNiAxODozMDo1OSBsZW05
IEV4
cCAkPGJyIC8+CldoeSBkaWQgd2UgZ2V0IGhlcmU/IDUgNiAxNDY8YnIgLz4KTGVmdG92ZXI6
IOE8
YnIgLz4KQTogNSA2PGJyIC8+ClNRTDogRGF0YWLhemUgcGl6emEgLSBUYWJ1bGthIHNpY2ls
aWFu
b190YWdlc19tZW51IG5hIGxvY2FsaG9zdCANCklOU0VSVCBJTlRPIHNpY2lsaWFub19jYXRl
Z29y
eV90YWdlc19tZW51IFZBTFVFUyAoMSwgJ0FudGlwYXN0aScsICdLYWx0ZSBWb3JzcGVpc2Vu
Jyk=

dunno what thats about but i hope it isnt a screw up or anything

lauren

---
even if my world is weird its my world


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



RE: suspected bug...

2003-03-13 Thread lauren
the actual horror story query is:

update link set path=insert(path,1,13,'\\test\\test21\\') where
person_id = 8 and path like '\\test\\test2\\%'

am going slightly dilly
:/

---
even if my world is weird its my world


 -Original Message-
 From: Keith C. Ivey [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, March 13, 2003 15:27
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: suspected bug...
 
 
 On 13 Mar 2003, at 14:59, lauren wrote:
 
  if u try to execute a query such as:
  
  insert into foo (id,textfield) values (54,'\\fred\\')
  
  the query fails
  
  if i add a space after the last \\ it works
  this is a real pain personally cos we use a lot of that stuff :(
 
 You'll have to show us exactly how you're getting the query to MySQL. 
 Are you using PHP? Perl? C?  Regardless, I suspect that by the time 
 the SQL gets to MySQL you don't have as many backslashes as you think 
 you do.  Constructing strings that have contain backslashes, 
 especially multiple backslashes, and passing them around can be 
 tricky.  If you're doing this in PHP:
 
   $sql = INSERT INTO foo (id, text_field) VALUES (54, '\\fred\\');
 
 then the string doesn't actually contain double backslashes, only 
 single ones, so it'll be invalid if you pass it to MySQL.  You'll 
 need quadruple backslashes in your PHP to end up with double 
 backslashes in your SQL.  (And things get even worse if you're using 
 LIKE, which involves yet another level of escaping.)
 
 If your backslash-containing strings are file paths, you might 
 consider avoiding the complication and using forward slashes instead. 
 They work fine on Windows in most contexts.
 
 -- 
 Keith C. Ivey [EMAIL PROTECTED]
 Tobacco Documents Online
 http://tobaccodocuments.org
 Phone 202-667-6653
 


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



RE: suspected bug...

2003-03-13 Thread lauren
its cool i got the 4 backslashes thing worked out
thanks very much for the pointer
:)

---
even if my world is weird its my world


 -Original Message-
 From: Keith C. Ivey [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, March 13, 2003 16:11
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: RE: suspected bug...
 
 
 On 13 Mar 2003, at 15:30, lauren wrote:
 
  the actual horror story query is:
  
  update link set path=insert(path,1,13,'\\test\\test21\\') where
  person_id = 8 and path like '\\test\\test2\\%'
 
 You still haven't told us how you're sending this query to MySQL, and 
 my advice remains the same.  If at all possible, avoid the problem by 
 using forward slashes rather than backslashes in your paths.  If 
 that's not possible, carefully work through how many levels of 
 escaping you need to get MySQL to see the final SQL statement as you 
 want it.  Note that for the LIKE part of your query you're going to 
 need four backslashes to match a single backslash, which means you 
 likely will be typing eight backslashes at that point in your PHP (or 
 whatever) code.  See the documentation:
 
 |   Note: Because MySQL uses the C escape syntax in strings (for
 |   example, `\n'), you must double any `\' that you use in your
 |   LIKE strings. For example, to search for `\n', specify it as
 |   `\\n'. To search for `\', specify it as `' (the backslashes
 |   are stripped once by the parser and another time when the
 |   pattern match is done, leaving a single backslash to be
 |   matched).
 
http://www.mysql.com/doc/en/String_comparison_functions.html

-- 
Keith C. Ivey [EMAIL PROTECTED]
Tobacco Documents Online
http://tobaccodocuments.org
Phone 202-667-6653


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: It stoped working, and won't work anymore

2002-01-24 Thread Lauren Matheson

I don't know of any changes that happened right at the time that it went
down.  Now, the box _was_ rooted :-), but I *think* mysql going down was
independent of that.  Since then I've reinstalled every rpm on the system,
so it should be clean.  MySQL hangs as I install the rpm for it though as
soon as it gets to the stage where it starts mysqld

The logs say nothing unfortunately, the mysql log just records that it is
starting up.

Thanks,
Lauren.

On Thu, 24 Jan 2002, Gerald Clark wrote:

 What did you change?
 
 And the logs say?
 
 Lauren Matheson wrote:
 
  I've just bumped into the same problem - a RedHat 6.1 server that ran 
  for 2 years with MySQL-3.22.27-1.i386 rpm's from the mysql site, and 
  the server just died and is having identical behaviour to that 
  describe - hangs on creating tables, mysqladmin stalls..  Any help 
  would be much appreciated!
 
  Lauren Matheson
 
 
  -
  Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
  To request this thread, e-mail [EMAIL PROTECTED]
  To unsubscribe, e-mail 
  [EMAIL PROTECTED]
  Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 
 
 
 


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: It stoped working, and won't work anymore

2002-01-23 Thread Lauren Matheson

I've just bumped into the same problem - a RedHat 6.1 server that ran 
for 2 years with MySQL-3.22.27-1.i386 rpm's from the mysql site, and the 
server just died and is having identical behaviour to that describe - 
hangs on creating tables, mysqladmin stalls..  Any help would be much 
appreciated!

Lauren Matheson


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php