private Set parseSetCollation() { Set command = new Set(session, SetTypes.COLLATION); String name = readAliasIdentifier(); command.setString(name); if (equalsToken(name, CompareMode.OFF)) { return command; } Collator coll = CompareMode.getCollator(name); if (coll == null) { throw DbException.getInvalidValueException("collation", name); } if (readIf("STRENGTH")) { if (readIf("PRIMARY")) { command.setInt(Collator.PRIMARY); } else if (readIf("SECONDARY")) { command.setInt(Collator.SECONDARY); } else if (readIf("TERTIARY")) { command.setInt(Collator.TERTIARY); } else if (readIf("IDENTICAL")) { command.setInt(Collator.IDENTICAL); } } else { command.setInt(coll.getStrength()); } return command; }
private Prepared parseSet() { if (readIf("@")) { Set command = new Set(session, SetTypes.VARIABLE); command.setString(readAliasIdentifier()); readIfEqualOrTo(); command.setExpression(readExpression()); return command; } else if (readIf("AUTOCOMMIT")) { readIfEqualOrTo(); boolean value = readBooleanSetting(); Set command = new Set(session, SetTypes.IGNORECASE); command.setInt(value ? 1 : 0); return command; } else if (readIf("PASSWORD")) { } else if (readIf("MODE")) { readIfEqualOrTo(); Set command = new Set(session, SetTypes.MODE); command.setString(readAliasIdentifier()); return command; } else if (readIf("DATABASE")) { } else if (readIf("ALLOW_LITERALS")) { readIfEqualOrTo(); Set command = new Set(session, SetTypes.ALLOW_LITERALS); if (readIf("NONE")) { command.setInt(Constants.ALLOW_LITERALS_NONE); } else if (readIf("ALL")) { command.setInt(Constants.ALLOW_LITERALS_ALL);
case SetTypes.ALLOW_LITERALS: { session.getUser().checkAdmin(); int value = getIntValue(); if (value < 0 || value > 2) { throw DbException.getInvalidValueException("ALLOW_LITERALS", getIntValue()); compareMode = CompareMode.getInstance(null, 0, binaryUnsigned); } else { int strength = getIntValue(); buff.append(" STRENGTH "); if (strength == Collator.IDENTICAL) { database.setIgnoreCase(getIntValue() == 1); break; case SetTypes.MAX_MEMORY_ROWS: { if (getIntValue() < 0) { throw DbException.getInvalidValueException("MAX_MEMORY_ROWS", getIntValue()); database.setMaxMemoryRows(getIntValue()); break; if (getIntValue() < 0) { throw DbException.getInvalidValueException("MAX_OPERATION_MEMORY", getIntValue()); int value = getIntValue(); database.setMaxOperationMemory(value); break; if (getIntValue() < 0) {
private Set parseSetBinaryCollation() { Set command = new Set(session, SetTypes.BINARY_COLLATION); String name = readAliasIdentifier(); command.setString(name); if (equalsToken(name, CompareMode.UNSIGNED) || equalsToken(name, CompareMode.SIGNED)) { return command; } throw DbException.getInvalidValueException("BINARY_COLLATION", name); }