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

Quick mode produces the bug for mariadb client

Details

    Description

      For the quick mode we need the option to limit width of the column for printing the data
      current behavior makes interactive console unusable

      Attachments

        Issue Links

          Activity

            leonid.fedorov Leonid Fedorov created issue -
            leonid.fedorov Leonid Fedorov made changes -
            Field Original Value New Value
            Description After config option added
            {code}
            [mariadb-client]
            quick
            {code}

            simple query
            {code}
            create table t(a text) engine;
            insert into t values('xyz');
            select * from t;
            {code}

            produces stream of dashes that make console unusable
            {code}
            MariaDB [test]> select * from t;
            +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
            {code}

            in the print table code
            {code}
            static void
            print_table_data(MYSQL_RES *result)
            {
              String separator(256);
              MYSQL_ROW cur;
              bool *num_flag;

              num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
              if (column_types_flag)
              {
                print_field_types(result);
                if (!mysql_num_rows(result))
                {
                  my_afree((uchar*) num_flag);
                  return;
                }
                mysql_field_seek(result,0);
              }
              separator.copy("+",1,charset_info);
              while (MYSQL_FIELD *field= mysql_fetch_field(result))
              {
                uint length= column_names ? field->name_length : 0;
                if (quick)
                  length= MY_MAX(length,field->length);
                else
                  length= MY_MAX(length,field->max_length);
                if (length < 4 && !IS_NOT_NULL(field->flags))
                  length=4; // Room for "NULL"
            {code}

            I could see the length calculated as MY_MAX(length,field->length); accepts the value of several thousands
            leonid.fedorov Leonid Fedorov made changes -
            leonid.fedorov Leonid Fedorov made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            leonid.fedorov Leonid Fedorov made changes -
            Affects Version/s 10.6.18-14 [ 29820 ]
            leonid.fedorov Leonid Fedorov made changes -
            Component/s Server [ 14979 ]
            julien.fritsch Julien Fritsch made changes -
            Component/s Scripts & Clients [ 14977 ]
            julien.fritsch Julien Fritsch made changes -
            Component/s ColumnStore [ 15602 ]
            julien.fritsch Julien Fritsch made changes -
            Labels client
            julien.fritsch Julien Fritsch made changes -
            Assignee Oleksandr Byelkin [ sanja ]
            serg Sergei Golubchik made changes -
            Component/s ColumnStore [ 15602 ]
            Component/s Server [ 14979 ]
            Fix Version/s N/A [ 23617 ]
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            Resolution Not a Bug [ 6 ]
            Status Open [ 1 ] Closed [ 6 ]
            leonid.fedorov Leonid Fedorov made changes -
            Issue Type Bug [ 1 ] New Feature [ 2 ]
            leonid.fedorov Leonid Fedorov made changes -
            Description After config option added
            {code}
            [mariadb-client]
            quick
            {code}

            simple query
            {code}
            create table t(a text) engine;
            insert into t values('xyz');
            select * from t;
            {code}

            produces stream of dashes that make console unusable
            {code}
            MariaDB [test]> select * from t;
            +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
            {code}

            in the print table code
            {code}
            static void
            print_table_data(MYSQL_RES *result)
            {
              String separator(256);
              MYSQL_ROW cur;
              bool *num_flag;

              num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
              if (column_types_flag)
              {
                print_field_types(result);
                if (!mysql_num_rows(result))
                {
                  my_afree((uchar*) num_flag);
                  return;
                }
                mysql_field_seek(result,0);
              }
              separator.copy("+",1,charset_info);
              while (MYSQL_FIELD *field= mysql_fetch_field(result))
              {
                uint length= column_names ? field->name_length : 0;
                if (quick)
                  length= MY_MAX(length,field->length);
                else
                  length= MY_MAX(length,field->max_length);
                if (length < 4 && !IS_NOT_NULL(field->flags))
                  length=4; // Room for "NULL"
            {code}

            I could see the length calculated as MY_MAX(length,field->length); accepts the value of several thousands
            For the quick mode we need the option to limit width of the column for printing the data
            current behavior makes interactive console unusable
            leonid.fedorov Leonid Fedorov made changes -
            Resolution Not a Bug [ 6 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.6 [ 24027 ]
            Fix Version/s N/A [ 23617 ]
            julien.fritsch Julien Fritsch made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Summary Quick mode produces the bug for mariadb cliend Quick mode produces the bug for mariadb client
            ralf.gebhardt Ralf Gebhardt made changes -
            Component/s Scripts & Clients [ 11002 ]
            Component/s Scripts & Clients [ 14977 ]
            Fix Version/s 11.7 [ 29815 ]
            Fix Version/s 10.6 [ 24027 ]
            Key MENT-2103 MDEV-34704
            Affects Version/s 10.6.18-14 [ 29820 ]
            Project MariaDB Enterprise [ 11500 ] MariaDB Server [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Testing [ 10301 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Ramesh Sivaraman [ JIRAUSER48189 ]
            ramesh Ramesh Sivaraman made changes -
            Assignee Ramesh Sivaraman [ JIRAUSER48189 ] Oleksandr Byelkin [ sanja ]
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            issue.field.resolutiondate 2024-08-27 14:36:25.0 2024-08-27 14:36:24.597
            sanja Oleksandr Byelkin made changes -
            Fix Version/s 11.7.0 [ 29912 ]
            Fix Version/s 11.7 [ 29815 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            sanja Oleksandr Byelkin made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Fix Version/s 10.5.27 [ 29902 ]
            Fix Version/s 11.7.0 [ 29912 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            sanja Oleksandr Byelkin made changes -
            Fix Version/s 10.6.20 [ 29903 ]
            Fix Version/s 10.11.10 [ 29904 ]
            Fix Version/s 11.4.4 [ 29907 ]
            Fix Version/s 11.6.2 [ 29908 ]
            Fix Version/s 11.7.1 [ 29913 ]
            greenman Ian Gilfillan made changes -
            serg Sergei Golubchik made changes -
            Fix Version/s 11.7.1 [ 29913 ]

            People

              sanja Oleksandr Byelkin
              leonid.fedorov Leonid Fedorov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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