Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-20767

PostgreSQL fails with binary 'and' operator's result used as a boolean value

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 5.1
    • None
    • None
    • None

    Description

      While is is ok with some RDBMs to use the result of a binary operator (&) as a boolean value like:

      WHERE (lang_mask & 4)
      

      this is unfortunately not portable, especially on PostgreSQL which doesn't convert integers as booleans.
      For this reason, the portable way to do this is:

      WHERE (lang_mask & 4) > 0
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            patrick.allaert-obsolete@ez.no Patrick Allaert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 4 hours, 30 minutes
                1d 4h 30m