Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
Subject: mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Subject: Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
Subject: MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Subject: Re: Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
strange INSERT problem using strings with leading dashes, GET PARAMETER wind

strange INSERT problem using strings with leading dashes, GET PARAMETER wind

2007-07-17       - By Robert Klemme

 Back
2007/7/16, aquarius14@(protected) <aquarius14@(protected)>:
> Hi folks,
> does anybody have a good explanation why an insertion of a string into a
varchar field fails
> if one tries to insert a string with a line break (i.e. CRLF) followed by one
or more dashes ?
> (a 'Get Parameter for ...' popup window is comming up, asking for a parameter
> for some variable coming next after the dashes,
> in the example below, it would ask for a parameter for 'test')
>
> Meaning something like this:
> (Prerequisite: you have a table mytest with an attribute term varchar, in my
case varchar(7900). )
>
> insert into test (term)
> values('this is
> a
> ---
> test')
>
>
> Sure, this is a really short drosophila example for a more complex
> problem observed during data migration and subsequent trouble shooting.
> But I think it should be possible to insert some dashed line into some text
which has CRLF-separated lines.
>
> Note: (a) as far as I have seen,  there can be blanks before the dashes in
order to create the same problem,
> an added leading dot in front of the dashes, however, makes the insertion
possible.
> (b) I am testing on DB server 7.5.00.38 on Windows and SQL studio 7.6.00.27
(123692)
>
> Appreciating any feedback,
> (also links to manual pages where I can read good examples
> how parameter insertion really works (e.g. in SQL Studio)
> and also how that can be avoided in case you are just not interested in
Parameter Insertron.)

The only thing that comes to mind is that two leading dashes start a
line comment in SQL. Maybe you hit a bug in the parser that leads to
this line being treated as comment.

Kind regards

robert

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/maxdb?unsub=mysql@(protected)