Skip to content

wrong result for numeric and positional parameters check in query #935

Open
@dobergerator

Description

@dobergerator

When I build a request similar to this one

select
my_other_field
from
my_other_table
where
toString((joinGet('my_db.my_table', 'my_field', cityHash64(lower(my_string_value))) as m_s_v) ? 'my_string_data' : '') <> $1

Driver returns "clickhouse [bind]: mixed named, numeric or positional parameters" and doesn't send query to Clickhouse, because of the check in bind() function

var bindNumericRe = regexp.MustCompile($[0-9]+)
var bindPositionalRe = regexp.MustCompile([^\\][?])

But if I send request with a CLI clickhouse-client, query works and returns data

Is it possible to fix this problem?

Environment

  • Client version: 2.4.3
  • Language version: English
  • OS: Linux
  • Interface: ClickHouse API / database/sql compatible driver

ClickHouse server

  • ClickHouse Server version: 22.1.3.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions