зеркало из https://github.com/github/vitess-gh.git
d8b897afb0
I found a few problems and shortcomings in the mocks: 1. A lock was being held while connecting to mysql, which should be avoided. 3. Tests depended on a global variable (DefaultDB) being initialized to different values at the beginning of each test. This would prevent parallelization. 2. There was no way to use a real mysql connection in tests once a fakesqldb was setup, which is needed for the queryservice tests to be ported to go. In the new scheme, I've added an Engine field to ConnParams. If it's empty, then the default (MySQL) connection is used without locks. If there is a name, then we use the map where other test engines are registered. The next change will convert the memcache faking to a similar scheme. |
||
---|---|---|
.. | ||
proto | ||
mysql.go | ||
vtmysql.c | ||
vtmysql.h | ||
vtmysql_internals.h |