Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2105

Changing order of tables in from clause causing "Expected length of at least 8 bytes, but had 1"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.4.0
    • Component/s: None
    • Labels:
      None

      Description

      Today I came across the following issue with the query below. The query fails with the following error. However if you change the order of the inline query and 'profiler.sample sample' line, the query works fine. I don't think the order should matter.

      Error: ERROR 201 (22000): Illegal data. Expected length of at least 8 bytes, but had 1
      SQLState: 22000
      ErrorCode: 201

      select
      sample.stack_id,
      count
      from
      (
      select
      distinct s.id
      from
      profiler.frame f,
      profiler.stack s
      where
      f.package = 'foo' and
      f.class = 'Bar' and
      f.method = 'baz()' and
      f.id = s.frame_id
      ) s,
      profiler.sample sample
      where
      sample.timestamp between 0 and 9999999999999999 and
      sample.stack_id = s.id
      group by
      sample.stack_id;

        Attachments

        1. repro.sql
          2 kB
          Brian Toal

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              btoal Brian Toal
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: