I've discovered that DBD::mysql will return "tablefoo.fieldbar" as
the NAME of the field in a select like:

    SELECT tablefoo.fieldbar FROM tablefoo

It does that simply because that's what the underlying mysql client
API tell it is the name of the field.

I believe this is very rare (I know of no others drivers that do that)
and I'm considering changing the DBI specification to clarify that NAME
should only contain the fieldname.

I appreciate that there's a loss of information here and that
statements like this:

    SELECT table1.field, table2.field FROM table1, table2 WHERE ...

will return the same NAME value for both fields.

However, I'm currently of the opinion that removing the table name
to make NAME be consistent with the behaviour of other drivers is
of greater benefit than retaining the table name.

I'd welcome any examples of code that *relies* in the table name
being present in the NAME attribute and can't easily be changed.

Note that in the specific case of DBD::mysql, the table name of
each field is also availble in the $sth->{mysql_table} attribute,
so any application that needs the table name for each field can
still get it.

Tim.

Reply via email to