List:Internals« Previous MessageNext Message »
From:Chad MILLER Date:March 17 2007 3:11pm
Subject:Re: select *, more_fields
View as plain text  
On 16 Mar 2007, at 15:42, Martin Friebe wrote:
> I believe to remember there have been feature requests, about the  
> placement options for the * in the select
> ( http://bugs.mysql.com/bug.php?id=26066 )
>
> currently the * must be the first in the list.
> select *, field from table => ok
> select  field, * from table => not ok
>
> This appears to be fixable in the parser with little effort.
> So the questions are:
> - Is it SQL standard conform?
> - Is it a feature that would be wanted?
>
> If it is "yes", I can supply a patch.
>
> One more question, if "yes"
>
> Should  "select *, * from table" be allowed?
> My first thought would be "no", but then you can already do:
>  "select table.*, table.* from table from table"

Hi Martin.  Offhand, I don't know why this special case exists.   
Looking at the parser, I suspect that it's probably only a case of  
someone wishing to avoid shift/reduce conflicts and not thinking of  
these cases.  I very much would like to see a patch, along with some  
test results that show that such a construction doesn't confuse the  
optimizer, which is the only potential problem that comes to mind.

I also say that "SELECT *, *, *, * FROM tablename" should be allowed  
also.

- chad

--
Chad Miller, Software Developer                         chad@stripped
MySQL Inc., www.mysql.com
Orlando, Florida, USA                                13-20z,  UTC-0500
Office: +1 408 213 6740                         sip:6740@stripped



Attachment: [application/pgp-signature] This is a digitally signed message part PGP.sig
Thread
select *, more_fieldsMartin Friebe16 Mar
  • Re: select *, more_fieldsChad MILLER17 Mar
    • Re: select *, more_fieldsMartin Friebe17 Mar
      • engine agnostic test [Re: select *, more_fields]Martin Friebe17 Mar
    • Re: select *, more_fieldsVladimir Shebordaev17 Mar
      • Re: select *, more_fieldsMartin Friebe18 Mar
      • Re: select *, more_fieldsPeter Gulutzan21 Mar
        • draft of sql2003 / quoting [Re: select *, more_fields]Martin Friebe21 Mar