Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-40551

Copy/Paste friendly output format for MariaDB Command Line Client

    XMLWordPrintable

Details

    • New Feature
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 13.2
    • None

    Description

      We got the feature request to provide a new output format for the command line client which allows copy/paste of SQL statements created via SQL, controlled via an SQL statement option like \G. A requirement is that it also works on Windows, using a pager is therefor not an option

      Example:

      select concat('analyze table ', table_name, ';') from information_schema.tables where table_schema='test';
      

      generates

      +-------------------------------------------+
      | concat('analyze table ', table_name, ';') |
      +-------------------------------------------+
      | analyze table t_auto;                     |
      | analyze table t2;                         |
      | analyze table t1;                         |
      +-------------------------------------------+
      

      The request is an output like:

      analyze table t_auto;    
      analyze table t2;                        
      analyze table t1;      
      

      The output can be generated using the mariadb command line client with options, but not when using the command line client in the interactive mode.

      mariadb -u root -pPassword123! -N -B -e "select concat('analyze table ', table_name, ';') from information_schema.tables where table_schema='test'"
      

      • the command line option -B could be added as \B behaving like the command line option and would also not show the column names

      Attachments

        Activity

          People

            serg Sergei Golubchik
            ralf.gebhardt Ralf Gebhardt
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 2d
                2d
                Remaining:
                Remaining Estimate - 2d
                2d
                Logged:
                Time Spent - Not Specified
                Not Specified

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.