workaround sqlite bug + more kind for mysql