public boolean columnMatch(long columnHash) { if (this.column instanceof SQLName) { return ((SQLName) this.column).nameHashCode64() == columnHash; } return false; }
public static boolean nameEquals(SQLName a, SQLName b) { if (a == b) { return true; } if (a == null || b == null) { return false; } return a.nameHashCode64() == b.nameHashCode64(); }
public SQLTableSource findTableSourceWithColumn(long columnNameHash) { for (SQLName column : columns) { if (column.nameHashCode64() == columnNameHash) { return this; } } if (tableSource != null) { return tableSource.findTableSourceWithColumn(columnNameHash); } return null; } }
public SQLParameter findParameter(long hash) { for (SQLParameter param : this.parameters) { if (param.getName().nameHashCode64() == hash) { return param; } } return null; }
public SQLParameter findParameter(long hash) { for (SQLParameter param : this.parameters) { if (param.getName().nameHashCode64() == hash) { return param; } } return null; }
public SQLColumnDefinition findColumn(long columName_hash) { for (SQLTableElement element : tableElementList) { if (element instanceof SQLColumnDefinition) { SQLColumnDefinition column = (SQLColumnDefinition) element; SQLName columnName = column.getName(); if (columnName != null && columnName.nameHashCode64() == columName_hash) { return column; } } } return null; }
protected void declare(SQLDeclareItem x) { if (declares == null) { declares = new HashMap<Long, SQLDeclareItem>(); } declares.put(x.getName().nameHashCode64(), x); }
public boolean acceptDropSequence(SQLDropSequenceStatement x) { String schemaName = x.getSchema(); Schema schema = findSchema(schemaName, true); long nameHashCode64 = x.getName().nameHashCode64(); schema.objects.remove(nameHashCode64); return false; } }
public boolean containsAlias(long aliasHash) { if (this.aliasHashCode64() == aliasHash) { return true; } if (expr instanceof SQLPropertyExpr) { long exprNameHash = ((SQLPropertyExpr) expr).hashCode64(); if (exprNameHash == aliasHash) { return true; } } if (expr instanceof SQLName) { long exprNameHash = ((SQLName) expr).nameHashCode64(); return exprNameHash == aliasHash; } return false; }
public SQLTableSource findTableSource(long alias_hash) { long hash = this.aliasHashCode64(); if (hash != 0 && hash == alias_hash) { return this; } for (SQLName column : columns) { if (column.nameHashCode64() == alias_hash) { return this; } } if (tableSource != null) { return tableSource.findTableSource(alias_hash); } return null; }
public boolean apply(SQLDropIndexStatement x) { long indexNameHashCode64 = x.getIndexName().nameHashCode64(); for (int i = tableElementList.size() - 1; i >= 0; i--) { SQLTableElement e = tableElementList.get(i); if (e instanceof SQLUniqueConstraint) { SQLUniqueConstraint unique = (SQLUniqueConstraint) e; if (unique.getName().nameHashCode64() == indexNameHashCode64) { tableElementList.remove(i); return true; } } else if (e instanceof MySqlTableIndex) { MySqlTableIndex tableIndex = (MySqlTableIndex) e; if (SQLUtils.nameEquals(tableIndex.getName(), x.getIndexName())) { tableElementList.remove(i); return true; } } } return false; }
public SQLTableSource findTableSourceWithColumn(long columnNameHash) { for (SQLName column : columns) { if (column.nameHashCode64() == columnNameHash) { return this; } } if (subQuery != null) { SQLSelectQueryBlock queryBlock = subQuery.getFirstQueryBlock(); if (queryBlock != null) { if (queryBlock.findSelectItem(columnNameHash) != null) { return this; } } } return null; } }
public SQLTableSource findTableSource(long alias_hash) { if (alias_hash == 0) { return null; } if (aliasHashCode64() == alias_hash) { return this; } if (expr instanceof SQLName) { long exprNameHash = ((SQLName) expr).nameHashCode64(); if (exprNameHash == alias_hash) { return this; } } if (expr instanceof SQLPropertyExpr) { long hash = ((SQLPropertyExpr) expr).hashCode64(); if (hash == alias_hash) { return this; } } return null; }
boolean acceptDropTable(SQLDropTableStatement x) { for (SQLExprTableSource table : x.getTableSources()) { String schemaName = table.getSchema(); Schema schema = findSchema(schemaName, false); if (schema == null) { continue; } long nameHashCode64 = table.getName().nameHashCode64(); schema.objects.remove(nameHashCode64); } return true; }
public long nameHashCode64() { if (getTableSource() == null) { return 0L; } return ((SQLName) getTableSource().getExpr()).nameHashCode64(); }
private boolean renameTable(SQLName name, SQLName to) { Schema schema; if (name instanceof SQLPropertyExpr) { String schemaName = ((SQLPropertyExpr) name).getOwnernName(); schema = findSchema(schemaName); } else { schema = getDefaultSchema(); } if (schema == null) { return false; } long nameHashCode64 = name.nameHashCode64(); SchemaObject schemaObject = schema.findTable(nameHashCode64); if (schemaObject != null) { MySqlCreateTableStatement createTableStmt = (MySqlCreateTableStatement) schemaObject.getStatement(); if (createTableStmt != null) { createTableStmt.setName(to.clone()); } schema.objects.put(to.hashCode64(), schemaObject); schema.objects.remove(nameHashCode64); } return true; }
if (schema != null) { table = showColumns.getTable(); schemaObject = schema.findTable(table.nameHashCode64());
final long typeNameHashCode = typeExpr.nameHashCode64(); String typeName = typeExpr.toString();
if (((SQLName) expr).nameHashCode64() == FnvHash.Constants.DUAL) { return false;
long hashCode64 = ((SQLName) orderByExpr).nameHashCode64(); SQLSelectItem selectItem = queryBlock.findSelectItem(hashCode64); if (selectItem == null) {