List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:July 24 2002 1:47pm
Subject:Re: Very minor buglet
View as plain text  

Pete French wrote:

>>We are discussing the 'mysql' client which is often used to write 
>>scripts that run under the
>>UNIX shell.
>>
>...
>
>>If you write a script that has two semi-colons in a row,  the second one 
>>is ignored and no error message is given.
>>
>
>Err, not true (in amysql script anyway)
>

echo "select 10;;
select 20; " | mysql

produces:
10
10
20
20


with no errors.
at  least with 3.23.38

>
>
>I think you are trying to compare the ';' at the end of an SQL statement
>with putting a blank line in a comman interpretter, because you are assuming
>that the ; is intended to separate commans as it would in the shell.
>i.e.
>
>echo hello
>echo world
>
>is the same as
>
>echo hello; echo world;o
>
>and thus ;; works because the shell does not pproduce an error message for
>a blank line when you hit return.
>
>but this is not the function of the ; in mySQL- its part of the SQL syntax
>and thus a ';' will always produce an error as its not valid to have a
>';'on a line by itself.
>
>You might disagree with the behaviour, but if so then the properplace
>to complain is to the ANSI SQL people, not mySQL.
>
>ORACLE also generates an error for ;; - it takes the 2nd semicolon as
>the statement terminator and complains about the first one ebing not a valid
>part of the query.
>
>-pcf.
>


Thread
Very minor bugletAlain Williams23 Jul
  • RE: Very minor bugletJay Blanchard23 Jul
    • Re: Very minor bugletAlain Williams23 Jul
  • Re: Very minor bugletGerald Clark23 Jul
  • Re: Very minor bugletdenonymous23 Jul
    • Re: Very minor bugletAlain Williams23 Jul
      • RE: Very minor buglet [Now OT]Jay Blanchard23 Jul
      • Re: Very minor bugletBenjamin Pflugmann23 Jul
        • RE: Very minor bugletCal Evans24 Jul
  • Re: Very minor bugletGerald Clark23 Jul
    • Re: Very minor bugletPete French24 Jul
      • Re: Very minor bugletGerald Clark24 Jul