Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.38.0
    • None

    Description

      Implement bit_count function

      MySQL BIT_COUNT: https://dev.mysql.com/doc/refman/8.4/en/bit-functions.html#bit-operations-bit-count

       

      Examples:

       

      Expression Result
      bitcount(0) 0
      bitcount(1) 1
      bitcount(39) 4
      bitcount(cast(x'ad') as BINARY(1))) 5
      bitcount(-1) 64

       

       

      MySQL will handle decimal values as unsigned long values. For decimal values, only the integer portion is examined.

       

      Expression Result
      bit_count(5.23) 2
      bit_count(18446744073709551615) 64
      bit_count(18446744073709551616) 63
      bit_count(18446744073709551617) 63
      bit_count(-9223372036854775808) 1
      bit_count(-9223372036854775809) 1

       

       

      Attachments

        Issue Links

          Activity

            People

              x1q1j1 Forward Xu
              x1q1j1 Forward Xu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m