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

PIVOT create not setting default value of the column

    XMLWordPrintable

Details

    Description

      When I create a pivot using the following SQL, I do not see that default values are set for the pivot columns. The default value is always 0.

      CREATE OR REPLACE TABLE sales3Q(
      region VARCHAR(255) null,
      country VARCHAR(255) null,
      item_type VARCHAR(255) null,
      measures VARCHAR(255) null,
      Y2016_W06 double(32,2) default null flag=1,
      Y2016_W07 double(32,2) default null flag=1,
      Y2016_W08 double(32,2) default 0.5 flag=1,
      Y2016_W09 double(32,2) default null flag=1
      ) engine=connect table_type=pivot
      option_list='PivotCol=order_date, Accept=1'
      SrcDef='select * from <some table>'
      

      In the above example, W06 values exist in the source table, but not W07.
      In W07 column, I get zero instead of null and in W08 column, I get zero instead of 0.5

      Please check if this is a bug and if there is any workaround.

      thanks
      Mahesh

      Attachments

        Activity

          People

            monty Michael Widenius
            maheshkr76private Mahesh K Renduchintala
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.