sapling/bonsai-hg-mapping
Liubov Dmitrieva 022b9164ab make bulk select query code safer
Summary:
as you can test the query like this:

```
select * from demo WHERE `name` IN ()
```

is fine for sqlite but **invalid syntax** in MySql (empty list of value)

the error will be similar to this:

```
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 10000' at line 1; 'select * from phases WHERE repo_id IN () LIMIT 10000'
```

So, such errors are usually shoot in production.

It is better to have the empty check right before calling queries with lists

Reviewed By: lukaspiatkowski

Differential Revision: D13704726

fbshipit-source-id: a9fb3a2e21e88b3af14f57917c2004454eb42531
2019-01-17 02:28:10 -08:00
..
if mononoke: memcache for bonsai_hg_mapping 2018-10-25 02:08:53 -07:00
schemas id for unique (repo_id, hg_cs_id) in mysql schema 2018-07-12 07:21:17 -07:00
src make bulk select query code safer 2019-01-17 02:28:10 -08:00
test mononoke: move RepositoryId into mononoke-types 2018-12-19 10:24:27 -08:00