Skip to content

Commit

Permalink
Update VitessQueryValidator.php (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmagg authored and Scott Sandler committed Aug 17, 2020
1 parent 99951da commit fd16548
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/VitessQueryValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ public function getHandlers(): dict<string, (function(): Awaitable<void>)> {
$table_schema = QueryContext::getSchema($database, $table_name);
$vitess_sharding = $table_schema['vitess_sharding'] ?? null;

if ($vitess_sharding === null) {
throw new SQLFakeVitessQueryViolation(Str\format('Missing Vitess sharding information for: %s', $table_name));
}
if ($vitess_sharding === null) {
// This could either be an unsharded table or a misconfiguration.
// Either way, no sharding config to validate, so let's skip it.
return;
}

$columns = VitessQueryValidator::extractColumnExprNames($set);

Expand Down

0 comments on commit fd16548

Please sign in to comment.