Skip to content

wrong hasLimitClause logic #1

Closed

Description

@Slach
{
  `query`: `
select 
    toStartOfMinute(event_time) as minute,
    type,
    exception_code,
    exception,
    query_kind,
    count() as query_count,
    avg(query_duration_ms) as avg_duration_ms,
    max(query_duration_ms) as max_duration_ms,
    sum(read_rows) as total_read_rows,
    sum(read_bytes) as total_read_bytes
from system.query_log
where event_time >= today() + interval 5 hour
  and event_time < today() + interval 6 hour
  and type != 'QueryStart'
  and exception_code != 0
group by minute, type, exception_code, exception, query_kind
order by minute, query_count desc
limit 100
`
}

func hasLimitClause(query string) bool {
upper := strings.ToUpper(query)
return strings.Contains(upper, " LIMIT ")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions