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

FIRST_V throw SQL Fehler (1292): Incorrect datetime value: ''

    XMLWordPrintable

Details

    Description

      To reproduce:

      CREATE TABLE IF NOT EXISTS `fv_test` (
        `SOME_DATE` datetime NOT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
       
      INSERT INTO `aa`.`fv_test` (`SOME_DATE`) VALUES ('2017-07-20 12:47:56');
      

      create table fv_result
      SELECT 
      FIRST_VALUE(SOME_DATE) OVER(ORDER BY SOME_DATE DESC) AS somedate
      FROM fv_test;
      

      SQL Fehler (1292): Incorrect datetime value: '' for column 'somedate'
      

      The select (without create table) throw only a warning.

      It will caused by FIRST_VALUE, the error persists if the datatype in the over clause will be changed to non-datetime, but vanished if the datatype/column in the first_value will be changed to non-datetime.

      Attachments

        Activity

          People

            cvicentiu Vicențiu Ciorbaru
            Richard Richard Stracke
            Votes:
            1 Vote for this issue
            Watchers:
            5 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.