提交 7108c22b authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Remove useless case in CommandRemote and detect internal errors in GeneratedKeysMode

上级 48d40b2f
......@@ -216,9 +216,6 @@ public class CommandRemote implements CommandInterface {
int mode = GeneratedKeysMode.valueOf(generatedKeysRequest);
transfer.writeInt(mode);
switch (mode) {
case GeneratedKeysMode.NONE:
readGeneratedKeys = false;
break;
case GeneratedKeysMode.COLUMN_NUMBERS: {
int[] keys = (int[]) generatedKeysRequest;
transfer.writeInt(keys.length);
......
......@@ -5,6 +5,9 @@
*/
package org.h2.engine;
import org.h2.api.ErrorCode;
import org.h2.message.DbException;
/**
* Modes of generated keys' gathering.
*/
......@@ -54,7 +57,8 @@ public final class GeneratedKeysMode {
if (generatedKeysRequest instanceof String[]) {
return COLUMN_NAMES;
}
return NONE;
throw DbException.get(ErrorCode.INVALID_VALUE_2,
generatedKeysRequest == null ? "null" : generatedKeysRequest.toString());
}
private GeneratedKeysMode() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论