/ Ticket Change Details
Login
Overview

Artifact ID: 419e98d5f5ceb62153429e772af7f0d3a6bf9a049be4e45a35316e7bf335f6b6
Ticket: c4130c33be081b2e75e8eb12b623ff6b67752ed0
DISTINCT malfunctions for VIEW
User & Date: drh 2019-09-10 19:46:38
Changes

  1. icomment:
    0 is not distinct from 0.0 since (0 IS 0.0) IS TRUE.  So the query
    
    <blockquote><verbatim>
    SELECT DISTINCT * FROM (VALUES(0),(0.0));
    </verbatim></blockquote>
    
    Is free to return either 0 or 0.0.  The choice is arbitrary.  It is analogous
    to a SELECT with a "LIMIT 1" and without an ORDER BY clause in that the query
    is free to return any single row that it wants.
    
    If the query decides to return 0, then 0||0.1 is a string '00.1' which
    evaluates to TRUE.  If the query decides to return 0.0, then 0.0||0.1 is 
    a string '0.00.1' which evaluates to false.  So the other queries in the
    original problem statement are free to return either result depending on
    which value comes out of the ambiguous view.
    
  2. login: "drh"
  3. mimetype: "text/x-fossil-wiki"
  4. priority changed to: "Immediate"
  5. resolution changed to: "Not_A_Bug"
  6. status changed to: "Closed"
  7. subsystem changed to: "Unknown"