Menu

#699 Export not working if amount of schemas higher than 1000

4.7.2
closed-works-for-me
9
2019-08-21
2019-08-12
No

When trying to export anything from any table in schema, and there is more than 1000 schemas in DB, adminer generates black page.

The same is with SQL command window.

1 Attachments

Discussion

  • Martin Barilík

    Martin Barilík - 2019-08-12

    *adminer generates blank page

     
  • Peter Liscovius

    Peter Liscovius - 2019-08-14

    More then 1000 schemas???

    In case you meant 1000 tables:

    This might be related to bug #687 too, but is a server side limit.

    The default max_input_vars of PHP is 1000, see https://www.php.net/manual/en/info.configuration.php . The Adminer 4.7.2 export has 1 (for tablename) up to 2 (when has data) checkboxes for each table. Together with the other form vars this means the limit is below 500 tables when max_input_vars is 1000.

    Further it does the export in my case, but just ends when the limit is reached. For instance, you selected 1000 tables with data, but the export contains only around 500 tables. This could be very annoying when you have only half backups when you need them...

    Solutions:

    1. On the export page, Adminer should generate a warning on the export form when
      (fixed export form vars + 2 * tables) >= ini_get('max_input_vars')
      A suggestion can be made to increase the limit by php configuration, but that is not always possible for the user.

    2. To still make it possible to simply export all table definitions and all data export, the 'alltables'-checkbox and 'alldata'-checkbox could attach eventlisteners. The eventlisteners:
      a. When input name='alltables' checkbox checked, uncheck all other single tables[] checkboxes and also set display:none to them. The form then sends 'alltables', but not the 1000 tables[] array.
      b. When input name='alldata' checkbox checked, uncheck all other single data[] checkboxes and also set display:none to them. The form sends 'alldata', but not the 1000 data[] array.
      The php then handles it when it sees alltables and/or alldata POST variables.

    3. When only a part of tables or table data should be exported, another eventlistener should watch the count of checked tables[] and data[]. If the (selected checkboxes + fixed form vars) reach the max_input_vars limit, a warning should be automatically shown that the serverside php limit to handle requests is reached.

    This is a oneliner to generate the 1000 test tables for mysql:

    mysql -e 'create database testmax' &&
    php -r 'for($i=1;$i<=1000;$i++){echo "create table a$i(id int);\n";}' | mysql testmax
    
     

    Last edit: Peter Liscovius 2019-08-14
  • Martin Barilík

    Martin Barilík - 2019-08-14

    No, i meant what i've wrote. We have single database with exactly 1320 schema, where schema has exactly 206 tables.

    I am trying to export only data from one table. As you can see on the picture i sent - i am trying to make simple export from table odoslana_fakturas, which is in a specific schema with number 512315641. This export should have around 100 rows, but it doesnt work.

    Question is, if adminer or php is limited to number of schemas in regards of the 1000 amount mentions above. It makes sense when looking at bug i reported as well https://sourceforge.net/p/adminer/bugs-and-features/698/

    where adminer is somehow using schema ID inthere, so it can exceed the amount

     

    Last edit: Martin Barilík 2019-08-14
  • Jakub Vrána

    Jakub Vrána - 2019-08-21
    • status: open --> closed-works-for-me
     
  • Jakub Vrána

    Jakub Vrána - 2019-08-21

    I created 1000 schemas and I couldn't reproduce. There's no such limit in Adminer. Please provide complete reproduction steps or try to debug the issue yourself (by finding where exactly does Adminer stop).

     

Log in to post a comment.