smi2 / phpClickHouse

php ClickHouse wrapper
MIT License
750 stars 139 forks source link

Critical errror with insert. #201

Open sokolx1 opened 11 months ago

sokolx1 commented 11 months ago

(https://github.com/smi2/phpClickHouse/blob/master/src/Quote/StrictQuoteLine.php) on line 62 you guys use 'implode' function to generate SQL request to database. The trouble is that implode(',', [false, true]) returns ",1" because implode just ignores "false".

The typical consequence of this trouble is that:

$data = [ [
  "archived" => false
  "getter_stats_id" => 59
  "is_discounted" => false
  "is_fbo_visible" => true
  "is_fbs_visible" => true
  "offer_id" => "hrb-0035c001"
  "product_id" => 191868145
  "shop_id" => 2
] ];
$db->InsertAssocBulk($table, $data)

Cannot parse expression of type Bool here: ,56,,1,1,'hrb-0035c001',191868145,2): While executing ValuesBlockInputFormat. (SYNTAX_ERROR) IN:INSERT INTO raw_ozon_products_list (archived,getter_stats_id,is_discounted,is_fbo_visible,is_fbs_visible,offer_id ,product_id,shop_id) VALUES (,56,,1,1,'hrb-0035c001',191868145,2)

MakarMS commented 10 months ago

Hi, I am facing a similar problem. Waiting for my pull request to be approved https://github.com/MakarMS/phpClickHouse/commit/c8c90068d0d999efcf42cfbc90548896bee75d5c

MakarMS commented 9 months ago

A fix has been made

isublimity commented 9 months ago

Can I close this task?