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

when lead() returns null on a datetime field, the result is treated as the literal string '[NULL]'

    XMLWordPrintable

Details

    Description

      /* when lead() returns null on a datetime field, the result is treated as the literal string '[NULL]' */
       
      	create temporary table d1(d datetime);
      	insert into d1 values ('2018-01-01 00:00:00'),('2018-02-01 00:00:00');
      	
      	/* null record is not returned */
      	select *
      	from 
      		(
      			select *, lead(d) over (order by d) as x from d1
      		) a
      	where x is null
      	
      	/* null record is returned when treated as a string */
      	select *
      	from 
      		(
      			select *, lead(d) over (order by d) as x from d1
      		) a
      	where x = '[NULL]'
      	
      	drop table d1
      
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              corbin_mdb Corbin Bohne
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.