Menu

#759 (Ok 4.3) use aliases in SQL export for tables and columns

Needs_decision
fixed
1
2014-12-05
2005-08-04
Tyler
No

When exporting to a SQL query phpMyAdmin will break
functions into multiple columns. It will then remove
the same ammount of columns passed to the funciton from
the end of the column list.

ex:
SELECT
CONCAT( 'DOMAIN\\' , `username` ) AS 'uname',
'fullname';

will export a query:
INSERT INTO table
(
`DOMAIN\\`,
`username`)
VALUES
(
'DOMAIN\\john',
'John Doe'
);
instead of ...table (`uname`,`fullname`) values...

Similarly, phpMyAdmin doesnt recognise renamed columns
in the export:
select `name` as 'fullname' where 1;
will export:
insert into table ('name') values ('John Doe');

Discussion

  • Sebastian Mendel

    • labels: 546627 --> Data Export
    • milestone: 506930 -->
    • summary: exporting functions as multiple columns --> use aliases in SQL export for tables and columns
     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580

    1.) can not reproduce, there is no SQL export for this type
    of query

    2.) SQL Export is to export a whole table, you should use
    CSV Export

    moved to RFE:

    when exporting a query, there should be an option to use the
    aliases from the query as column and table names

    and make the create table statment only with fields in the query

     
  • Marc Delisle

    Marc Delisle - 2014-01-17
    • labels: Data Export --> Data Export, GSOC 2014
    • assigned_to: Isaac Bennetch
    • Group: --> Needs_decision
     
  • Isaac Bennetch

    Isaac Bennetch - 2014-06-18
    • status: open --> resolved
    • Priority: 5 --> 1
     
  • Isaac Bennetch

    Isaac Bennetch - 2014-06-18
    • summary: use aliases in SQL export for tables and columns --> (Ok 4.3) use aliases in SQL export for tables and columns
     
  • Marc Delisle

    Marc Delisle - 2014-12-05
    • Status: resolved --> fixed