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

SELECT DATE_FORMAT(..., %h) gives incorrect result with cursor protocol

    XMLWordPrintable

Details

    • Unexpected results
    • The DATE_FORMAT SQL function when a negative result returned had an incorrect result when used in a VIEW or the cursor protocol; Fixed thanks to Rion Bora

    Description

      SELECT DATE_FORMAT(..., %h) gives incorrect result with cursor protocol. Problem repeats only with option %h (hour with 2 digits between 01-12).
      Case: (run MTR test with --cursor-protocol):

      CREATE VIEW v AS SELECT DATE_FORMAT(TIME'-01:01:01','%h');
      SELECT * FROM v;
      DROP VIEW v;
      

      Expected result:

      DATE_FORMAT(TIME'-01:01:01','%h')
      -01
      

      Actual result:

      DATE_FORMAT(TIME'-01:01:01','%h')
      -0
      

      Attachments

        Issue Links

          Activity

            People

              gkodinov Georgi Kodinov
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 40m
                  40m

                  Git Integration

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