conflict_resolution
stringlengths
27
16k
<<<<<<< private ArrayList<Location> points; private ArrayList<BitWidth> widths; public WidthIncompatibilityData() { points = new ArrayList<Location>(); widths = new ArrayList<BitWidth>(); } public void add(Location p, BitWidth w) { for (int i = 0; i < points.size(); i++) { if (p.equals(points.get(i)) && w.equals(widths.get(i))) { return; } } points.add(p); widths.add(w); } public int size() { return points.size(); } public Location getPoint(int i) { return points.get(i); } public BitWidth getBitWidth(int i) { return widths.get(i); } @Override public boolean equals(Object other) { if (!(other instanceof WidthIncompatibilityData)) { return false; } if (this == other) { return true; } WidthIncompatibilityData o = (WidthIncompatibilityData) other; if (this.size() != o.size()) { return false; } for (int i = 0; i < this.size(); i++) { Location p = this.getPoint(i); BitWidth w = this.getBitWidth(i); boolean matched = false; for (int j = 0; j < o.size(); j++) { Location q = this.getPoint(j); BitWidth x = this.getBitWidth(j); if (p.equals(q) && w.equals(x)) { { matched = true; } break; } } if (!matched) { return false; } } return true; } ======= private ArrayList<Location> points; private ArrayList<BitWidth> widths; public WidthIncompatibilityData() { points = new ArrayList<Location>(); widths = new ArrayList<BitWidth>(); } public void add(Location p, BitWidth w) { for (int i = 0; i < points.size(); i++) { if (p.equals(points.get(i)) && w.equals(widths.get(i))) return; } points.add(p); widths.add(w); } public int size() { return points.size(); } public Location getPoint(int i) { return points.get(i); } public BitWidth getBitWidth(int i) { return widths.get(i); } @Override public int hashCode() { return this.size(); } @Override public boolean equals(Object other) { if (!(other instanceof WidthIncompatibilityData)) return false; if (this == other) return true; WidthIncompatibilityData o = (WidthIncompatibilityData) other; if (this.size() != o.size()) return false; for (int i = 0; i < this.size(); i++) { Location p = this.getPoint(i); BitWidth w = this.getBitWidth(i); boolean matched = false; for (int j = 0; j < o.size(); j++) { Location q = this.getPoint(j); BitWidth x = this.getBitWidth(j); if (p.equals(q) && w.equals(x)) { matched = true; break; } } if (!matched) return false; } return true; } >>>>>>> private ArrayList<Location> points; private ArrayList<BitWidth> widths; public WidthIncompatibilityData() { points = new ArrayList<Location>(); widths = new ArrayList<BitWidth>(); } public void add(Location p, BitWidth w) { for (int i = 0; i < points.size(); i++) { if (p.equals(points.get(i)) && w.equals(widths.get(i))) { return; } } points.add(p); widths.add(w); } public int size() { return points.size(); } public Location getPoint(int i) { return points.get(i); } public BitWidth getBitWidth(int i) { return widths.get(i); } @Override public int hashCode() { return this.size(); } @Override public boolean equals(Object other) { if (!(other instanceof WidthIncompatibilityData)) { return false; } if (this == other) { return true; } WidthIncompatibilityData o = (WidthIncompatibilityData) other; if (this.size() != o.size()) { return false; } for (int i = 0; i < this.size(); i++) { Location p = this.getPoint(i); BitWidth w = this.getBitWidth(i); boolean matched = false; for (int j = 0; j < o.size(); j++) { Location q = this.getPoint(j); BitWidth x = this.getBitWidth(j); if (p.equals(q) && w.equals(x)) { { matched = true; } break; } } if (!matched) { return false; } } return true; }
<<<<<<< private final Box box; private RenderingContext ctx; private final double dotsPerPixel; ======= private boolean allowScripts = false; private boolean allowExternalResources = false; >>>>>>> private final Box box; private RenderingContext ctx; private final double dotsPerPixel; private boolean allowScripts = false; private boolean allowExternalResources = false;
<<<<<<< @Override public Collection<CanvasObject> getObjects() { HashSet<CanvasObject> ret = new HashSet<CanvasObject>(); for (AttributeMapKey key : newValues.keySet()) { ret.add(key.getObject()); } return ret; } @Override public String getName() { Attribute<?> a = attr; if (a == null) { boolean found = false; for (AttributeMapKey key : newValues.keySet()) { Attribute<?> at = key.getAttribute(); if (found) { if (a == null ? at != null : !a.equals(at)) { { a = null; } break; } } else { found = true; a = at; } } attr = a; } if (a == null) { return _("actionChangeAttributes"); } else { return _("actionChangeAttribute", a.getDisplayName()); } } @Override void doSub(CanvasModel model) { model.setAttributeValues(newValues); } @Override void undoSub(CanvasModel model) { model.setAttributeValues(oldValues); } ======= @Override public String getName() { Attribute<?> a = attr; if (a == null) { boolean found = false; for (AttributeMapKey key : newValues.keySet()) { Attribute<?> at = key.getAttribute(); if (found) { if (a == null ? at != null : !a.equals(at)) { a = null; break; } } else { found = true; a = at; } } attr = a; } if (a == null) { return _("actionChangeAttributes"); } else { return _("actionChangeAttribute", a.getDisplayName()); } } @Override void doSub(CanvasModel model) { model.setAttributeValues(newValues); } @Override void undoSub(CanvasModel model) { model.setAttributeValues(oldValues); } >>>>>>> @Override public Collection<CanvasObject> getObjects() { HashSet<CanvasObject> ret = new HashSet<CanvasObject>(); for (AttributeMapKey key : newValues.keySet()) { ret.add(key.getObject()); } return ret; } @Override public String getName() { Attribute<?> a = attr; if (a == null) { boolean found = false; for (AttributeMapKey key : newValues.keySet()) { Attribute<?> at = key.getAttribute(); if (found) { if (a == null ? at != null : !a.equals(at)) { a = null; break; } } else { found = true; a = at; } } attr = a; } if (a == null) { return _("actionChangeAttributes"); } else { return _("actionChangeAttribute", a.getDisplayName()); } } @Override void doSub(CanvasModel model) { model.setAttributeValues(newValues); } @Override void undoSub(CanvasModel model) { model.setAttributeValues(oldValues); }
<<<<<<< public void setThemesList(String themes) { if (themes != null && !themes.isEmpty()) { this.themes = themes.split(","); } } public String[] getThemesList() { return themes; } ======= public Boolean getWeeklyDigest() { return weeklyDigest; } public void setWeeklyDigest(Boolean weeklyDigest) { this.weeklyDigest = weeklyDigest; } public Boolean getDailyDigest() { return dailyDigest; } public void setDailyDigest(Boolean dailyDigest) { this.dailyDigest = dailyDigest; } >>>>>>> public void setThemesList(String themes) { if (themes != null && !themes.isEmpty()) { this.themes = themes.split(","); } } public String[] getThemesList() { return themes; } public Boolean getWeeklyDigest() { return weeklyDigest; } public void setWeeklyDigest(Boolean weeklyDigest) { this.weeklyDigest = weeklyDigest; } public Boolean getDailyDigest() { return dailyDigest; } public void setDailyDigest(Boolean dailyDigest) { this.dailyDigest = dailyDigest; }
<<<<<<< import de.fhg.iais.roberta.factory.BotNrollFactory; import de.fhg.iais.roberta.util.test.Helper; ======= import de.fhg.iais.roberta.util.test.ardu.Helper; >>>>>>> import de.fhg.iais.roberta.factory.BotNrollFactory; import de.fhg.iais.roberta.util.test.ardu.Helper; <<<<<<< BotNrollFactory robotFactory = new BotNrollFactory(null); @Before public void setUp() throws Exception { this.h.setRobotFactory(this.robotFactory); } ======= >>>>>>> BotNrollFactory robotFactory = new BotNrollFactory(null); @Before public void setUp() throws Exception { this.h.setRobotFactory(this.robotFactory); }
<<<<<<< import java.net.URISyntaxException; ======= import java.util.ArrayList; >>>>>>> import java.net.URISyntaxException; import java.util.ArrayList; <<<<<<< PgDatabase db = PgUIDumpLoader.loadDatabaseSchemaFromIProject( ======= List<AntlrError> er = new ArrayList<>(); PgDatabase db = PgUIDumpLoader.loadDatabaseSchemaFromIProject( >>>>>>> List<AntlrError> er = new ArrayList<>(); PgDatabase db = PgUIDumpLoader.loadDatabaseSchemaFromIProject( <<<<<<< monitor, null, errors); try { DBTimestamp.updateObjects(db, FileUtilsUi.getPathToTimeObject(project.getName())); } catch (URISyntaxException e) { Log.log(Log.LOG_ERROR, "Error updating project timestamps", e); } return db; ======= monitor, null, er); errors = er; return db; >>>>>>> monitor, null, er); errors = er; try { DBTimestamp.updateObjects(db, FileUtilsUi.getPathToTimeObject(project.getName())); } catch (URISyntaxException e) { Log.log(Log.LOG_ERROR, "Error updating project timestamps", e); } return db; <<<<<<< return new JdbcLoader(jdbcConnector, getArgs(), monitor).getDbFromJdbc(); ======= PgDiffArguments args = getPgDiffArgs(ApgdiffConsts.UTF_8, forceUnixNewlines); JdbcLoader loader = new JdbcLoader(jdbcConnector, args, monitor); PgDatabase database = loader.getDbFromJdbc(); errors = loader.getErrors(); return database; >>>>>>> JdbcLoader loader = new JdbcLoader(jdbcConnector, getArgs(), monitor); PgDatabase database = loader.getDbFromJdbc(); errors = loader.getErrors(); return database;
<<<<<<< public static Iterable<Object[]> parameters() { List<Object[]> p = Arrays.asList(new Object[][] { { "empty", "empty_usr" }, ======= public static Collection<?> parameters() { return Arrays.asList(new Object[][] { {"empty_usr"}, >>>>>>> public static Iterable<Object[]> parameters() { List<Object[]> p = Arrays.asList(new Object[][] { {"empty_usr"}, <<<<<<< {"chg_fts_statements", "chg_fts_statements_usr_configuration"}, //добавление агрегатов с зависимыми от них функциями, ======= {"chg_fts_statements_usr_configuration"}, // добавление агрегатов с зависимыми от них функциями, >>>>>>> {"chg_fts_statements_usr_configuration"}, // добавление агрегатов с зависимыми от них функциями, <<<<<<< {"add_aggr_func", "add_aggr_func_usr_aggr"}, // в функции 'f1' изменяется имя аргумента функции, // в функции 'f2' изменяется определение функции, // пользователь выбирает 'f1' // (опеределение обеих функций написано на языке SQL) // ('f2' зависит от 'f1') { "change_func_arg_name", "change_func_arg_name_usr_f1", true}, // в функции 'f1' изменяется имя аргумента функции, // в функции 'f2' изменяется определение функции, // пользователь выбирает 'f1' // (опеределение обеих функций написано на языке SQL) // ('f2' зависит от 'f1') // (обе функции находятся в разных схемах) { "change_func_arg_name_sch", "change_func_arg_name_sch_usr_f1", true}, ======= {"add_aggr_func_usr_aggr"}, >>>>>>> {"add_aggr_func_usr_aggr"}, // в функции 'f1' изменяется имя аргумента функции, // в функции 'f2' изменяется определение функции, // пользователь выбирает 'f1' // (опеределение обеих функций написано на языке SQL) // ('f2' зависит от 'f1') {"change_func_arg_name_usr_f1", true}, // в функции 'f1' изменяется имя аргумента функции, // в функции 'f2' изменяется определение функции, // пользователь выбирает 'f1' // (опеределение обеих функций написано на языке SQL) // ('f2' зависит от 'f1') // (обе функции находятся в разных схемах) {"change_func_arg_name_sch_usr_f1", true}, <<<<<<< {"chg_col_type_dep_from_func", "chg_col_type_dep_from_func_usr_tbl"} ======= {"chg_col_type_dep_from_func_usr_tbl"}, // изменение типа и дефолтного значения колонки родительской и дочерней таблицы // пользователь выбрал таблицу дочернюю таблицу {"chg_inherit_col_usr_child"}, // изменение типа и дефолтного значения колонки родительской и дочерней таблицы // пользователь выбрал таблицу родительскую таблицу {"chg_inherit_col_usr_parent"}, >>>>>>> {"chg_col_type_dep_from_func_usr_tbl"}, // изменение типа и дефолтного значения колонки родительской и дочерней таблицы // пользователь выбрал таблицу дочернюю таблицу {"chg_inherit_col_usr_child"}, // изменение типа и дефолтного значения колонки родительской и дочерней таблицы // пользователь выбрал таблицу родительскую таблицу {"chg_inherit_col_usr_parent"}, <<<<<<< final PgDiffArguments args = new PgDiffArguments(); public PgDiffDepciesTest(final String fileNameTemplate, final String userSelTemplate, Boolean isEnableDepcies) { this.dbTemplate = fileNameTemplate; ======= public PgDiffDepciesTest(final String userSelTemplate) { this.dbTemplate = userSelTemplate.replaceAll("_usr.*", ""); >>>>>>> final PgDiffArguments args = new PgDiffArguments(); public PgDiffDepciesTest(final String userSelTemplate, Boolean isEnableDepcies) { this.dbTemplate = userSelTemplate.replaceAll("_usr.*", "");
<<<<<<< private PgSchema getSchema(ResultSet res) throws SQLException{ String schemaName = res.getString(NAMESPACE_NSPNAME); ======= private PgSchema getSchema(ResultSet res) throws SQLException, UnsupportedEncodingException{ String schemaName = res.getString("nspname"); >>>>>>> private PgSchema getSchema(ResultSet res) throws SQLException, UnsupportedEncodingException{ String schemaName = res.getString(NAMESPACE_NSPNAME); <<<<<<< String tableName = res.getString(CLASS_RELNAME); ======= String tableName = res.getString("relname"); String tableOwner = getRoleNameByOid(res.getLong("relowner")); >>>>>>> String tableName = res.getString(CLASS_RELNAME); String tableOwner = getRoleNameByOid(res.getLong(CLASS_RELOWNER)); <<<<<<< t.setOwner(getRoleNameByOid(res.getLong(CLASS_RELOWNER))); setPrivileges(t, t.getName(), res.getString("aclarray"), t.getOwner()); ======= t.setOwner(tableOwner); setPrivileges(t, t.getName(), res.getString("aclarray"), t.getOwner(), null); // COLUMNS PRIVILEGES String[] colAcl = (String[])res.getArray("col_acl").getArray(); for (int i = 0; i < colNumbers.length; i++) { String columnPrivileges = colAcl[i]; if (columnPrivileges != null && !columnPrivileges.isEmpty()){ setPrivileges(t, tableName, columnPrivileges, tableOwner, colNames[i]); } } >>>>>>> t.setOwner(tableOwner); setPrivileges(t, t.getName(), res.getString("aclarray"), t.getOwner(), null); // COLUMNS PRIVILEGES String[] colAcl = (String[])res.getArray("col_acl").getArray(); for (int i = 0; i < colNumbers.length; i++) { String columnPrivileges = colAcl[i]; if (columnPrivileges != null && !columnPrivileges.isEmpty()){ setPrivileges(t, tableName, columnPrivileges, tableOwner, colNames[i]); } } <<<<<<< String functionName = res.getString("proname").concat("()"); if (!res.getString(NAMESPACE_NSPNAME).equals(schemaName)){ functionName = res.getString(NAMESPACE_NSPNAME).concat(".").concat(functionName); ======= String functionName = res.getString("proname").concat("("); byte[] args = res.getBytes("tgargs"); if (res.getBytes("tgargs").length > 0){ ArrayList<Byte> target = new ArrayList<Byte>(args.length); for(int i = 0; i < args.length; i++){ byte b = args[i]; if (b == 0 && i < args.length - 1){ target.add((byte) 39); // APOSTROPHE target.add((byte) 44); // COMMA target.add((byte) 32); // SPACE target.add((byte) 39); // APOSTROPHE }else if (b != 0){ target.add(b); } } target.add(0, (byte) 39); target.add((byte) 39); args = new byte[target.size()]; for(int i = 0; i < target.size(); i++){ args[i] = target.get(i); } functionName = functionName.concat(new String(args, encoding)); } functionName = functionName.concat(")"); if (!res.getString("nspname").equals(schemaName)){ functionName = res.getString("nspname").concat(".").concat(functionName); >>>>>>> String functionName = res.getString("proname").concat("("); byte[] args = res.getBytes("tgargs"); if (res.getBytes("tgargs").length > 0){ ArrayList<Byte> target = new ArrayList<Byte>(args.length); for(int i = 0; i < args.length; i++){ byte b = args[i]; if (b == 0 && i < args.length - 1){ target.add((byte) 39); // APOSTROPHE target.add((byte) 44); // COMMA target.add((byte) 32); // SPACE target.add((byte) 39); // APOSTROPHE }else if (b != 0){ target.add(b); } } target.add(0, (byte) 39); target.add((byte) 39); args = new byte[target.size()]; for(int i = 0; i < target.size(); i++){ args[i] = target.get(i); } functionName = functionName.concat(new String(args, connector.getEncoding())); } functionName = functionName.concat(")"); if (!res.getString(NAMESPACE_NSPNAME).equals(schemaName)){ functionName = res.getString(NAMESPACE_NSPNAME).concat(".").concat(functionName);
<<<<<<< ======= import cz.startnet.utils.pgdiff.DangerStatement; import cz.startnet.utils.pgdiff.loader.JdbcConnector; import cz.startnet.utils.pgdiff.loader.JdbcRunner; import cz.startnet.utils.pgdiff.schema.PgObjLocation; import cz.startnet.utils.pgdiff.schema.StatementActions; import ru.taximaxim.codekeeper.apgdiff.ApgdiffConsts; import ru.taximaxim.codekeeper.apgdiff.ApgdiffConsts.JDBC_CONSTS; import ru.taximaxim.codekeeper.apgdiff.fileutils.TempFile; import ru.taximaxim.codekeeper.apgdiff.licensing.LicenseException; import ru.taximaxim.codekeeper.apgdiff.model.difftree.DbObjType; import ru.taximaxim.codekeeper.ui.Activator; import ru.taximaxim.codekeeper.ui.IPartAdapter2; >>>>>>> import cz.startnet.utils.pgdiff.DangerStatement; import cz.startnet.utils.pgdiff.loader.JdbcConnector; import cz.startnet.utils.pgdiff.loader.JdbcRunner; import cz.startnet.utils.pgdiff.schema.PgObjLocation; import cz.startnet.utils.pgdiff.schema.StatementActions; import ru.taximaxim.codekeeper.apgdiff.ApgdiffConsts; import ru.taximaxim.codekeeper.apgdiff.ApgdiffConsts.JDBC_CONSTS; import ru.taximaxim.codekeeper.apgdiff.fileutils.TempFile; import ru.taximaxim.codekeeper.apgdiff.model.difftree.DbObjType; import ru.taximaxim.codekeeper.ui.Activator; import ru.taximaxim.codekeeper.ui.IPartAdapter2; <<<<<<< throws InterruptedException, IOException, CoreException { if (res instanceof IFile) { ======= throws InterruptedException, IOException, LicenseException, CoreException { if (res instanceof IFile && res.getProject().hasNature(NATURE.ID)) { >>>>>>> throws InterruptedException, IOException, CoreException { if (res instanceof IFile && res.getProject().hasNature(NATURE.ID)) {
<<<<<<< public void addPrivilegeScript(PgStatement oldObj, PgStatement newObj, StringBuilder sb){ // находим список старых и новых GRAND и соответственно удоляем их или удаляем if (!oldObj.getGrants().equals(newObj.getGrants())){ Set<PgPrivilege> oldGrands = new LinkedHashSet<>(oldObj.getGrants()); Set<PgPrivilege> newGrands = new LinkedHashSet<>(newObj.getGrants()); oldGrands.removeAll(newObj.getGrants()); //список удаленный грандов newGrands.removeAll(oldObj.getGrants()); //список добавленных грандов for (PgPrivilege priv : oldGrands){ sb.append(priv.getDropSQL()); } for (PgPrivilege priv : oldGrands){ sb.append(priv.getCreationSQL()); } } /* if (!oldTable.getGrants().equals(newTable.getGrants()) || !oldTable.getRevokes().equals(newTable.getRevokes())) { sb.append(newTable.getPrivilegesSQL()); }*/ } ======= public List<GenericColumn> getDeps() { return deps; } public void setDeps(List<GenericColumn> deps) { this.deps = deps; } public void addDep(GenericColumn newDep){ this.deps.add(newDep); } //TODO public void removeDep(){ } >>>>>>> public void addPrivilegeScript(PgStatement oldObj, PgStatement newObj, StringBuilder sb){ // находим список старых и новых GRAND и соответственно удоляем их или удаляем if (!oldObj.getGrants().equals(newObj.getGrants())){ Set<PgPrivilege> oldGrands = new LinkedHashSet<>(oldObj.getGrants()); Set<PgPrivilege> newGrands = new LinkedHashSet<>(newObj.getGrants()); oldGrands.removeAll(newObj.getGrants()); //список удаленный грандов newGrands.removeAll(oldObj.getGrants()); //список добавленных грандов for (PgPrivilege priv : oldGrands){ sb.append(priv.getDropSQL()); } for (PgPrivilege priv : oldGrands){ sb.append(priv.getCreationSQL()); } } } public List<GenericColumn> getDeps() { return deps; } public void setDeps(List<GenericColumn> deps) { this.deps = deps; } public void addDep(GenericColumn newDep){ this.deps.add(newDep); } //TODO public void removeDep(){ }
<<<<<<< import ru.taximaxim.codekeeper.ui.Log; ======= import ru.taximaxim.codekeeper.ui.AddonPrefLoader; >>>>>>> import ru.taximaxim.codekeeper.ui.Log; import ru.taximaxim.codekeeper.ui.AddonPrefLoader;
<<<<<<< import java.util.concurrent.atomic.AtomicBoolean; ======= import java.util.Set; >>>>>>> import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean;
<<<<<<< loader.setMode(ParserListenerMode.REF); PgDatabase intoDb = new PgDatabase(); intoDb.setArguments(args); PgDatabase db = loader.loadFile(intoDb); ======= loader.setRefMode(true); PgDatabase db = loader.loadFile(new PgDatabase(args)); removeResFromRefs(file); >>>>>>> loader.setMode(ParserListenerMode.REF); PgDatabase db = loader.loadFile(new PgDatabase(args)); removeResFromRefs(file); <<<<<<< loader.setMode(ParserListenerMode.REF); PgDatabase db = loader.load(); ======= loader.setRefMode(true); PgDatabase db = loader.load(new PgDatabase(args)); objDefinitions.clear(); >>>>>>> loader.setMode(ParserListenerMode.REF); PgDatabase db = loader.load(new PgDatabase(args)); objDefinitions.clear();
<<<<<<< lblRepoRoot.setText("Select Git repository root directory (either empty folder or existing repository)"); ======= lblRepoRoot.setText("Select GIT repository root directory " + "(either empty folder or existing repository)"); >>>>>>> lblRepoRoot.setText("Select Git repository root directory " + "(either empty folder or existing repository)"); <<<<<<< } else if (getRepoRootPath().isEmpty() || !new File(getRepoRootPath()).isDirectory()) { errMsg = "Select repo root directory!"; } else if (!JGitExec.isGitRepo(getRepoRootPath()) && new File(txtRepoRoot.getText()).list().length != 0) { errMsg = "Selected directory must be empty or be a root directory of" + " existing git repository (must contain .git subdirectory)"; } else if (getProjectFile().isEmpty() || !getProjectFile().endsWith(UIConsts.FILENAME_PROJ_PREF_STORE)) { ======= } else if (txtRepoRoot.getText().isEmpty() || !new File(txtRepoRoot.getText()).isDirectory()) { errMsg = "Select Project Directory!"; }else if (!JGitExec.isGitRepo(getRepoRootPath()) && new File(txtRepoRoot.getText()).list().length != 0){ errMsg = "Selected directory should be either empty or root directory of\n" + " existing git repository (should contain .git subdirectory)"; }else if(getProjectFile().isEmpty() || !getProjectFile().endsWith(UIConsts.FILENAME_PROJ_PREF_STORE)){ >>>>>>> } else if (getRepoRootPath().isEmpty() || !new File(getRepoRootPath()).isDirectory()) { errMsg = "Select repo root directory!"; } else if (!JGitExec.isGitRepo(getRepoRootPath()) && new File(txtRepoRoot.getText()).list().length != 0) { errMsg = "Selected directory must be empty or be a root directory of" + " existing git repository (must contain .git subdirectory)"; } else if (getProjectFile().isEmpty() || !getProjectFile().endsWith(UIConsts.FILENAME_PROJ_PREF_STORE)) { <<<<<<< lblWarnInit.setImage(lrm.createImage(ImageDescriptor .createFromURL(Activator.getContext().getBundle() .getResource(UIConsts.FILENAME_ICONWARNING)))); lblWarnInit.setText("Warning:\n" + "This will delete repo contents and recreate them " + "from Schema Source (next page)."); ======= lblWarnInit.setImage(lrm.createImage(ImageDescriptor.createFromURL( Activator.getContext().getBundle().getResource(UIConsts.FILENAME_ICONWARNING)))); lblWarnInit.setText("Warning:\n" + "This will delete repo contents and recreate them from Schema Source" + " (next page)."); >>>>>>> lblWarnInit.setImage(lrm.createImage(ImageDescriptor .createFromURL(Activator.getContext().getBundle() .getResource(UIConsts.FILENAME_ICONWARNING)))); lblWarnInit.setText("Warning:\n" + "This will delete repo contents and recreate them " + "from Schema Source (next page)."); <<<<<<< lblRepoSubdir.setText("Select a directory inside the repository," + " that will contain DB schemas and constraints\n" + "(leave unchanged to use root)"); ======= lblRepoSubdir.setText("Point to a directory inside the repository, " + "that will contain DB schemas and constraints\n" + "(leave unchanged to use root)"); >>>>>>> lblRepoSubdir.setText("Select a directory inside the repository," + " that will contain DB schemas and constraints\n" + "(leave unchanged to use root)");
<<<<<<< return new Pair<>(parser, parser.sql()); ======= saveTimeOfLastParserStart(false); return parser.sql(); >>>>>>> saveTimeOfLastParserStart(false); return new Pair<>(parser, parser.sql());
<<<<<<< TypedPgTable table = new TypedPgTable(tableName, getTypeName(typeName)); fillTypeColumns(typeCtx.list_of_type_column_def(), table, schemaName, tablespace); addTypeAsDepcy(typeName, table, getDefSchemaName()); ======= String ofType = getTypeName(typeName); TypedPgTable table = new TypedPgTable(tableName, ofType); fillTypeColumns(typeCtx.list_of_type_column_def(), table, schemaName); addPgTypeDepcy(typeName, table); >>>>>>> String ofType = getTypeName(typeName); TypedPgTable table = new TypedPgTable(tableName, ofType); fillTypeColumns(typeCtx.list_of_type_column_def(), table, schemaName, tablespace); addPgTypeDepcy(typeName, table);
<<<<<<< import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; ======= import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; >>>>>>> import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; <<<<<<< protected String signatureCache; ======= public static final String FROM_CURRENT = "FROM CURRENT"; protected static final float DEFAULT_PROCOST = 100.0f; protected static final float DEFAULT_PROROWS = 1000.0f; private float cost = DEFAULT_PROCOST; private float rows = DEFAULT_PROROWS; private boolean isWindow; private boolean isStrict; private boolean isLeakproof; private boolean isSecurityDefiner; private String language; private String parallel; private String volatileType; private String body; private String returns; protected final List<String> options = new ArrayList<>(); protected final List<Argument> arguments = new ArrayList<>(); protected final List<String> transforms = new ArrayList<>(); protected final Map<String, String> configurations = new LinkedHashMap<>(); protected final Map<String, String> returnsColumns = new LinkedHashMap<>(); private String signatureCache; >>>>>>> public static final String FROM_CURRENT = "FROM CURRENT"; protected static final float DEFAULT_PROCOST = 100.0f; protected static final float DEFAULT_PROROWS = 1000.0f; private float cost = DEFAULT_PROCOST; private float rows = DEFAULT_PROROWS; private boolean isWindow; private boolean isStrict; private boolean isLeakproof; private boolean isSecurityDefiner; private String language; private String parallel; private String volatileType; private String body; private String returns; protected final List<String> options = new ArrayList<>(); protected final List<Argument> arguments = new ArrayList<>(); protected final List<String> transforms = new ArrayList<>(); protected final Map<String, String> configurations = new LinkedHashMap<>(); protected final Map<String, String> returnsColumns = new LinkedHashMap<>(); private String signatureCache; <<<<<<< @Override protected String getDeclaration(Argument arg, boolean includeDefaultValue, boolean includeArgName) { final StringBuilder sbString = new StringBuilder(); String mode = arg.getMode(); if (mode != null && !"IN".equalsIgnoreCase(mode)) { sbString.append(mode); sbString.append(' '); } String name = arg.getName(); if (name != null && !name.isEmpty() && includeArgName) { sbString.append(PgDiffUtils.getQuotedName(name)); sbString.append(' '); } sbString.append(arg.getDataType()); if (includeDefaultValue) { String def = arg.getDefaultExpression(); if (def != null && !def.isEmpty()) { sbString.append(" = "); sbString.append(def); } } return sbString.toString(); } ======= protected abstract String getDeclaration(Argument arg, boolean includeDefaultValue, boolean includeArgName); public boolean isWindow() { return isWindow; } public void setWindow(boolean isWindow) { this.isWindow = isWindow; resetHash(); } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; resetHash(); } public String getVolatileType() { return volatileType; } public void setVolatileType(String volatileType) { this.volatileType = volatileType; resetHash(); } public boolean isStrict() { return isStrict; } public void setStrict(boolean isStrict) { this.isStrict = isStrict; resetHash(); } public boolean isSecurityDefiner() { return isSecurityDefiner; } public void setSecurityDefiner(boolean isSecurityDefiner) { this.isSecurityDefiner = isSecurityDefiner; resetHash(); } public boolean isLeakproof() { return isLeakproof; } public void setLeakproof(boolean isLeakproof) { this.isLeakproof = isLeakproof; resetHash(); } public float getCost() { return cost; } public void setCost(float cost) { this.cost = cost; resetHash(); } public float getRows() { return rows; } public void setRows(float rows) { this.rows = rows; resetHash(); } public String getParallel() { return parallel; } public void setParallel(String parallel) { this.parallel = parallel; resetHash(); } public void setBody(final String body) { this.body = body; resetHash(); } /** * Sets {@link #body} with newlines as requested in arguments. */ public void setBody(PgDiffArguments args, String body) { setBody(args.isKeepNewlines() ? body : body.replace("\r", "")); } public String getBody() { return body; } public List<String> getTransform() { return Collections.unmodifiableList(transforms); } public void addTransform(String datatype) { transforms.add(datatype); resetHash(); } public Map<String, String> getConfigurations() { return Collections.unmodifiableMap(configurations); } public void addConfiguration(String par, String val) { configurations.put(par, val); resetHash(); } /** * Getter for {@link #arguments}. List cannot be modified. * * @return {@link #arguments} */ @Override public List<Argument> getArguments() { return Collections.unmodifiableList(arguments); } public void addArgument(final Argument argument) { arguments.add(argument); resetHash(); } /** * @return the returns */ @Override public String getReturns() { return returns; } /** * @param returns the returns to set */ public void setReturns(String returns) { this.returns = returns; resetHash(); } /** * @return unmodifiable RETURNS TABLE map */ @Override public Map<String, String> getReturnsColumns() { return Collections.unmodifiableMap(returnsColumns); } public void addReturnsColumn(String name, String type) { returnsColumns.put(name, type); } public List<String> getOptions() { return Collections.unmodifiableList(options); } public void addOption(final String option) { options.add(option); resetHash(); } >>>>>>> protected String getDeclaration(Argument arg, boolean includeDefaultValue, boolean includeArgName) { final StringBuilder sbString = new StringBuilder(); String mode = arg.getMode(); if (mode != null && !"IN".equalsIgnoreCase(mode)) { sbString.append(mode); sbString.append(' '); } String name = arg.getName(); if (name != null && !name.isEmpty() && includeArgName) { sbString.append(PgDiffUtils.getQuotedName(name)); sbString.append(' '); } sbString.append(arg.getDataType()); if (includeDefaultValue) { String def = arg.getDefaultExpression(); if (def != null && !def.isEmpty()) { sbString.append(" = "); sbString.append(def); } } return sbString.toString(); } public boolean isWindow() { return isWindow; } public void setWindow(boolean isWindow) { this.isWindow = isWindow; resetHash(); } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; resetHash(); } public String getVolatileType() { return volatileType; } public void setVolatileType(String volatileType) { this.volatileType = volatileType; resetHash(); } public boolean isStrict() { return isStrict; } public void setStrict(boolean isStrict) { this.isStrict = isStrict; resetHash(); } public boolean isSecurityDefiner() { return isSecurityDefiner; } public void setSecurityDefiner(boolean isSecurityDefiner) { this.isSecurityDefiner = isSecurityDefiner; resetHash(); } public boolean isLeakproof() { return isLeakproof; } public void setLeakproof(boolean isLeakproof) { this.isLeakproof = isLeakproof; resetHash(); } public float getCost() { return cost; } public void setCost(float cost) { this.cost = cost; resetHash(); } public float getRows() { return rows; } public void setRows(float rows) { this.rows = rows; resetHash(); } public String getParallel() { return parallel; } public void setParallel(String parallel) { this.parallel = parallel; resetHash(); } public void setBody(final String body) { this.body = body; resetHash(); } /** * Sets {@link #body} with newlines as requested in arguments. */ public void setBody(PgDiffArguments args, String body) { setBody(args.isKeepNewlines() ? body : body.replace("\r", "")); } public String getBody() { return body; } public List<String> getTransform() { return Collections.unmodifiableList(transforms); } public void addTransform(String datatype) { transforms.add(datatype); resetHash(); } public Map<String, String> getConfigurations() { return Collections.unmodifiableMap(configurations); } public void addConfiguration(String par, String val) { configurations.put(par, val); resetHash(); } /** * Getter for {@link #arguments}. List cannot be modified. * * @return {@link #arguments} */ @Override public List<Argument> getArguments() { return Collections.unmodifiableList(arguments); } public void addArgument(final Argument argument) { arguments.add(argument); resetHash(); } /** * @return the returns */ @Override public String getReturns() { return returns; } /** * @param returns the returns to set */ public void setReturns(String returns) { this.returns = returns; resetHash(); } /** * @return unmodifiable RETURNS TABLE map */ @Override public Map<String, String> getReturnsColumns() { return Collections.unmodifiableMap(returnsColumns); } public void addReturnsColumn(String name, String type) { returnsColumns.put(name, type); } public List<String> getOptions() { return Collections.unmodifiableList(options); } public void addOption(final String option) { options.add(option); resetHash(); }
<<<<<<< import cz.startnet.utils.pgdiff.parsers.antlr.AntlrError; ======= import cz.startnet.utils.pgdiff.PgDiffUtils; >>>>>>> import cz.startnet.utils.pgdiff.parsers.antlr.AntlrError; import cz.startnet.utils.pgdiff.PgDiffUtils;
<<<<<<< @Override protected Pair<String, GenericColumn> getActionAndObjForStmtAction() { List<IdentifierContext> ids = ctx.function_parameters().name.identifier(); return new Pair<>(ACTION_CREATE, new GenericColumn( QNameParser.getSchemaName(ids), QNameParser.getFirstNameCtx(ids).getText(), ctx.PROCEDURE() != null ? DbObjType.PROCEDURE : DbObjType.FUNCTION)); } ======= @Override protected Pair<StatementActions, GenericColumn> getActionAndObjForStmtAction() { List<IdentifierContext> ids = ctx.function_parameters().schema_qualified_name().identifier(); return new Pair<>(StatementActions.CREATE, new GenericColumn( QNameParser.getSchemaName(ids), QNameParser.getFirstNameCtx(ids).getText(), ctx.PROCEDURE() != null ? DbObjType.PROCEDURE : DbObjType.FUNCTION)); } >>>>>>> @Override protected Pair<String, GenericColumn> getActionAndObjForStmtAction() { List<IdentifierContext> ids = ctx.function_parameters().schema_qualified_name().identifier(); return new Pair<>(ACTION_CREATE, new GenericColumn( QNameParser.getSchemaName(ids), QNameParser.getFirstNameCtx(ids).getText(), ctx.PROCEDURE() != null ? DbObjType.PROCEDURE : DbObjType.FUNCTION)); }
<<<<<<< import cz.startnet.utils.pgdiff.schema.AbstractSequence; import cz.startnet.utils.pgdiff.schema.AbstractTable; import cz.startnet.utils.pgdiff.schema.AbstractView; import cz.startnet.utils.pgdiff.schema.PgDatabase; import cz.startnet.utils.pgdiff.schema.PgFtsConfiguration; import cz.startnet.utils.pgdiff.schema.PgFtsDictionary; import cz.startnet.utils.pgdiff.schema.PgFtsParser; import cz.startnet.utils.pgdiff.schema.PgFtsTemplate; import cz.startnet.utils.pgdiff.schema.PgOperator; import cz.startnet.utils.pgdiff.schema.PgType; import cz.startnet.utils.pgdiff.schema.system.PgSystemStorage; ======= >>>>>>> import cz.startnet.utils.pgdiff.schema.system.PgSystemStorage;
<<<<<<< import org.eclipse.compare.CompareConfiguration; import org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider; import org.eclipse.compare.contentmergeviewer.TextMergeViewer; import org.eclipse.core.runtime.Assert; ======= >>>>>>> import org.eclipse.core.runtime.Assert; <<<<<<< import ru.taximaxim.codekeeper.ui.sqledit.SqlSourceViewer; import cz.startnet.utils.pgdiff.PgDiffUtils; ======= >>>>>>> import cz.startnet.utils.pgdiff.PgDiffUtils; <<<<<<< ======= public void setDbSource(DbSource dbSource) { this.dbSource = dbSource; if (diffPane != null) { diffPane.setDbTarget(dbSource); } } public void setDbTarget(DbSource dbTarget) { this.dbTarget = dbTarget; if (diffPane != null) { diffPane.setDbSource(dbTarget); } } >>>>>>> public void setDbSource(DbSource dbSource) { this.dbSource = dbSource; if (diffPane != null) { diffPane.setDbTarget(dbSource); } } public void setDbTarget(DbSource dbTarget) { this.dbTarget = dbTarget; if (diffPane != null) { diffPane.setDbSource(dbTarget); } }
<<<<<<< if (dataType.LEFT_BRACKET() == null && dataType.SETOF() == null && customType != null && (typeSchema == null || ApgdiffConsts.PG_CATALOG.equals(typeSchema.getText()))) { ======= if (dataType.array_type().isEmpty() && dataType.SETOF() == null && customType != null && (typeSchema == null || "pg_catalog".equals(typeSchema.getText()))) { >>>>>>> if (dataType.array_type().isEmpty() && dataType.SETOF() == null && customType != null && (typeSchema == null || ApgdiffConsts.PG_CATALOG.equals(typeSchema.getText()))) {
<<<<<<< import cz.startnet.utils.pgdiff.loader.SupportedVersion; import cz.startnet.utils.pgdiff.parsers.antlr.expr.ViewSelect; ======= >>>>>>> import cz.startnet.utils.pgdiff.loader.SupportedVersion;
<<<<<<< PgFunction func = new PgFunction(getName(functparam.name), null); fillArguments(functparam.function_args(), func); ======= PgFunction func = new PgFunction(getName(functparam.name), null, db.getDefSearchPath()); fillArguments(functparam.function_args(), func, getDefSchemaName()); >>>>>>> PgFunction func = new PgFunction(getName(functparam.name), null); fillArguments(functparam.function_args(), func, getDefSchemaName());
<<<<<<< PgConstraint constraint = getConstraint(result, schema, table.getName()); if (constraint != null) { table.addConstraint(constraint); } ======= table.addConstraint(getConstraint(result, schema.getName(), table.getName())); >>>>>>> table.addConstraint(getConstraint(result, schema, table.getName()));
<<<<<<< if (dataType.LEFT_BRACKET() == null && dataType.SETOF() == null && customType != null && (typeSchema == null || ApgdiffConsts.PG_CATALOG.equals(typeSchema.getText()))) { ======= if (dataType.array_type().isEmpty() && dataType.SETOF() == null && customType != null && (typeSchema == null || "pg_catalog".equals(typeSchema.getText()))) { >>>>>>> if (dataType.array_type().isEmpty() && dataType.SETOF() == null && customType != null && (typeSchema == null || ApgdiffConsts.PG_CATALOG.equals(typeSchema.getText()))) {
<<<<<<< private final boolean useAntrlForViews; private final PgDiffArguments args; public JdbcLoader(JdbcConnector connector, boolean useAntrlForViews, PgDiffArguments pgDiffArguments){ ======= private PgDiffArguments args; public JdbcLoader(JdbcConnector connector, PgDiffArguments pgDiffArguments){ >>>>>>> private final PgDiffArguments args; public JdbcLoader(JdbcConnector connector, PgDiffArguments pgDiffArguments){ <<<<<<< s.setComment(args, ParserUtils.quoteString(comment)); ======= s.setComment(PgDiffUtils.quoteString(comment)); >>>>>>> s.setComment(args, PgDiffUtils.quoteString(comment)); <<<<<<< st.setComment(args, ParserUtils.quoteString(comment)); ======= st.setComment(PgDiffUtils.quoteString(comment)); >>>>>>> st.setComment(args, PgDiffUtils.quoteString(comment)); <<<<<<< c.setComment(args, ParserUtils.quoteString(concomments[i])); ======= c.setComment(PgDiffUtils.quoteString(concomments[i])); >>>>>>> c.setComment(args, PgDiffUtils.quoteString(concomments[i])); <<<<<<< a.setComment(args, ParserUtils.quoteString(attcomments[i])); ======= a.setComment(PgDiffUtils.quoteString(attcomments[i])); >>>>>>> a.setComment(args, PgDiffUtils.quoteString(attcomments[i])); <<<<<<< if (comment != null && !comment.isEmpty()) { e.setComment(args, ParserUtils.quoteString(comment)); } ======= e.setComment(comment != null && !comment.isEmpty() ? PgDiffUtils.quoteString(comment) : null); >>>>>>> if (comment != null && !comment.isEmpty()) { e.setComment(args, PgDiffUtils.quoteString(comment)); } <<<<<<< c.setComment(args, ParserUtils.quoteString(comment)); ======= c.setComment(PgDiffUtils.quoteString(comment)); >>>>>>> c.setComment(args, PgDiffUtils.quoteString(comment)); <<<<<<< if (useAntrlForViews) { v.setSelect(parseAntLrSelect(fakeDb, viewDef)); } else { v.setSelect(SelectParser.parse(fakeDb, viewDef, getSearchPath(schemaName))); } // OWNER setOwner(v, res.getLong(CLASS_RELOWNER)); ======= v.setSelect(parseAntLrSelect(fakeDb, viewDef)); >>>>>>> v.setSelect(parseAntLrSelect(fakeDb, viewDef)); // OWNER setOwner(v, res.getLong(CLASS_RELOWNER)); <<<<<<< v.addColumnComment(colName, ParserUtils.quoteString(colComment)); } String colAcl = colACLs[i]; // Привилегии на столбцы view записываются в саму view if (colAcl != null) { setPrivileges(v, viewName, colAcl, v.getOwner(), colName); } ======= v.addColumnComment(colName, PgDiffUtils.quoteString(colComment)); } >>>>>>> v.addColumnComment(colName, PgDiffUtils.quoteString(colComment)); } String colAcl = colACLs[i]; // Привилегии на столбцы view записываются в саму view if (colAcl != null) { setPrivileges(v, viewName, colAcl, v.getOwner(), colName); } <<<<<<< v.setComment(args, ParserUtils.quoteString(comment)); ======= v.setComment(PgDiffUtils.quoteString(comment)); >>>>>>> v.setComment(args, PgDiffUtils.quoteString(comment)); <<<<<<< column.setComment(args, ParserUtils.quoteString(comment)); ======= column.setComment(PgDiffUtils.quoteString(comment)); >>>>>>> column.setComment(args, PgDiffUtils.quoteString(comment)); <<<<<<< t.setComment(args, ParserUtils.quoteString(comment)); ======= t.setComment(PgDiffUtils.quoteString(comment)); >>>>>>> t.setComment(args, PgDiffUtils.quoteString(comment)); <<<<<<< if (comment != null && !comment.isEmpty()) { f.setComment(args, ParserUtils.quoteString(comment)); } ======= f.setComment(comment != null && !comment.isEmpty() ? PgDiffUtils.quoteString(comment) : null); >>>>>>> if (comment != null && !comment.isEmpty()) { f.setComment(args, PgDiffUtils.quoteString(comment)); } <<<<<<< @Deprecated private String getSearchPath(String schema){ return MessageFormat.format(ApgdiffConsts.SEARCH_PATH_PATTERN, schema); } ======= >>>>>>> @Deprecated private String getSearchPath(String schema){ return MessageFormat.format(ApgdiffConsts.SEARCH_PATH_PATTERN, schema); }
<<<<<<< ParserRuleContext firstNameCtx = QNameParser.getFirstNameCtx(ids); throw new UnresolvedReferenceException("Schema not forund for " + ======= IdentifierContext firstNameCtx = QNameParser.getFirstNameCtx(ids); throw new UnresolvedReferenceException("Schema not found for " + >>>>>>> ParserRuleContext firstNameCtx = QNameParser.getFirstNameCtx(ids); throw new UnresolvedReferenceException("Schema not found for " +
<<<<<<< private Object lastRemote; private DbSource dbProject; private DbSource dbRemote; ======= private Object currentRemote; private DbSource dbProject, dbRemote; >>>>>>> private Object currentRemote; private DbSource dbProject, dbRemote; <<<<<<< TreeDiffer newDiffer = TreeDiffer.getTree(dbProj, dbRemote, false); Job job = new Job(Messages.diffPresentationPane_getting_changes_for_diff) { ======= final TreeDiffer newDiffer = new TreeDiffer(dbProject, dbRemote, false); Job job = new SingletonEditorJob(Messages.diffPresentationPane_getting_changes_for_diff, this, ChangesJobTester.EVAL_PROP) { >>>>>>> TreeDiffer newDiffer = TreeDiffer.getTree(dbProj, dbRemote, false); Job job = new SingletonEditorJob(Messages.diffPresentationPane_getting_changes_for_diff, this, ChangesJobTester.EVAL_PROP) { <<<<<<< setInput(dbProj, dbRemote, newDiffer.getDiffTree()); ======= setInput(dbProject, dbRemote, newDiffer.getDiffTree()); loadedRemote = currentRemote; >>>>>>> setInput(dbProject, dbRemote, newDiffer.getDiffTree()); loadedRemote = currentRemote;
<<<<<<< private File getGitRoot(File subDir) { File gitSubDir = subDir; while (gitSubDir != null) { gitSubDir = new File(gitSubDir, ".git"); if (gitSubDir.exists()) { return gitSubDir.getParentFile(); } else { gitSubDir = gitSubDir.getParentFile().getParentFile(); } } throw new IllegalStateException("Could not find .git repository in " + subDir + " and higher"); } ======= >>>>>>> private File getGitRoot(File subDir) { File gitSubDir = subDir; while (gitSubDir != null) { gitSubDir = new File(gitSubDir, ".git"); if (gitSubDir.exists()) { return gitSubDir.getParentFile(); } else { gitSubDir = gitSubDir.getParentFile().getParentFile(); } } throw new IllegalStateException("Could not find .git repository in " + subDir + " and higher"); }
<<<<<<< ======= } public JdbcConnector(String url, Map<String, String> properties, boolean readOnly, String timezone) throws URISyntaxException { this(url, timezone); >>>>>>> <<<<<<< protected JdbcConnector() { // no impl, unintialized instance } private JdbcConnector(String url) throws URISyntaxException { ======= public JdbcConnector(String url) throws URISyntaxException { this(url, ApgdiffConsts.UTC); } public JdbcConnector(String url, String timezone) throws URISyntaxException { >>>>>>> protected JdbcConnector() { // no impl, unintialized instance } private JdbcConnector(String url, String timezone) throws URISyntaxException {
<<<<<<< AbstractPgFunction function = new PgFunction(name); fillFuncArgs(argsContext.function_arguments(), function); if (argsContext.agg_order() != null) { fillFuncArgs(argsContext.agg_order().function_arguments(), function); } return function.getSignature(); } private static void fillFuncArgs(List<Function_argumentsContext> argsCtx, AbstractPgFunction function) { for (Function_argumentsContext argument : argsCtx) { String type = getFullCtxText(argument.argtype_data); // function identity types from pg_dbo_timestamp extension have // names qualified by pg_catalog schema, delete them to have // equal signatures in project and in extension Schema_qualified_name_nontypeContext sqnn = argument.argtype_data.predefined_type().schema_qualified_name_nontype(); if (sqnn != null) { IdentifierContext schema = sqnn.schema; if (schema != null && "pg_catalog".equals(schema.getText())) { type = type.substring("pg_catalog.".length()); } } function.addArgument(new Argument(argument.arg_mode != null ? argument.arg_mode.getText() : null, argument.argname != null ? argument.argname.getText() : null, type)); ======= PgFunction function = new PgFunction(name); for (Function_argumentsContext argument : argsContext.function_arguments()) { String type = getTypeName(argument.argtype_data); Argument arg = new Argument(argument.arg_mode != null ? argument.arg_mode.getText() : null, argument.argname != null ? argument.argname.getText() : null, type); function.addArgument(arg); >>>>>>> AbstractPgFunction function = new PgFunction(name); fillFuncArgs(argsContext.function_arguments(), function); if (argsContext.agg_order() != null) { fillFuncArgs(argsContext.agg_order().function_arguments(), function); } return function.getSignature(); } private static void fillFuncArgs(List<Function_argumentsContext> argsCtx, AbstractPgFunction function) { for (Function_argumentsContext argument : argsCtx) { String type = getTypeName(argument.argtype_data); function.addArgument(new Argument(argument.arg_mode != null ? argument.arg_mode.getText() : null, argument.argname != null ? argument.argname.getText() : null, type));
<<<<<<< public static DbSource fromFile(boolean forceUnixNewlines, File filename, String encoding) { return new DbSourceFile(forceUnixNewlines, filename, encoding); ======= public static DbSource fromFile(boolean forceUnixNewlines, String filename, String encoding, String timezone) { return new DbSourceFile(forceUnixNewlines, filename, encoding, timezone); >>>>>>> public static DbSource fromFile(boolean forceUnixNewlines, File filename, String encoding, String timezone) { return new DbSourceFile(forceUnixNewlines, filename, encoding, timezone); <<<<<<< getPgDiffArgs(encoding, ApgdiffConsts.UTC, forceUnixNewlines), monitor, null); ======= getPgDiffArgs(encoding, timezone, forceUnixNewlines), monitor, 1, null); >>>>>>> getPgDiffArgs(encoding, timezone, forceUnixNewlines), monitor, null); <<<<<<< try (PgDumpLoader loader = new PgDumpLoader(filename, getPgDiffArgs(encoding, ApgdiffConsts.UTC, forceUnixNewlines), ======= try (PgDumpLoader loader = new PgDumpLoader(new File(filename), getPgDiffArgs(encoding, timezone, forceUnixNewlines), >>>>>>> try (PgDumpLoader loader = new PgDumpLoader(filename, getPgDiffArgs(encoding, timezone, forceUnixNewlines),
<<<<<<< addField(new BooleanFieldEditor(PREF.USE_ANTLR, Messages.generalPrefPage_use_antrl, getFieldEditorParent())); ======= >>>>>>>
<<<<<<< ======= import org.eclipse.swt.widgets.Label; import org.eclipse.ui.IPageLayout; >>>>>>> import org.eclipse.ui.IPageLayout;
<<<<<<< public PgObjLocation getLocation() { ======= public String getLocation() { String location = getMeta().getLocation(); >>>>>>> public PgObjLocation getLocation() { PgObjLocation location = getMeta().getLocation(); <<<<<<< public void setLocation(PgObjLocation location) { this.location = location; ======= public void setLocation(String location) { getMeta().setLocation(location); >>>>>>> public void setLocation(PgObjLocation location) { getMeta().setLocation(location);
<<<<<<< import ru.taximaxim.codekeeper.ui.fileutils.TempDir; import ru.taximaxim.codekeeper.ui.localizations.Messages; ======= >>>>>>> import ru.taximaxim.codekeeper.ui.localizations.Messages; <<<<<<< try (TempDir tmpRepoMeta = new TempDir( props.getProjectWorkingDir().toPath().getParent(), "tmp_repo_meta_")) { //$NON-NLS-1$ File repoMetaProj = new File(props.getRepoRoot(), repo.getRepoMetaFolder()); File repoMetaTmp = new File(tmpRepoMeta.get(), repo.getRepoMetaFolder()); Files.move(repoMetaProj.toPath(), repoMetaTmp.toPath()); Dir.deleteRecursive(dirRepo); new ModelExporter(dirRepo.getAbsolutePath(), db, props.getString(UIConsts.PROJ_PREF_ENCODING)).export(); Files.move(repoMetaTmp.toPath(), repoMetaProj.toPath()); ======= for (ApgdiffConsts.WORK_DIR_NAMES subdirName : ApgdiffConsts.WORK_DIR_NAMES.values()) { File subdir = new File(dirRepo, subdirName.toString()); if (subdir.exists()) { Dir.deleteRecursive(subdir); } >>>>>>> for (ApgdiffConsts.WORK_DIR_NAMES subdirName : ApgdiffConsts.WORK_DIR_NAMES.values()) { File subdir = new File(dirRepo, subdirName.toString()); if (subdir.exists()) { Dir.deleteRecursive(subdir); }
<<<<<<< new VertexToFaunusBinary().writeVertex(vertex, out); } public static void write(final Vertex vertex, final DataOutput out, final ElementIdHandler elementIdHandler) throws IOException { new VertexToFaunusBinary(elementIdHandler).writeVertex(vertex, out); } public void writeVertex(final Vertex vertex, final DataOutput out) throws IOException { out.writeLong(elementIdHandler.convertIdentifier(vertex.getId())); out.writeInt(0); ======= writeId(vertex.getId(), out); //out.writeInt(0); out.writeBoolean(false); out.writeLong(0); writeProperties(vertex, out); >>>>>>> new VertexToFaunusBinary().writeVertex(vertex, out); } public static void write(final Vertex vertex, final DataOutput out, final ElementIdHandler elementIdHandler) throws IOException { new VertexToFaunusBinary(elementIdHandler).writeVertex(vertex, out); } public void writeVertex(final Vertex vertex, final DataOutput out) throws IOException { out.writeLong(elementIdHandler.convertIdentifier(vertex.getId())); out.writeBoolean(false); out.writeLong(0); writeProperties(vertex, out); <<<<<<< out.writeLong(elementIdHandler.convertIdentifier(edge.getId())); out.writeInt(0); out.writeLong(elementIdHandler.convertIdentifier(edge.getVertex(direction.opposite()).getId())); ======= writeId(edge.getId(), out); out.writeBoolean(false); out.writeLong(0); >>>>>>> out.writeLong(elementIdHandler.convertIdentifier(edge.getId())); out.writeBoolean(false); out.writeLong(0);
<<<<<<< PgFunction function = new PgFunction(name, getFullCtxText(ctx.getParent())); fillArguments(ctx.function_parameters().function_args(), function); ======= PgFunction function = new PgFunction(name, getFullCtxText(ctx.getParent()), db.getDefSearchPath()); fillArguments(ctx.function_parameters().function_args(), function, getDefSchemaName()); >>>>>>> PgFunction function = new PgFunction(name, getFullCtxText(ctx.getParent())); fillArguments(ctx.function_parameters().function_args(), function, getDefSchemaName());
<<<<<<< ======= import ru.taximaxim.codekeeper.apgdiff.licensing.LicenseException; import ru.taximaxim.codekeeper.ui.Log; import ru.taximaxim.codekeeper.ui.UIConsts.NATURE; >>>>>>> import ru.taximaxim.codekeeper.ui.Log; import ru.taximaxim.codekeeper.ui.UIConsts.NATURE; <<<<<<< throws InterruptedException, IOException, CoreException { SubMonitor mon = SubMonitor.convert(monitor, files.size()); ======= throws InterruptedException, IOException, LicenseException, CoreException { >>>>>>> throws InterruptedException, IOException, CoreException {
<<<<<<< {"drop_dom_tbl", false}, // Test column privilege {"col_priv", false}, {"col_revoke_priv", false}, {"col_priv_new_tbl", false} ======= {"drop_dom_tbl", false}, // Test authorization schema {"authorization_schema", false} >>>>>>> {"drop_dom_tbl", false}, // Test authorization schema {"authorization_schema", false}, // Test column privilege {"col_priv", false}, {"col_revoke_priv", false}, {"col_priv_new_tbl", false}
<<<<<<< ======= import ru.taximaxim.codekeeper.ui.prefs.PreferenceInitializer; import ru.taximaxim.codekeeper.ui.pgdbproject.parser.PgDbParser; >>>>>>> import ru.taximaxim.codekeeper.ui.prefs.PreferenceInitializer; <<<<<<< ======= PgDbParser.getParser(proj.getProject()).getObjFromProject(); CommitPage.this.callEgitCommitCommand(); >>>>>>> CommitPage.this.callEgitCommitCommand();
<<<<<<< ParserAbstract.fillArguments(ctx.function_args(), func, getDefSchemaName(), db); name = func.getSignature(); ======= ParserAbstract.fillArguments(ctx.function_args(), func, getDefSchemaName()); name = func.getBareName(); >>>>>>> ParserAbstract.fillArguments(ctx.function_args(), func, getDefSchemaName(), db); name = func.getBareName(); <<<<<<< ParserAbstract.fillArguments(functparam.function_args(), func, getDefSchemaName(), db); addObjReference(getDefSchemaName(), func.getSignature(), ======= ParserAbstract.fillArguments(functparam.function_args(), func, getDefSchemaName()); addObjReference(getDefSchemaName(), func.getBareName(), >>>>>>> ParserAbstract.fillArguments(functparam.function_args(), func, getDefSchemaName(), db); addObjReference(getDefSchemaName(), func.getBareName(), <<<<<<< getDefSchemaName(), db); addObjReference(schemaName, function.getSignature(), ======= getDefSchemaName()); addObjReference(schemaName, function.getBareName(), >>>>>>> getDefSchemaName(), db); addObjReference(schemaName, function.getBareName(), <<<<<<< getDefSchemaName(), db); addObjReference(schemaName, func.getSignature(), ======= getDefSchemaName()); addObjReference(schemaName, func.getBareName(), >>>>>>> getDefSchemaName(), db); addObjReference(schemaName, func.getBareName(),
<<<<<<< loader.setPrivileges(s, PgDiffUtils.getQuotedName(schemaName), res.getString("nspacl"), owner, null); ======= loader.setPrivileges(s, res.getString("nspacl")); >>>>>>> loader.setPrivileges(s, res.getString("nspacl"), null);
<<<<<<< import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Vex_eofContext; import cz.startnet.utils.pgdiff.parsers.antlr.exprold.AbstractExprWithNmspc; import cz.startnet.utils.pgdiff.parsers.antlr.exprold.Select; import cz.startnet.utils.pgdiff.parsers.antlr.exprold.ValueExpr; import cz.startnet.utils.pgdiff.parsers.antlr.exprold.ValueExprWithNmspc; ======= >>>>>>> <<<<<<< import cz.startnet.utils.pgdiff.parsers.antlr.statements.ParserAbstract; import cz.startnet.utils.pgdiff.schema.GenericColumn; import cz.startnet.utils.pgdiff.schema.IArgument; import cz.startnet.utils.pgdiff.schema.PgConstraint; import cz.startnet.utils.pgdiff.schema.PgDatabase; import cz.startnet.utils.pgdiff.schema.PgFunction; ======= import cz.startnet.utils.pgdiff.schema.PgDatabase; >>>>>>> import cz.startnet.utils.pgdiff.schema.GenericColumn; import cz.startnet.utils.pgdiff.schema.PgDatabase; <<<<<<< ValueExprWithNmspc vex = new ValueExprWithNmspc(schemaName); GenericColumn implicitTable = new GenericColumn(schemaName, rule.getParent().getName(), DbObjType.TABLE); vex.addReference("new", implicitTable); vex.addReference("old", implicitTable); ======= ValueExprWithNmspc vex = new ValueExprWithNmspc(schemaName, db); vex.addReference("new", null); vex.addReference("old", null); >>>>>>> ValueExprWithNmspc vex = new ValueExprWithNmspc(schemaName, db); GenericColumn implicitTable = new GenericColumn(schemaName, rule.getParent().getName(), DbObjType.TABLE); vex.addReference("new", implicitTable); vex.addReference("old", implicitTable); <<<<<<< public static void analyzeTriggersWhen(VexContext ctx, PgTrigger trigger, String schemaName) { ValueExprWithNmspc vex = new ValueExprWithNmspc(schemaName); GenericColumn implicitTable = new GenericColumn(schemaName, trigger.getTableName(), DbObjType.TABLE); vex.addReference("new", implicitTable); vex.addReference("old", implicitTable); ======= public static void analyzeTriggersWhen(VexContext ctx, PgTrigger trigger, String schemaName, PgDatabase db) { ValueExprWithNmspc vex = new ValueExprWithNmspc(schemaName, db); vex.addReference("new", null); vex.addReference("old", null); >>>>>>> public static void analyzeTriggersWhen(VexContext ctx, PgTrigger trigger, String schemaName, PgDatabase db) { ValueExprWithNmspc vex = new ValueExprWithNmspc(schemaName, db); GenericColumn implicitTable = new GenericColumn(schemaName, trigger.getTableName(), DbObjType.TABLE); vex.addReference("new", implicitTable); vex.addReference("old", implicitTable); <<<<<<< public static void analyzeConstraint(Constr_bodyContext ctx, String schemaName, PgConstraint constr, PgDatabase db) { VexContext exp = null; Common_constraintContext common = ctx.common_constraint(); Check_boolean_expressionContext check; if (common != null && (check = common.check_boolean_expression()) != null) { exp = check.expression; } else { exp = ctx.vex(); } if (exp != null) { cz.startnet.utils.pgdiff.parsers.antlr.expr.ValueExprWithNmspc valExptWithNmspc = new cz.startnet.utils.pgdiff.parsers.antlr.expr.ValueExprWithNmspc(schemaName, db); valExptWithNmspc.addRawTableReference(new GenericColumn( constr.getContainingSchema().getName(), constr.getParent().getName(), DbObjType.TABLE)); analyzeSecond(exp, valExptWithNmspc, constr); } } public static void analyzeFunctionDefaults(Vex_eofContext ctx, PgFunction f, String schemaName) { List<VexContext> vexCtxList = ctx.vex(); ListIterator<VexContext> vexCtxListIterator = vexCtxList.listIterator(vexCtxList.size()); for (int i = (f.getArguments().size() - 1); i >= 0; i--) { if (!vexCtxListIterator.hasPrevious()) { break; } IArgument a = f.getArguments().get(i); if ("IN".equals(a.getMode()) || "INOUT".equals(a.getMode())) { VexContext vx = vexCtxListIterator.previous(); a.setDefaultExpression(ParserAbstract.getFullCtxText(vx)); analyze(vx, new ValueExpr(schemaName), f); vexCtxListIterator.remove(); } } } ======= >>>>>>> private UtilAnalyzeExpr() { }
<<<<<<< import java.util.List; ======= import java.util.LinkedList; import java.util.List; import java.util.Map; >>>>>>> import java.util.LinkedList; import java.util.List; <<<<<<< import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.ComboViewer; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.StructuredSelection; ======= import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.ComboViewer; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; >>>>>>> import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.ComboViewer; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; <<<<<<< ======= import org.eclipse.swt.widgets.FileDialog; >>>>>>> import org.eclipse.swt.widgets.FileDialog; <<<<<<< cmbDbNames = new ComboViewer(container, SWT.READ_ONLY | SWT.DROP_DOWN); cmbDbNames.setContentProvider(ArrayContentProvider.getInstance()); cmbDbNames.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { return ((DbInfo) element).getName(); } }); ======= cmbDbNames2 = new ComboViewer(container, SWT.READ_ONLY | SWT.DROP_DOWN); cmbDbNames = cmbDbNames2.getCombo(); >>>>>>> cmbDbNames = new ComboViewer(container, SWT.READ_ONLY | SWT.DROP_DOWN); cmbDbNames.setContentProvider(ArrayContentProvider.getInstance()); cmbDbNames.setLabelProvider(new DbStoreLabelProvider()); cmbDbNames.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { Object selected = cmbDbNames.getStructuredSelection().getFirstElement(); if ((selected instanceof String) && "Загрузить из файла...".equals(selected)){ FileDialog fDialog = new FileDialog(getShell()); String pathToDump = fDialog.open(); if (pathToDump != null){ if (dumpFileHistory.size() == 3) { dumpFileHistory.remove(0); } Path p = new Path(pathToDump); dumpFileHistory.add(p); prefStore.setValue(PREF.DB_STORE_HISTORY, DbInfo.dump2String(dumpFileHistory)); // FIXME refresh? cmbDbNames.setSelection(new StructuredSelection(p)); } else { // FIXME ! } } } }); <<<<<<< PreferencesUtil.createPreferenceDialogOn( getShell(), PREF_PAGE.DB_STORE, null, null).open(); loadStore(); ======= PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(getShell(), UIConsts.PREF.DB_STORE_PREF_PAGE, null, null); if (prefDialog != null && prefDialog.open() == prefDialog.OK){ loadStore(); } >>>>>>> PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(getShell(), PREF_PAGE.DB_STORE, null, null); if (prefDialog != null && prefDialog.open() == prefDialog.OK){ loadStore(); }
<<<<<<< oper.setProcedure(option.func_name.getText()); addDepSafe(oper, option.func_name.identifier(), DbObjType.FUNCTION); ======= oper.setProcedure(getFullCtxText(option.func_name)); >>>>>>> oper.setProcedure(getFullCtxText(option.func_name)); addDepSafe(oper, option.func_name.identifier(), DbObjType.FUNCTION); <<<<<<< oper.setLeftArg(leftArgTypeCtx.getText()); addTypeAsDepcy(leftArgTypeCtx, oper); ======= oper.setLeftArg(getTypeName(leftArgTypeCtx)); addTypeAsDepcy(leftArgTypeCtx, oper, operSchemaName); >>>>>>> oper.setLeftArg(getTypeName(leftArgTypeCtx)); addTypeAsDepcy(leftArgTypeCtx, oper); <<<<<<< oper.setRightArg(rightArgTypeCtx.getText()); addTypeAsDepcy(rightArgTypeCtx, oper); ======= oper.setRightArg(getTypeName(rightArgTypeCtx)); addTypeAsDepcy(rightArgTypeCtx, oper, operSchemaName); >>>>>>> oper.setRightArg(getTypeName(rightArgTypeCtx)); addTypeAsDepcy(rightArgTypeCtx, oper); <<<<<<< oper.setRestrict(option.restr_name.getText()); addDepSafe(oper, option.restr_name.identifier(), DbObjType.FUNCTION); ======= oper.setRestrict(getFullCtxText(option.restr_name)); >>>>>>> oper.setRestrict(getFullCtxText(option.restr_name)); addDepSafe(oper, option.restr_name.identifier(), DbObjType.FUNCTION); <<<<<<< oper.setJoin(option.join_name.getText()); addDepSafe(oper, option.join_name.identifier(), DbObjType.FUNCTION); ======= oper.setJoin(getFullCtxText(option.join_name)); >>>>>>> oper.setJoin(getFullCtxText(option.join_name)); addDepSafe(oper, option.join_name.identifier(), DbObjType.FUNCTION);
<<<<<<< public QueriesBatchCallable(Statement st, List<List<QueryLocation>> batches, IProgressMonitor monitor, IProgressReporter reporter, Connection connection) { ======= public QueriesBatchCallable(Statement st, List<List<String>> batches, IProgressMonitor monitor, IProgressReporter reporter, Connection connection, boolean isMsSql) { >>>>>>> public QueriesBatchCallable(Statement st, List<List<QueryLocation>> batches, IProgressMonitor monitor, IProgressReporter reporter, Connection connection, boolean isMsSql) { <<<<<<< if (batches.size() == 1) { List<QueryLocation> queries = batches.get(0); ======= if (!isMsSql) { List<String> queries = batches.get(0); >>>>>>> if (!isMsSql && batches.size() == 1) { List<QueryLocation> queries = batches.get(0); <<<<<<< connection.setAutoCommit(false); for (List<QueryLocation> queriesList : batches) { ======= for (List<String> queriesList : batches) { >>>>>>> for (List<QueryLocation> queriesList : batches) { <<<<<<< for (QueryLocation query : queriesList) { currQuery = query; st.addBatch(currQuery.getSql()); writeStatus(query.getAction()); } if (reporter != null) { reporter.writeMessage("Executing batch"); } st.executeBatch(); writeWarnings(); ======= runBatch(queriesList); >>>>>>> runBatch(queriesList, currQuery);
<<<<<<< public CustomSQLParserListener(PgDatabase database, String filename, ParserListenerMode mode, List<AntlrError> errors, Queue<AntlrTask<?>> antlrTasks, IProgressMonitor monitor) { super(database, filename, mode, errors, monitor); ======= public CustomSQLParserListener(PgDatabase database, String filename, boolean refMode, List<Object> errors, Queue<AntlrTask<?>> antlrTasks, IProgressMonitor monitor) { super(database, filename, refMode, errors, monitor); >>>>>>> public CustomSQLParserListener(PgDatabase database, String filename, ParserListenerMode mode, List<Object> errors, Queue<AntlrTask<?>> antlrTasks, IProgressMonitor monitor) { super(database, filename, mode, errors, monitor);
<<<<<<< {"add_aggr_func", "add_aggr_func_usr_aggr"}, // в функции 'f1' изменяется имя аргумента функции, // в функции 'f2' изменяется определение функции, // пользователь выбирает 'f1' // (опеределение обеих функций написано на языке SQL) // ('f2' зависит от 'f1') { "change_func_arg_name", "change_func_arg_name_usr_f1" }, // в функции 'f1' изменяется имя аргумента функции, // в функции 'f2' изменяется определение функции, // пользователь выбирает 'f1' // (опеределение обеих функций написано на языке SQL) // ('f2' зависит от 'f1') // (обе функции находятся в разных схемах) { "change_func_arg_name_sch", "change_func_arg_name_sch_usr_f1" } ======= {"add_aggr_func", "add_aggr_func_usr_aggr"}, // добавление вьюхи с зависимыми от нее объектами, // пользователь выбрал только вьюху {"add_view", "add_view_usr_view"}, >>>>>>> {"add_aggr_func", "add_aggr_func_usr_aggr"}, // в функции 'f1' изменяется имя аргумента функции, // в функции 'f2' изменяется определение функции, // пользователь выбирает 'f1' // (опеределение обеих функций написано на языке SQL) // ('f2' зависит от 'f1') { "change_func_arg_name", "change_func_arg_name_usr_f1" }, // в функции 'f1' изменяется имя аргумента функции, // в функции 'f2' изменяется определение функции, // пользователь выбирает 'f1' // (опеределение обеих функций написано на языке SQL) // ('f2' зависит от 'f1') // (обе функции находятся в разных схемах) { "change_func_arg_name_sch", "change_func_arg_name_sch_usr_f1" }, // добавление вьюхи с зависимыми от нее объектами, // пользователь выбрал только вьюху {"add_view", "add_view_usr_view"},
<<<<<<< import cz.startnet.utils.pgdiff.loader.PgDumpLoader; ======= import cz.startnet.utils.pgdiff.PgDiffUtils; import cz.startnet.utils.pgdiff.schema.PgDatabase; >>>>>>> import cz.startnet.utils.pgdiff.PgDiffUtils;
<<<<<<< ======= import java.util.ArrayList; >>>>>>> <<<<<<< schema.addTable(table); ======= if (db.getSchema(schemaName) == null) { logSkipedObject(schemaName, "TABLE", name); return null; } db.getSchema(schemaName).addTable(table); >>>>>>> schema.addTable(table);
<<<<<<< PgDumpLoader.dbAnalyze(db); arguments.getLicense().verifyDb(db); ======= >>>>>>> PgDumpLoader.dbAnalyze(db);
<<<<<<< ======= import cz.startnet.utils.pgdiff.PgDiffArguments; import cz.startnet.utils.pgdiff.loader.JdbcConnector; import cz.startnet.utils.pgdiff.loader.JdbcLoader; import cz.startnet.utils.pgdiff.loader.PgDumpLoader; import cz.startnet.utils.pgdiff.schema.PgDatabase; >>>>>>> <<<<<<< public static DbSource fromDirTree(boolean useAntlr, boolean forceUnixNewlines, String dirTreePath, String encoding) { return new DbSourceDirTree(useAntlr, forceUnixNewlines, dirTreePath, encoding); ======= protected abstract PgDatabase loadInternal(SubMonitor monitor) throws IOException, InterruptedException; public static DbSource fromDirTree(String dirTreePath, String encoding) { return new DbSourceDirTree(dirTreePath, encoding); >>>>>>> public static DbSource fromDirTree(boolean forceUnixNewlines,String dirTreePath, String encoding) { return new DbSourceDirTree(forceUnixNewlines, dirTreePath, encoding); <<<<<<< public static DbSource fromFile(boolean useAntlr, boolean forceUnixNewlines, String filename, String encoding) { return new DbSourceFile(useAntlr, forceUnixNewlines, filename, encoding); ======= public static DbSource fromFile(String filename, String encoding) { return new DbSourceFile(filename, encoding); >>>>>>> public static DbSource fromFile(boolean forceUnixNewlines, String filename, String encoding) { return new DbSourceFile(forceUnixNewlines, filename, encoding); <<<<<<< public static DbSource fromDb(boolean useAntlr, boolean forceUnixNewlines, String exePgdump, String customParams, ======= public static DbSource fromDb(String exePgdump, String customParams, >>>>>>> public static DbSource fromDb(boolean forceUnixNewlines, String exePgdump, String customParams, <<<<<<< return new DbSourceDb(useAntlr, forceUnixNewlines, exePgdump, customParams, ======= return new DbSourceDb(exePgdump, customParams, >>>>>>> return new DbSourceDb(forceUnixNewlines, exePgdump, customParams, <<<<<<< String encoding, String timezone, boolean useAntrlForViews, boolean forceUnixNewlines) { ======= String encoding, String timezone) { >>>>>>> String encoding, String timezone, boolean forceUnixNewlines) { <<<<<<< encoding, timezone, useAntrlForViews, forceUnixNewlines); ======= encoding, timezone); >>>>>>> encoding, timezone, forceUnixNewlines); <<<<<<< private final boolean useAntlr; private final boolean forceUnixNewlines; ======= >>>>>>> private final boolean forceUnixNewlines; <<<<<<< DbSourceDirTree(boolean useAntlr, boolean forceUnixNewlines, String dirTreePath, String encoding) { ======= DbSourceDirTree(String dirTreePath, String encoding) { >>>>>>> DbSourceDirTree(boolean forceUnixNewlines, String dirTreePath, String encoding) { <<<<<<< this.useAntlr = useAntlr; this.forceUnixNewlines = forceUnixNewlines; ======= >>>>>>> this.forceUnixNewlines = forceUnixNewlines; <<<<<<< getPgDiffArgs(encoding, ApgdiffConsts.UTC, forceUnixNewlines), useAntlr ? ParserClass.getAntlr(monitor, 1) : ParserClass.getLegacy(monitor, 1)); ======= getPgDiffArgs(encoding, ApgdiffConsts.UTC), monitor, 1, null); >>>>>>> getPgDiffArgs(encoding, ApgdiffConsts.UTC, forceUnixNewlines), monitor, 1, null); <<<<<<< proj.getPathToProject().toString(), getPgDiffArgs(charset, ApgdiffConsts.UTC, pref.getBoolean(PROJ_PREF.FORCE_UNIX_NEWLINES, true)), useAntlr ? ParserClass.getAntlr(monitor, 1) : ParserClass.getLegacy(monitor, 1)); ======= proj.getPathToProject().toString(), getPgDiffArgs(charset, ApgdiffConsts.UTC), monitor, 1, null); >>>>>>> proj.getPathToProject().toString(), getPgDiffArgs(charset, ApgdiffConsts.UTC, pref.getBoolean(PROJ_PREF.FORCE_UNIX_NEWLINES, true)), monitor, 1, null); <<<<<<< private static final int AVERAGE_STATEMENT_LENGTH = 5; private final boolean useAntlr; private final boolean forceUnixNewlines; ======= private final static int AVERAGE_STATEMENT_LENGTH = 5; >>>>>>> private static final int AVERAGE_STATEMENT_LENGTH = 5; private final boolean forceUnixNewlines; <<<<<<< DbSourceFile(boolean useAntlr, boolean forceUnixNewlines, String filename, String encoding) { ======= DbSourceFile(String filename, String encoding) { >>>>>>> DbSourceFile(boolean forceUnixNewlines, String filename, String encoding) { <<<<<<< this.useAntlr = useAntlr; this.forceUnixNewlines = forceUnixNewlines; ======= >>>>>>> this.forceUnixNewlines = forceUnixNewlines; <<<<<<< return PgDumpLoader.loadDatabaseSchemaFromDump(filename, getPgDiffArgs(encoding, ApgdiffConsts.UTC, forceUnixNewlines), useAntlr ? ParserClass.getAntlr(monitor, 2) : ParserClass.getLegacy(monitor, 2)); ======= return PgDumpLoader.loadDatabaseSchemaFromDump(filename, getPgDiffArgs(encoding, ApgdiffConsts.UTC), monitor, 2); >>>>>>> return PgDumpLoader.loadDatabaseSchemaFromDump(filename, getPgDiffArgs(encoding, ApgdiffConsts.UTC, forceUnixNewlines), monitor, 2); <<<<<<< private final boolean useAntlr; private final boolean forceUnixNewlines; ======= >>>>>>> private final boolean forceUnixNewlines; <<<<<<< DbSourceDb(boolean useAntlr, String exePgdump, String customParams, PgDbProject proj, String password) throws CoreException { this(useAntlr, proj.getPrefs().getBoolean(PROJ_PREF.FORCE_UNIX_NEWLINES, true), exePgdump, customParams, proj.getPrefs().get(PROJ_PREF.DB_HOST, ""), //$NON-NLS-1$ proj.getPrefs().getInt(PROJ_PREF.DB_PORT, JDBC_CONSTS.JDBC_DEFAULT_PORT), proj.getPrefs().get(PROJ_PREF.DB_USER, ""), //$NON-NLS-1$ ======= DbSourceDb(String exePgdump, String customParams, PgDbProject props, String password) throws CoreException { this(exePgdump, customParams, props.getPrefs().get(PROJ_PREF.DB_HOST, ""), //$NON-NLS-1$ props.getPrefs().getInt(PROJ_PREF.DB_PORT, JDBC_CONSTS.JDBC_DEFAULT_PORT), props.getPrefs().get(PROJ_PREF.DB_USER, ""), //$NON-NLS-1$ >>>>>>> DbSourceDb(String exePgdump, String customParams, PgDbProject proj, String password) throws CoreException { this(proj.getPrefs().getBoolean(PROJ_PREF.FORCE_UNIX_NEWLINES, true), exePgdump, customParams, proj.getPrefs().get(PROJ_PREF.DB_HOST, ""), //$NON-NLS-1$ proj.getPrefs().getInt(PROJ_PREF.DB_PORT, JDBC_CONSTS.JDBC_DEFAULT_PORT), proj.getPrefs().get(PROJ_PREF.DB_USER, ""), //$NON-NLS-1$ <<<<<<< DbSourceDb(boolean useAntlr, boolean forceUnixNewlines, String exePgdump, String customParams, ======= DbSourceDb(String exePgdump, String customParams, >>>>>>> DbSourceDb(boolean forceUnixNewlines, String exePgdump, String customParams, <<<<<<< this.useAntlr = useAntlr; this.forceUnixNewlines = forceUnixNewlines; ======= >>>>>>> this.forceUnixNewlines = forceUnixNewlines; <<<<<<< dump.getAbsolutePath(), getPgDiffArgs(encoding, timezone, forceUnixNewlines), useAntlr ? ParserClass.getAntlr(monitor, 1) : ParserClass.getLegacy(monitor, 1)); ======= dump.getAbsolutePath(), getPgDiffArgs(encoding, timezone), monitor, 1); >>>>>>> dump.getAbsolutePath(), getPgDiffArgs(encoding, timezone, forceUnixNewlines), monitor, 1); <<<<<<< private final JdbcLoader jdbcLoader; DbSourceJdbc(String host, int port, String user, String pass, String dbName, String encoding, String timezone, boolean useAntrlForViews, boolean forceUnixNewlines) { ======= private JdbcLoader jdbcLoader; DbSourceJdbc(String host, int port, String user, String pass, String dbName, String encoding, String timezone) { >>>>>>> private final JdbcLoader jdbcLoader; DbSourceJdbc(String host, int port, String user, String pass, String dbName, String encoding, String timezone, boolean forceUnixNewlines) { <<<<<<< useAntrlForViews, getPgDiffArgs(encoding, timezone, forceUnixNewlines)); ======= getPgDiffArgs(encoding, timezone)); >>>>>>> getPgDiffArgs(encoding, timezone, forceUnixNewlines));
<<<<<<< public static PgDbProject getProgFromFile(String projectName, String pathToProject) throws PgCodekeeperUIException { ======= public static PgDbProject getProjFromFile(String projectName, String pathToProject) { >>>>>>> public static PgDbProject getProjFromFile(String projectName, String pathToProject) throws PgCodekeeperUIException {
<<<<<<< Function_defContext funcDef = null; ======= Float cost = null; String language = null; >>>>>>> Function_defContext funcDef = null; Float cost = null; String language = null;
<<<<<<< private Button btnEnableFuncDep; ======= private Button btnSimplifyView; >>>>>>> private Button btnEnableFuncDep; private Button btnSimplifyView; <<<<<<< btnEnableFuncDep = new Button(panel, SWT.CHECK); btnEnableFuncDep.setText(Messages.GeneralPrefPage_enable_body_dependencies); gd = new GridData(SWT.BEGINNING, SWT.DEFAULT, false, false, 2, 1); gd.horizontalIndent = 10; btnEnableFuncDep.setLayoutData(gd); btnEnableFuncDep.setSelection(prefs.getBoolean(PREF.ENABLE_BODY_DEPENDENCIES, false)); btnEnableFuncDep.setEnabled(overridePref); ======= if (!isMsSql) { btnSimplifyView = new Button(panel, SWT.CHECK); btnSimplifyView.setText(Messages.GeneralPrefPage_simplify_view); gd = new GridData(SWT.BEGINNING, SWT.DEFAULT, false, false, 2, 1); gd.horizontalIndent = 10; btnSimplifyView.setLayoutData(gd); btnSimplifyView.setSelection(prefs.getBoolean(PREF.SIMPLIFY_VIEW, false)); btnSimplifyView.setEnabled(overridePref); } >>>>>>> btnEnableFuncDep = new Button(panel, SWT.CHECK); btnEnableFuncDep.setText(Messages.GeneralPrefPage_enable_body_dependencies); gd = new GridData(SWT.BEGINNING, SWT.DEFAULT, false, false, 2, 1); gd.horizontalIndent = 10; btnEnableFuncDep.setLayoutData(gd); btnEnableFuncDep.setSelection(prefs.getBoolean(PREF.ENABLE_BODY_DEPENDENCIES, false)); btnEnableFuncDep.setEnabled(overridePref); if (!isMsSql) { btnSimplifyView = new Button(panel, SWT.CHECK); btnSimplifyView.setText(Messages.GeneralPrefPage_simplify_view); gd = new GridData(SWT.BEGINNING, SWT.DEFAULT, false, false, 2, 1); gd.horizontalIndent = 10; btnSimplifyView.setLayoutData(gd); btnSimplifyView.setSelection(prefs.getBoolean(PREF.SIMPLIFY_VIEW, false)); btnSimplifyView.setEnabled(overridePref); }
<<<<<<< loadDatabase(d); ======= d.getSchema(schema.getName()).setLocation(inputObjectName); Queue<AntlrTask<?>> antlrTasks = new ArrayDeque<>(1); loadDatabase(d, antlrTasks); AntlrParser.finishAntlr(antlrTasks); >>>>>>> Queue<AntlrTask<?>> antlrTasks = new ArrayDeque<>(1); loadDatabase(d, antlrTasks); AntlrParser.finishAntlr(antlrTasks); <<<<<<< monitor, monitoringLevel, listener); ======= monitor, monitoringLevel, listeners, antlrTasks); >>>>>>> monitor, monitoringLevel, listener, antlrTasks); <<<<<<< ======= isInputInAntlrParser = true; >>>>>>> isInputInAntlrParser = true; <<<<<<< monitor, monitoringLevel, listener); ======= monitor, monitoringLevel, listeners, antlrTasks); >>>>>>> monitor, monitoringLevel, listener, antlrTasks);
<<<<<<< import cz.startnet.utils.pgdiff.PgDiffArguments; import cz.startnet.utils.pgdiff.loader.ParserListenerMode; import cz.startnet.utils.pgdiff.loader.PgDumpLoader; import cz.startnet.utils.pgdiff.schema.PgObjLocation; ======= import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Alter_sequence_statementContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Alter_table_statementContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Column_actionContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Data_statementContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Drop_statementsContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Schema_alterContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Schema_dropContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Schema_statementContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.SqlContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.StatementContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Table_actionContext; import cz.startnet.utils.pgdiff.parsers.antlr.TSQLParser.Alter_tableContext; import cz.startnet.utils.pgdiff.parsers.antlr.TSQLParser.BatchContext; import cz.startnet.utils.pgdiff.parsers.antlr.TSQLParser.Ddl_clauseContext; import cz.startnet.utils.pgdiff.parsers.antlr.TSQLParser.Dml_clauseContext; import cz.startnet.utils.pgdiff.parsers.antlr.TSQLParser.Sql_clausesContext; import cz.startnet.utils.pgdiff.parsers.antlr.TSQLParser.St_clauseContext; import cz.startnet.utils.pgdiff.parsers.antlr.TSQLParser.Tsql_fileContext; import cz.startnet.utils.pgdiff.parsers.antlr.statements.ParserAbstract; >>>>>>> import cz.startnet.utils.pgdiff.PgDiffArguments; import cz.startnet.utils.pgdiff.loader.ParserListenerMode; import cz.startnet.utils.pgdiff.loader.PgDumpLoader; import cz.startnet.utils.pgdiff.schema.PgObjLocation; <<<<<<< ======= private final List<List<String>> batches = new ArrayList<>(); private final List<Object> errors = new ArrayList<>(); private final Set<DangerStatement> dangerStatements = EnumSet.noneOf(DangerStatement.class); >>>>>>> <<<<<<< ======= private void batchMs(Tsql_fileContext rootCtx, CommonTokenStream stream) { for (BatchContext batch : rootCtx.batch()) { List<String> l = new ArrayList<>(); if (batch.batch_statement() != null) { l.add(ParserAbstract.getFullCtxTextWithHidden(batch.batch_statement(), stream)); } else { List<St_clauseContext> clauses = batch.sql_clauses().st_clause(); for (St_clauseContext clause : clauses) { l.add(ParserAbstract.getFullCtxText(clause)); } } batches.add(l); } } private void batchPg(SqlContext rootCtx) { List<String> l = new ArrayList<>(); batches.add(l); for (StatementContext st : rootCtx.statement()) { l.add(ParserAbstract.getFullCtxText(st)); } } private void checkPgDanger(SqlContext rootCtx) { for (StatementContext st : rootCtx.statement()) { Schema_statementContext schema = st.schema_statement(); Data_statementContext ds; if (schema != null) { Schema_alterContext alter = schema.schema_alter(); Schema_dropContext drop; if (alter != null) { alter(alter); } else if ((drop = schema.schema_drop()) != null) { Drop_statementsContext dropSt = drop.drop_statements(); if (dropSt != null && dropSt.TABLE() != null) { dangerStatements.add(DangerStatement.DROP_TABLE); } } } else if ((ds = st.data_statement()) != null && ds.update_stmt_for_psql() != null) { dangerStatements.add(DangerStatement.UPDATE); } } } private void alter(Schema_alterContext alter) { Alter_sequence_statementContext seq = alter.alter_sequence_statement(); Alter_table_statementContext at; if (seq != null && !seq.RESTART().isEmpty()) { dangerStatements.add(DangerStatement.RESTART_WITH); } else if ((at = alter.alter_table_statement()) != null) { for (Table_actionContext tablAction : at.table_action()) { Column_actionContext colAction = tablAction.column_action(); if (tablAction.column != null && tablAction.DROP() != null) { dangerStatements.add(DangerStatement.DROP_COLUMN); } else if (colAction != null && colAction.data_type() != null) { dangerStatements.add(DangerStatement.ALTER_COLUMN); } } } } private void checkMsDanger(Tsql_fileContext rootCtx) { for (BatchContext b : rootCtx.batch()) { Sql_clausesContext clauses = b.sql_clauses(); if (clauses != null) { for (St_clauseContext st : clauses.st_clause()) { clause(st); } } } } private void clause(St_clauseContext st) { Ddl_clauseContext ddl = st.ddl_clause(); Dml_clauseContext dml; if (ddl != null) { ddl(ddl); } else if ((dml = st.dml_clause()) != null && dml.update_statement() != null) { dangerStatements.add(DangerStatement.UPDATE); } } private void ddl(Ddl_clauseContext ddl) { cz.startnet.utils.pgdiff.parsers.antlr.TSQLParser.Schema_alterContext alter = ddl.schema_alter(); cz.startnet.utils.pgdiff.parsers.antlr.TSQLParser.Schema_dropContext drop; if (alter != null) { Alter_tableContext at = alter.alter_table(); if (at != null) { if (at.DROP() != null && at.COLUMN() != null) { dangerStatements.add(DangerStatement.DROP_COLUMN); } else if (at.ALTER() != null && at.COLUMN() != null) { dangerStatements.add(DangerStatement.ALTER_COLUMN); } } else if (alter.alter_sequence() != null && !alter.alter_sequence().RESTART().isEmpty()) { dangerStatements.add(DangerStatement.RESTART_WITH); } } else if ((drop = ddl.schema_drop()) != null) { cz.startnet.utils.pgdiff.parsers.antlr.TSQLParser.Drop_statementsContext dropSt = drop.drop_statements(); if (dropSt != null && dropSt.TABLE() != null) { dangerStatements.add(DangerStatement.DROP_TABLE); } } } >>>>>>>
<<<<<<< import org.gluu.oxtrust.model.scim2.Group; import org.gluu.oxtrust.service.external.ExternalScimService; import org.gluu.oxtrust.util.CopyUtils2; import org.gluu.oxtrust.util.ServiceUtil; import org.gluu.persist.exception.mapping.EntryPersistenceException; import org.gluu.persist.exception.operation.DuplicateEntryException; import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormatter; ======= import org.gluu.oxtrust.model.scim2.BaseScimResource; import org.gluu.oxtrust.model.scim2.Meta; import org.gluu.oxtrust.model.scim2.group.GroupResource; import org.gluu.oxtrust.model.scim2.group.Member; import org.gluu.oxtrust.model.scim2.util.ScimResourceUtil; import org.gluu.oxtrust.service.antlr.scimFilter.ScimFilterParserService; import org.gluu.oxtrust.service.antlr.scimFilter.util.FilterUtil; import org.gluu.site.ldap.persistence.LdapEntryManager; >>>>>>> import org.gluu.oxtrust.model.scim2.Group; import org.gluu.oxtrust.service.external.ExternalScimService; import org.gluu.oxtrust.util.CopyUtils2; import org.gluu.oxtrust.util.ServiceUtil; import org.gluu.persist.exception.mapping.EntryPersistenceException; import org.gluu.persist.exception.operation.DuplicateEntryException; import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormatter; import org.gluu.oxtrust.model.scim2.BaseScimResource; import org.gluu.oxtrust.model.scim2.Meta; import org.gluu.oxtrust.model.scim2.group.GroupResource; import org.gluu.oxtrust.model.scim2.group.Member; import org.gluu.oxtrust.model.scim2.util.ScimResourceUtil; import org.gluu.oxtrust.service.antlr.scimFilter.ScimFilterParserService; import org.gluu.oxtrust.service.antlr.scimFilter.util.FilterUtil; import org.gluu.site.ldap.persistence.LdapEntryManager;
<<<<<<< @Override public void exitRule_common(Rule_commonContext ctx) { safeParseStatement(new CreateRule(ctx, db), ctx); } @Override public void exitCreate_fts_parser(Create_fts_parserContext ctx) { safeParseStatement(new CreateFtsParser(ctx, db), ctx); } @Override public void exitCreate_fts_template(Create_fts_templateContext ctx) { safeParseStatement(new CreateFtsTemplate(ctx, db), ctx); } @Override public void exitCreate_fts_dictionary(Create_fts_dictionaryContext ctx) { safeParseStatement(new CreateFtsDictionary(ctx, db), ctx); } @Override public void exitCreate_fts_configuration(Create_fts_configurationContext ctx) { safeParseStatement(new CreateFtsConfiguration(ctx, db), ctx); } @Override public void exitAlter_function_statement(Alter_function_statementContext ctx) { safeParseStatement(new AlterFunction(ctx, db), ctx); } @Override public void exitAlter_schema_statement(Alter_schema_statementContext ctx) { safeParseStatement(new AlterSchema(ctx, db), ctx); } @Override public void exitAlter_table_statement(Alter_table_statementContext ctx) { safeParseStatement(new AlterTable(ctx, db), ctx); } @Override public void exitAlter_sequence_statement(Alter_sequence_statementContext ctx) { safeParseStatement(new AlterSequence(ctx, db), ctx); } @Override public void exitAlter_view_statement(Alter_view_statementContext ctx) { safeParseStatement(new AlterView(ctx, db), ctx); } @Override public void exitAlter_type_statement(Alter_type_statementContext ctx) { safeParseStatement(new AlterType(ctx, db), ctx); } @Override public void exitAlter_domain_statement(Alter_domain_statementContext ctx) { safeParseStatement(new AlterDomain(ctx, db), ctx); } @Override public void exitAlter_fts_statement(Alter_fts_statementContext ctx) { safeParseStatement(new AlterFtsStatement(ctx, db), ctx); } public static AntlrError handleUnresolvedReference(UnresolvedReferenceException ex, String filename) { ======= static AntlrError handleUnresolvedReference(UnresolvedReferenceException ex, String filename) { >>>>>>> public static AntlrError handleUnresolvedReference(UnresolvedReferenceException ex, String filename) {
<<<<<<< if (ParserListenerMode.REF != mode && (confValueCtx.size() != 1 || !ApgdiffConsts.PG_CATALOG.equals(confValue))) { ======= if (!refMode && (vex.size() != 1 || !ApgdiffConsts.PG_CATALOG.equals(confValue))) { >>>>>>> if (ParserListenerMode.REF != mode && (vex.size() != 1 || !ApgdiffConsts.PG_CATALOG.equals(confValue))) {
<<<<<<< import java.text.MessageFormat; ======= import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.PlatformObject; >>>>>>> import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.PlatformObject; import java.text.MessageFormat;
<<<<<<< {"drop_statistics", false, false, false, false}, // Tests scenario where DEFAULT value is set on COLUMN. {"add_default_value", false, false, false, false}, ======= {"drop_statistics", false}, // Tests scenario where DEFAULT value is set on COLUMN. {"add_default_value", false}, >>>>>>> {"drop_statistics", false}, // Tests scenario where DEFAULT value is set on COLUMN. {"add_default_value", false}, <<<<<<< {"modify_default_value", false, false, false, false}, // Tests scenario where DEFAULT value is dropped from COLUMN. {"drop_default_value", false, false, false, false}, // Tests scenario where NOT NULL constraint is set on COLUMN. {"add_not_null", false, false, false, false}, ======= {"modify_default_value", false}, // Tests scenario where DEFAULT value is dropped from COLUMN. {"drop_default_value", false}, // Tests scenario where NOT NULL constraint is set on COLUMN. {"add_not_null", false}, >>>>>>> {"modify_default_value", false}, // Tests scenario where DEFAULT value is dropped from COLUMN. {"drop_default_value", false}, // Tests scenario where NOT NULL constraint is set on COLUMN. {"add_not_null", false}, <<<<<<< {"add_unique_constraint", false, false, false, false}, ======= {"add_unique_constraint", false}, >>>>>>> {"add_unique_constraint", false}, <<<<<<< // different INHERITS. {"modify_inherits", false, false, false, false}, // old inherited table is replaced by new and dropped {"modify_inherits_drop_oldparent", false, false, false, false}, ======= //different INHERITS. {"modify_inherits", false}, >>>>>>> //different INHERITS. {"modify_inherits", false}, <<<<<<< {"modify_sequence_start_ignore_off", false, false, false, false}, ======= {"modify_sequence_start_ignore_off", false}, {"modify_sequence_start_ignore_on", false}, >>>>>>> {"modify_sequence_start_ignore_off", false}, <<<<<<< {"modify_sequence_minvalue_set", false, false, false, false}, {"modify_sequence_minvalue_unset", false, false, false, false}, ======= {"modify_sequence_minvalue_set", false}, {"modify_sequence_minvalue_unset", false}, >>>>>>> {"modify_sequence_minvalue_set", false}, {"modify_sequence_minvalue_unset", false}, <<<<<<< {"modify_sequence_maxvalue_set", false, false, false, false}, {"modify_sequence_maxvalue_unset", false, false, false, false}, ======= {"modify_sequence_maxvalue_set", false}, {"modify_sequence_maxvalue_unset", false}, >>>>>>> {"modify_sequence_maxvalue_set", false}, {"modify_sequence_maxvalue_unset", false}, <<<<<<< {"modify_function_similar", false, false, false, false}, ======= {"modify_function_similar", false}, // Tests different whitespace formatting in functions {"function_equal_whitespace", false}, >>>>>>> {"modify_function_similar", false}, <<<<<<< {"modify_view", false, false, false, false}, ======= {"modify_view", false}, // Tests scenario where --add-defaults is specified. {"add_defaults", true}, >>>>>>> {"modify_view", false}, <<<<<<< // FIXME modify_inherits_drop_oldparent "modify_inherits_drop_oldparent" ======= "modify_sequence_start_ignore_on", "function_equal_whitespace" >>>>>>> // FIXME modify_inherits_drop_oldparent "modify_inherits_drop_oldparent"
<<<<<<< @Override protected Pair<StatementActions, GenericColumn> getActionAndObjForStmtAction() { List<IdentifierContext> ids = ctx.function_parameters().name.identifier(); return new Pair<>(StatementActions.CREATE, new GenericColumn( QNameParser.getSchemaName(ids), QNameParser.getFirstNameCtx(ids).getText(), ctx.PROCEDURE() != null ? DbObjType.PROCEDURE : DbObjType.FUNCTION)); } ======= @Override protected void fillDescrObj() { action = StatementActions.CREATE; List<IdentifierContext> ids = ctx.function_parameters().schema_qualified_name().identifier(); descrObj = new GenericColumn(QNameParser.getSchemaName(ids), QNameParser.getFirstNameCtx(ids).getText(), ctx.PROCEDURE() != null ? DbObjType.PROCEDURE : DbObjType.FUNCTION); } >>>>>>> @Override protected Pair<StatementActions, GenericColumn> getActionAndObjForStmtAction() { List<IdentifierContext> ids = ctx.function_parameters().schema_qualified_name().identifier(); return new Pair<>(StatementActions.CREATE, new GenericColumn( QNameParser.getSchemaName(ids), QNameParser.getFirstNameCtx(ids).getText(), ctx.PROCEDURE() != null ? DbObjType.PROCEDURE : DbObjType.FUNCTION)); }
<<<<<<< addObjReference(ctx.function_parameters().name.identifier(), type, ACTION_ALTER); ======= addObjReference(ctx.function_parameters().schema_qualified_name().identifier(), type, StatementActions.ALTER); >>>>>>> addObjReference(ctx.function_parameters().schema_qualified_name().identifier(), type, ACTION_ALTER); <<<<<<< IdentifierContext nameCtx = ctx.schema_with_name().name; addObjReference(Arrays.asList(nameCtx), DbObjType.SCHEMA, ACTION_ALTER); ======= addObjReference(Arrays.asList(ctx.identifier()), DbObjType.SCHEMA, StatementActions.ALTER); >>>>>>> addObjReference(Arrays.asList(ctx.identifier()), DbObjType.SCHEMA, ACTION_ALTER);
<<<<<<< public static final String CONFIGURATION = "/configuration"; public static final String STATUS = "/status"; ======= public static final String UMA = "/uma"; public static final String RESOURCES = "/resources"; >>>>>>> public static final String CONFIGURATION = "/configuration"; public static final String STATUS = "/status"; public static final String UMA = "/uma"; public static final String RESOURCES = "/resources";
<<<<<<< import org.eclipse.ui.ISharedImages; ======= import org.eclipse.ui.dialogs.PreferencesUtil; >>>>>>> import org.eclipse.ui.ISharedImages; import org.eclipse.ui.dialogs.PreferencesUtil; <<<<<<< Segments seg = (Segments)element; DbObjType type = seg.getType(); return type != null ? Activator.getDbObjImage(type) : Activator.getEclipseImage(ISharedImages.IMG_OBJ_FILE); ======= Segments seg = (Segments) element; return Activator.getDbObjImage(seg.getType()); >>>>>>> Segments seg = (Segments) element; DbObjType type = seg.getType(); return type != null ? Activator.getDbObjImage(type) : Activator.getEclipseImage(ISharedImages.IMG_OBJ_FILE);
<<<<<<< import java.util.Map; import java.util.function.Function; ======= >>>>>>> import java.util.Map; import java.util.function.Function; <<<<<<< import cz.startnet.utils.pgdiff.parsers.antlr.exception.UnresolvedReferenceException; ======= import cz.startnet.utils.pgdiff.parsers.antlr.expr.ValueExpr; import cz.startnet.utils.pgdiff.parsers.antlr.rulectx.Vex; >>>>>>> import cz.startnet.utils.pgdiff.parsers.antlr.expr.ValueExpr; import cz.startnet.utils.pgdiff.parsers.antlr.rulectx.Vex; import cz.startnet.utils.pgdiff.parsers.antlr.exception.UnresolvedReferenceException; <<<<<<< Map<String, GenericColumn> defaultFucntions) { ======= String defSchema) { >>>>>>> String defSchema) { <<<<<<< GenericColumn func = getFunctionCall( column_constraint.constr_body().default_expr); if (func != null) { defaultFucntions.put(colCtx.column_name.getText(), func); } ======= ValueExpr vex = new ValueExpr(defSchema); vex.analyze(new Vex(column_constraint.constr_body().default_expr)); col.addAllDeps(vex.getDepcies()); >>>>>>> ValueExpr vex = new ValueExpr(defSchema); vex.analyze(new Vex(column_constraint.constr_body().default_expr)); col.addAllDeps(vex.getDepcies()); <<<<<<< protected GenericColumn getFunctionCall(VexContext ctx) { FunctionSearcher fs = new FunctionSearcher(); ParseTreeWalker.DEFAULT.walk(fs, ctx); if (fs.getName() == null) { return null; } List<IdentifierContext> ids = fs.getName().identifier(); return new GenericColumn(QNameParser.getSchemaName(ids, getDefSchemaName()), QNameParser.getFirstName(ids), DbObjType.FUNCTION); } public static class FunctionSearcher extends SQLParserBaseListener { private Schema_qualified_nameContext fname; @Override public void enterFunction_call(Function_callContext ctx) { Schema_qualified_nameContext qname = ctx.schema_qualified_name(); String name = QNameParser.getFirstName(qname.identifier()); if (fname == null && !"nextval".equals(name)) { fname = qname; } } public Schema_qualified_nameContext getName() { return fname; } } ======= >>>>>>>
<<<<<<< ExceptionNotifier.showErrorDialog( MessageFormat.format(Messages.could_not_open_editor_for_file, file.getAbsolutePath()), e); ======= ExceptionNotifier.notifyDefault( Messages.could_not_open_editor_for_file + file.getAbsolutePath(), e); >>>>>>> ExceptionNotifier.notifyDefault( MessageFormat.format(Messages.could_not_open_editor_for_file, file.getAbsolutePath()), e);
<<<<<<< loader.setPrivileges(f, f.appendFunctionSignature(new StringBuilder(), false, true).toString(), res.getString("aclarray"), f.getOwner(), null, schemaName); ======= loader.setPrivileges(f, res.getString("aclarray")); >>>>>>> loader.setPrivileges(f, res.getString("aclarray"), schemaName);
<<<<<<< import ru.taximaxim.codekeeper.ui.sqledit.SqlSourceViewer; import cz.startnet.utils.pgdiff.PgDiffUtils; ======= import ru.taximaxim.codekeeper.ui.sqledit.SqlSourceViewerExtender; >>>>>>> import ru.taximaxim.codekeeper.ui.sqledit.SqlSourceViewerExtender; import cz.startnet.utils.pgdiff.PgDiffUtils;
<<<<<<< batches = loader.load().getObjReferences().get(name); ======= List<PgObjLocation> batches = loader.load().getObjDefinitions().get(name); // empty script won't add any lists to the definition map if (batches == null) { batches = Collections.emptyList(); } this.batches = batches; >>>>>>> List<PgObjLocation> batches = loader.load().getObjReferences().get(name); // empty script won't add any lists to the definition map if (batches == null) { batches = Collections.emptyList(); } this.batches = batches;
<<<<<<< {"authorization_schema", false}, // Test column privilege {"col_priv", false}, {"col_revoke_priv", false}, {"col_priv_new_tbl", false}, {"col_priv_tbl", false} ======= {"authorization_schema", false}, // Test privillege {"add_privilege", false}, {"drop_privilege", false}, {"chg_privilege", false}, // Test change owner {"chg_owner", false} >>>>>>> {"authorization_schema", false}, // Test column privilege {"col_priv", false}, {"col_revoke_priv", false}, {"col_priv_new_tbl", false}, {"col_priv_tbl", false}, // Test privilege {"add_privilege", false}, {"drop_privilege", false}, {"chg_privilege", false}, // Test change owner {"chg_owner", false}
<<<<<<< if (statement.getStatementType() == DbObjType.COLUMN) { PgStatement newTable = getObjectFromDB(statement.getParent(), newDb); if (newTable == null) { return true; } ======= } return false; } } /** * Используется для прохода по графу зависимостей для формирования * удаленных (DROP) объектов */ private class DropTraversalAdapter extends CustomTraversalListenerAdapter { DropTraversalAdapter(PgStatement starter) { super(starter, StatementActions.DROP); } @Override protected boolean notAllowedToAdd(PgStatement statement) { if (super.notAllowedToAdd(statement)) { return true; } if (statement.getParent().getStatementType() == DbObjType.TABLE) { if (statement instanceof PgForeignKey) { return false; } PgStatement newTable = getObjectFromDB(statement.getParent(), newDb); if (newTable == null) { return true; >>>>>>> if (statement.getStatementType() == DbObjType.COLUMN) { PgStatement newTable = getObjectFromDB(statement.getParent(), newDb); if (newTable == null) { return true; } <<<<<<< ======= // TODO Костыль не совсем рабочий, нужно проверить статус таблицы и // колонки, и если хотя бы одна из них удаляется то не дропать // сиквенс if (statement.getStatementType() == DbObjType.SEQUENCE) { PgSequence seq = (PgSequence)statement; if (seq.getOwnedBy() != null) { return true; } } return false; } } /** * Используется для прохода по графу зависимостей для формирования * измененных (ALTER) объектов */ private class AlterTraversalAdapter extends CustomTraversalListenerAdapter { AlterTraversalAdapter(PgStatement starter) { super(starter, StatementActions.ALTER); >>>>>>>
<<<<<<< public interface IProgressReporter extends AutoCloseable { ======= import java.util.List; public interface IProgressReporter { >>>>>>> import java.util.List; public interface IProgressReporter extends AutoCloseable { <<<<<<< @Override default void close() { terminate(); } ======= void showData(String query, List<List<Object>> Object); >>>>>>> void showData(String query, List<List<Object>> Object); @Override default void close() { terminate(); }
<<<<<<< String ICONWRITEOUTCONSOLE = "/icons/writeout_co.png"; //$NON-NLS-1$ ======= String ICONWRITEOUTCONSOLE = "/icons/writeout_co.gif"; //$NON-NLS-1$ String DDL_UPDATE_COMMANDS_HIST_FILENAME = "rollon_cmd_history.xml"; //$NON-NLS-1$ String IGNORED_OBJECTS = ".pgcodekeeperignore"; //$NON-NLS-1$ String ICONSAVECLIPBOARD = "/icons/save_clipboard.png"; //$NON-NLS-1$ String ICONSORTUP = "/icons/arrow_sort_up_%d.png"; //$NON-NLS-1$ String ICONSORTDOWN = "/icons/arrow_sort_down_%d.png"; //$NON-NLS-1$ String CODEKEEPEREDITOR = "codekeepereditor"; //$NON-NLS-1$ >>>>>>> String ICONWRITEOUTCONSOLE = "/icons/writeout_co.png"; //$NON-NLS-1$ String ICONSORTUP = "/icons/arrow_sort_up_%d.png"; //$NON-NLS-1$ String ICONSORTDOWN = "/icons/arrow_sort_down_%d.png"; //$NON-NLS-1$
<<<<<<< import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.FileDialog; ======= import org.eclipse.swt.widgets.Display; >>>>>>> <<<<<<< import org.eclipse.swt.widgets.Text; import org.eclipse.ui.ISharedImages; ======= >>>>>>> import org.eclipse.ui.ISharedImages; <<<<<<< import ru.taximaxim.codekeeper.ui.UiSync; import ru.taximaxim.codekeeper.ui.dbstore.DbPicker; ======= import ru.taximaxim.codekeeper.ui.dbstore.DbInfo; import ru.taximaxim.codekeeper.ui.dbstore.DbStorePicker; >>>>>>> import ru.taximaxim.codekeeper.ui.UiSync; import ru.taximaxim.codekeeper.ui.dbstore.DbInfo; import ru.taximaxim.codekeeper.ui.dbstore.DbStorePicker; <<<<<<< // flip button set up btnFlipDbPicker = new Button(containerDb, SWT.PUSH | SWT.FLAT); btnFlipDbPicker.setText("\u25B8"); //$NON-NLS-1$ gd = new GridData(GridData.FILL_VERTICAL); gd.widthHint = 20; btnFlipDbPicker.setLayoutData(gd); btnFlipDbPicker.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { flipDbPicker(containerSrc.getVisible()); } }); // middle right container containerSrc = new Composite(containerDb, SWT.NONE); gl = new GridLayout(2, false); gl.marginHeight = gl.marginWidth = 0; containerSrc.setLayout(gl); gd = new GridData(SWT.FILL, SWT.FILL, false, true); gd.widthHint = new PixelConverter(parent).convertWidthInCharsToPixels(45); containerSrc.setLayoutData(gd); Group grpSrc = new Group(containerSrc, SWT.NONE); grpSrc.setText(isProjSrc ? Messages.commitPartDescr_get_changes_from : Messages.diffPartDescr_get_changes_for); grpSrc.setLayout(new GridLayout(3, false)); btnDump = new Button(grpSrc, SWT.RADIO); btnDump.setText(Messages.dump); btnDump.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { showDbPicker(false); selectedDBSource = DBSources.SOURCE_TYPE_DUMP; lblSourceInfo.setText(getSourceInfoText()); containerUpper.layout(); } }); btnPgDump = new Button(grpSrc, SWT.RADIO); btnPgDump.setText(Messages.db); btnPgDump.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { showDbPicker(true); selectedDBSource = DBSources.SOURCE_TYPE_DB; lblSourceInfo.setText(getSourceInfoText()); containerUpper.layout(); } }); btnPgDump.setVisible(mainPrefs.getBoolean(PREF.PGDUMP_SWITCH)); btnJdbc = new Button(grpSrc, SWT.RADIO); btnJdbc.setText(Messages.jdbc); btnJdbc.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { showDbPicker(true); selectedDBSource = DBSources.SOURCE_TYPE_JDBC; lblSourceInfo.setText(getSourceInfoText()); containerUpper.layout(); } }); grpDump = new Group(containerSrc, SWT.NONE); grpDump.setText(Messages.newProjWizard_dump_file_source_settings); grpDump.setLayout(new GridLayout(2, false)); grpDump.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1)); l = new Label(grpDump, SWT.NONE); l.setText(Messages.path_to_db_schema_dump); gd = new GridData(); gd.horizontalSpan = 2; l.setLayoutData(gd); dumpDir = new Text(grpDump, SWT.BORDER); dumpDir.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Button dumpDirBtn = new Button(grpDump, SWT.PUSH); dumpDirBtn.setText(Messages.browse); dumpDirBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { FileDialog dialog = new FileDialog(getShell()); dialog.setText(Messages.choose_dump_file_with_changes); dialog.setFilterExtensions(new String[]{"*.sql", "*"}); //$NON-NLS-1$ //$NON-NLS-2$ dialog.setFilterNames(new String[]{ Messages.DiffPresentationPane_sql_file_filter, Messages.DiffPresentationPane_any_file_filter}); String filename = dialog.open(); if (filename != null) { dumpDir.setText(filename); } } }); dbSrc = new DbPicker(containerSrc, SWT.NONE, mainPrefs, false); dbSrc.setText(Messages.db_source); dbSrc.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1)); dbSrc.addListener(SWT.Modify, new Listener() { @Override public void handleEvent(Event event) { lblSourceInfo.setText(getSourceInfoText()); } }); boolean useDbPicker = false; selectedDBSource = DBSources.getEnum(projProps.get(PROJ_PREF.SOURCE, "")); //$NON-NLS-1$ switch (selectedDBSource) { case SOURCE_TYPE_DUMP: btnDump.setSelection(true); break; case SOURCE_TYPE_DB: btnPgDump.setSelection(true); useDbPicker = true; break; case SOURCE_TYPE_JDBC: btnJdbc.setSelection(true); useDbPicker = true; break; } showDbPicker(useDbPicker); dbSrc.getTxtDbName().setText(projProps.get(PROJ_PREF.DB_NAME, "")); //$NON-NLS-1$ dbSrc.getTxtDbUser().setText(projProps.get(PROJ_PREF.DB_USER, "")); //$NON-NLS-1$ dbSrc.getTxtDbHost().setText(projProps.get(PROJ_PREF.DB_HOST, "")); //$NON-NLS-1$ dbSrc.getTxtDbPort().setText(String.valueOf(projProps.getInt(PROJ_PREF.DB_PORT, 0))); // end middle right container // read flip position from preferences flipDbPicker(Activator.getDefault().getPreferenceStore().getBoolean(PREF.IS_FLIPPED_DB_SOURCE)); // end middle container lblSourceInfo.setText(getSourceInfoText()); ======= >>>>>>> <<<<<<< Activator.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent arg0) { //TODO btnPgDump.setVisible(mainPrefs.getBoolean(PREF.PGDUMP_SWITCH)); if (!btnPgDump.isVisible()){ btnJdbc.setSelection(true); } } }); ======= >>>>>>> <<<<<<< private void flipDbPicker(boolean open){ containerSrc.setVisible(!open); ((GridData) containerSrc.getLayoutData()).exclude = open; containerDb.layout(); btnFlipDbPicker.setText(open ? "\u25C2" // ◂ //$NON-NLS-1$ : "\u25B8"); // ▸ //$NON-NLS-1$ PreferenceInitializer.savePreference(Activator.getDefault().getPreferenceStore(), PREF.IS_FLIPPED_DB_SOURCE, String.valueOf(open)); } private String getSourceInfoText(){ StringBuilder value = new StringBuilder().append(Messages.source); switch (selectedDBSource) { case SOURCE_TYPE_DUMP: return value.append(Messages.dump_file).toString(); case SOURCE_TYPE_DB: value.append(Messages.pg_dump); break; case SOURCE_TYPE_JDBC: value.append(Messages.jdbc); break; } String preset = dbSrc.getSelectedDbPresetName(); if (preset == null){ value.append(" ").append(Messages.connection_details); //$NON-NLS-1$ value.append(dbSrc.getTxtDbUser().getText().isEmpty() ? "" : dbSrc.getTxtDbUser().getText() + '@'); //$NON-NLS-1$ value.append(dbSrc.getTxtDbHost().getText().isEmpty() ? Messages.unknown_host : dbSrc.getTxtDbHost().getText()); value.append(dbSrc.getTxtDbPort().getText().isEmpty() ? "" : ':' + dbSrc.getTxtDbPort().getText()); //$NON-NLS-1$ value.append('/'); value.append(dbSrc.getTxtDbName().getText().isEmpty() ? Messages.unknown_db : dbSrc.getTxtDbName().getText()); }else{ value.append(" ") //$NON-NLS-1$ .append(Messages.commitPartDescr_used_connection_template) .append('[').append(preset).append(']'); } return value.toString(); } private void showDbPicker(boolean show) { dbSrc.setVisible(show); grpDump.setVisible(!show); ((GridData) dbSrc.getLayoutData()).exclude = !show; ((GridData) grpDump.getLayoutData()).exclude = show; containerSrc.layout(false); } ======= >>>>>>>
<<<<<<< public String getInvitationGuid() { return invitationGuid; } public void setInvitationGuid(String invitationGuid) { this.invitationGuid = invitationGuid; } ======= public String getInvitationGuid() { return invitationGuid; } public String getInum() { return inum; } public String getRedirectUri() { return redirectUri; } >>>>>>> public String getInvitationGuid() { return invitationGuid; } public void setInvitationGuid(String invitationGuid) { this.invitationGuid = invitationGuid; } public String getRedirectUri() { return redirectUri; }
<<<<<<< public static StringBuilder appendOwnerSQL(PgStatement st, String owner, boolean addNewLine, StringBuilder sb) { if (owner == null) { ======= public static StringBuilder appendOwnerSQL(PgStatement st, String owner, StringBuilder sb) { if (owner == null || !st.isOwned()) { >>>>>>> public static StringBuilder appendOwnerSQL(PgStatement st, String owner, boolean addNewLine, StringBuilder sb) { if (owner == null || !st.isOwned()) {
<<<<<<< import java.util.stream.Collectors; ======= import java.util.function.Predicate; >>>>>>> import java.util.function.Predicate; import java.util.stream.Collectors;
<<<<<<< import ru.taximaxim.codekeeper.apgdiff.model.difftree.DbObjType; ======= import ru.taximaxim.codekeeper.apgdiff.model.difftree.TreeElement.DbObjType; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Body_rulesContext; >>>>>>> import ru.taximaxim.codekeeper.apgdiff.model.difftree.DbObjType; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Body_rulesContext;
<<<<<<< import cz.startnet.utils.pgdiff.schema.GenericColumn; ======= import cz.startnet.utils.pgdiff.schema.PgColumn; >>>>>>> import cz.startnet.utils.pgdiff.schema.GenericColumn; import cz.startnet.utils.pgdiff.schema.PgColumn; <<<<<<< @Override protected void fillDescrObj() { action = StatementActions.CREATE; List<IdentifierContext> ids = ctx.name.identifier(); descrObj = new GenericColumn(QNameParser.getSchemaName(ids), QNameParser.getFirstNameCtx(ids).getText(), DbObjType.TYPE); } ======= private AbstractColumn getColumn(Table_column_definitionContext colCtx) { AbstractColumn col = new PgColumn(colCtx.identifier().getText()); col.setType(getTypeName(colCtx.data_type())); addPgTypeDepcy(colCtx.data_type(), col); if (colCtx.collate_identifier() != null) { col.setCollation(getFullCtxText(colCtx.collate_identifier().collation)); } return col; } >>>>>>> private AbstractColumn getColumn(Table_column_definitionContext colCtx) { AbstractColumn col = new PgColumn(colCtx.identifier().getText()); col.setType(getTypeName(colCtx.data_type())); addPgTypeDepcy(colCtx.data_type(), col); if (colCtx.collate_identifier() != null) { col.setCollation(getFullCtxText(colCtx.collate_identifier().collation)); } return col; } @Override protected void fillDescrObj() { action = StatementActions.CREATE; List<IdentifierContext> ids = ctx.name.identifier(); descrObj = new GenericColumn(QNameParser.getSchemaName(ids), QNameParser.getFirstNameCtx(ids).getText(), DbObjType.TYPE); }
<<<<<<< FullAnalyze.fullAnalyze(d); ======= d.getSchema(ApgdiffConsts.PUBLIC).setLocation(inputObjectName); >>>>>>> d.getSchema(ApgdiffConsts.PUBLIC).setLocation(inputObjectName); FullAnalyze.fullAnalyze(d);
<<<<<<< import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.JobChangeAdapter; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress; ======= >>>>>>> <<<<<<< import org.eclipse.swt.widgets.MessageBox; import org.eclipse.ui.ISharedImages; ======= >>>>>>> import org.eclipse.ui.ISharedImages; <<<<<<< import ru.taximaxim.codekeeper.ui.PgCodekeeperUIException; ======= import ru.taximaxim.codekeeper.ui.UIConsts.DBSources; >>>>>>> <<<<<<< import ru.taximaxim.codekeeper.ui.UIConsts.PLUGIN_ID; import ru.taximaxim.codekeeper.ui.UIConsts.PROJ_PREF; import ru.taximaxim.codekeeper.ui.UiSync; import ru.taximaxim.codekeeper.ui.dbstore.DbInfo; ======= >>>>>>> import ru.taximaxim.codekeeper.ui.UIConsts.PROJ_PREF; import ru.taximaxim.codekeeper.ui.dbstore.DbInfo; <<<<<<< createUpperContainer(contUpperLeft, gl); ======= createUpperContainer(contUpperLeft, gl); storePicker = new DbStorePicker(containerUpper, SWT.NONE, false, mainPrefs, true); >>>>>>> createUpperContainer(contUpperLeft, gl); <<<<<<< btnGetChanges.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); btnGetChanges.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { try { IRunnableWithProgress runRefresh = new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { proj.getProject().refreshLocal(IResource.DEPTH_INFINITE, SubMonitor.convert(monitor)); monitor.done(); } catch (CoreException ex) { throw new InvocationTargetException(ex, ex.getLocalizedMessage()); } } }; try { new ProgressMonitorDialog(getShell()).run(true, true, runRefresh); } catch (InterruptedException ex) { // cancelled return; } if (fillDbSources(proj)) { showNotificationArea(false); reset(); loadChanges(); saveDBPrefs(proj.getPrefs()); } } catch (PgCodekeeperUIException | CoreException | InvocationTargetException e1) { ExceptionNotifier.notifyDefault( Messages.DiffPresentationPane_error_loading_changes, e1); } catch (BackingStoreException e1) { ExceptionNotifier.notifyDefault( Messages.DiffPresentationPane_cannotSaveDbPropToProjProps, e1); } } }); ======= gd = new GridData(SWT.RIGHT, SWT.FILL, false, true); gd.widthHint = btnGetChanges.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; gd.minimumWidth = btnGetChanges.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; gd.horizontalIndent = 20; btnGetChanges.setLayoutData(gd); >>>>>>> btnGetChanges.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); <<<<<<< private void saveDBPrefs(IEclipsePreferences projProps) throws BackingStoreException { DbInfo storeDB = storePicker.getDbInfo(); if (storeDB != null) { projProps.put(PROJ_PREF.LAST_DB_STORE, storeDB.toString()); projProps.flush(); } } private boolean fillDbSources(PgDbProject proj) throws PgCodekeeperUIException, CoreException { if (!OpenProjectUtils.checkVersionAndWarn(proj.getProject(), getShell(), true)) { return false; } IEclipsePreferences projProps = proj.getPrefs(); boolean forceUnixNewlines = projProps.getBoolean(PROJ_PREF.FORCE_UNIX_NEWLINES, true); DbSource dbsProj, dbsRemote; dbsProj = DbSource.fromProject(proj); DbInfo storeDB = storePicker.getDbInfo(); File dumpfile; if (storeDB != null) { dbsRemote = DbSource.fromDbInfo(storeDB, mainPrefs, forceUnixNewlines, proj.getProjectCharset(), projProps.get(PROJ_PREF.TIMEZONE, ApgdiffConsts.UTC)); } else if ((dumpfile = storePicker.getPathOfFile()) != null) { dbsRemote = DbSource.fromFile(forceUnixNewlines, dumpfile, proj.getProjectCharset()); } else { MessageBox mb = new MessageBox(getShell(), SWT.ICON_WARNING); mb.setText(Messages.DiffPresentationPane_cannot_get_changes); mb.setMessage(Messages.DiffPresentationPane_select_db_source); mb.open(); return false; } setDbSource(isProjSrc ? dbsProj : dbsRemote); setDbTarget(isProjSrc ? dbsRemote : dbsProj); return true; } private void loadChanges() { Log.log(Log.LOG_INFO, "Getting changes for diff"); //$NON-NLS-1$ final TreeDiffer newDiffer = new TreeDiffer(dbSource, dbTarget); Job job = new Job(Messages.diffPresentationPane_getting_changes_for_diff) { @Override protected IStatus run(IProgressMonitor monitor) { try { newDiffer.run(monitor); } catch (InvocationTargetException e) { return new Status(Status.ERROR, PLUGIN_ID.THIS, Messages.error_in_differ_thread, e); } catch (InterruptedException e) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; } }; job.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { if (event.getResult().isOK()) { UiSync.exec(DiffPresentationPane.this, new Runnable() { @Override public void run() { if (DiffPresentationPane.this.isDisposed()) { return; } treeDiffer = newDiffer; diffTable.setInput(newDiffer, !isProjSrc); diffPane.setInput(null); diffLoaded(); } }); } } }); job.setUser(true); job.schedule(); } ======= >>>>>>> <<<<<<< public void showNotificationArea(boolean visible) { ======= public void reset() { clearInputs(); if (dbTarget != null && dbSource != null) { showNotificationArea(true); } } public void showNotificationArea(boolean visible) { >>>>>>> public void showNotificationArea(boolean visible) {
<<<<<<< private void initRepoFromSource(SubMonitor pm)throws InvocationTargetException, InterruptedException, CoreException, IOException { ======= private void initRepoFromSource(SubMonitor pm) throws InterruptedException, CoreException, IOException, LicenseException { >>>>>>> private void initRepoFromSource(SubMonitor pm) throws InterruptedException, CoreException, IOException {
<<<<<<< import cz.startnet.utils.pgdiff.parsers.antlr.expr.launcher.ConstraintAnalysisLauncher; import cz.startnet.utils.pgdiff.parsers.antlr.expr.launcher.VexAnalysisLauncher; import cz.startnet.utils.pgdiff.schema.AbstractColumn; ======= >>>>>>> import cz.startnet.utils.pgdiff.parsers.antlr.expr.launcher.ConstraintAnalysisLauncher; import cz.startnet.utils.pgdiff.parsers.antlr.expr.launcher.VexAnalysisLauncher; <<<<<<< db.addAnalysisLauncher(new ConstraintAnalysisLauncher(constr, expCtx)); ======= db.addContextForAnalyze(constr, expCtx); } else if (body.identity_body() != null) { Identity_bodyContext identity = body.identity_body(); String name = table.getName() + '_' + col.getName() + "_seq"; for (Sequence_bodyContext bodyCtx : identity.sequence_body()) { if (bodyCtx.NAME() != null) { name = QNameParser.getFirstName(bodyCtx.name.identifier()); } } PgSequence sequence = new PgSequence(name); sequence.setDataType(col.getType()); CreateSequence.fillSequence(sequence, identity.sequence_body()); col.setSequence(sequence); col.setIdentityType(identity.ALWAYS() != null ? "ALWAYS" : "BY DEFAULT"); >>>>>>> db.addAnalysisLauncher(new ConstraintAnalysisLauncher(constr, expCtx)); } else if (body.identity_body() != null) { Identity_bodyContext identity = body.identity_body(); String name = table.getName() + '_' + col.getName() + "_seq"; for (Sequence_bodyContext bodyCtx : identity.sequence_body()) { if (bodyCtx.NAME() != null) { name = QNameParser.getFirstName(bodyCtx.name.identifier()); } } PgSequence sequence = new PgSequence(name); sequence.setDataType(col.getType()); CreateSequence.fillSequence(sequence, identity.sequence_body()); col.setSequence(sequence); col.setIdentityType(identity.ALWAYS() != null ? "ALWAYS" : "BY DEFAULT");
<<<<<<< import cz.startnet.utils.pgdiff.schema.StatementActions; import ru.taximaxim.codekeeper.apgdiff.model.difftree.DbObjType; ======= import ru.taximaxim.codekeeper.apgdiff.ApgdiffConsts; import ru.taximaxim.codekeeper.apgdiff.model.difftree.DbObjType; import ru.taximaxim.codekeeper.apgdiff.utils.Pair; >>>>>>> import cz.startnet.utils.pgdiff.schema.StatementActions; import ru.taximaxim.codekeeper.apgdiff.ApgdiffConsts; import ru.taximaxim.codekeeper.apgdiff.model.difftree.DbObjType; import ru.taximaxim.codekeeper.apgdiff.utils.Pair;
<<<<<<< addSafe(schema, func, ids); ======= schemaName = getSchemaNameSafe(ids); >>>>>>> schemaName = getSchemaNameSafe(ids); <<<<<<< addSafe(schema, func, ids); ======= addSafe(AbstractSchema::addFunction, schema, f, ids); >>>>>>> addSafe(schema, f, ids);
<<<<<<< String ICONEMPTYFILTER = "/icons/empty_filter.png"; //$NON-NLS-1$ String ICONFILTER = "/icons/filter_tsk.png"; //$NON-NLS-1$ ======= String ICONFILE = "/icons/file_obj.png"; //$NON-NLS-1$ String ICONCHECK = "/icons/header_complete.gif"; //$NON-NLS-1$ >>>>>>> String ICONFILE = "/icons/file_obj.png"; //$NON-NLS-1$ String ICONCHECK = "/icons/header_complete.gif"; //$NON-NLS-1$ String ICONEMPTYFILTER = "/icons/empty_filter.png"; //$NON-NLS-1$ String ICONFILTER = "/icons/filter_tsk.png"; //$NON-NLS-1$
<<<<<<< if (arguments.isMsSql()) { loadMsStructure(iProject, db); } else { loadPgStructure(iProject, db); } AntlrParser.finishAntlr(antlrTasks); ======= loadPgStructure(iProject, db); finishLoaders(); >>>>>>> if (arguments.isMsSql()) { loadMsStructure(iProject, db); } else { loadPgStructure(iProject, db); } finishLoaders(); <<<<<<< List<AntlrError> errList = null; try (PgUIDumpLoader loader = new PgUIDumpLoader(file, arguments, monitor)) { errList = loader.getErrors(); if (isOverrideMode) { loader.setOverridesMap(overrides); } loader.loadFile(db, antlrTasks); if (statementBodies != null) { statementBodies.addAll(loader.getStatementBodyReferences()); } } finally { if (errors != null && errList != null && !errList.isEmpty()) { errors.addAll(errList); } ======= PgUIDumpLoader loader = new PgUIDumpLoader(file, arguments, monitor); loader.setLoadReferences(statementBodies != null); if (isOverrideMode) { loader.setOverridesMap(overrides); >>>>>>> PgUIDumpLoader loader = new PgUIDumpLoader(file, arguments, monitor); if (isOverrideMode) { loader.setOverridesMap(overrides); <<<<<<< .forEach(st -> newDb.addSchema(st.deepCopy())); newDb.getObjReferences().putAll(db.getObjReferences()); newDb.getObjDefinitions().putAll(db.getObjDefinitions()); ======= .forEach(st -> newDb.addSchema(st.deepCopy())); >>>>>>> .forEach(st -> newDb.addSchema(st.deepCopy())); newDb.getObjReferences().putAll(db.getObjReferences()); newDb.getObjDefinitions().putAll(db.getObjDefinitions());
<<<<<<< alterPrivileges(newView, sb); ======= addPrivilegeScript(oldView, newView, sb); >>>>>>> alterPrivileges(newView, sb); <<<<<<< && Objects.equals(columnComments, view.getColumnComments()); ======= && Objects.equals(columnComments, view.getColumnComments()) && new HashSet<>(rules).equals(new HashSet<>(view.rules)) && new HashSet<>(triggers).equals(new HashSet<>(view.triggers)); >>>>>>> && Objects.equals(columnComments, view.getColumnComments()); <<<<<<< ======= /** * Finds rule according to specified rule {@code name}. * * @param name name of the rule to be searched * * @return found rule or null if no such rule has been found */ public PgRule getRule(final String name) { for (PgRule rule : rules) { if (rule.getName().equals(name)) { return rule; } } return null; } public List<PgRule> getRules() { return Collections.unmodifiableList(rules); } public void addRule(final PgRule rule) { rules.add(rule); rule.setParent(this); resetHash(); } /** * Finds trigger according to specified rule {@code name}. * * @param name name of the trigger to be searched * * @return found trigger or null if no such trigger has been found */ public PgTrigger getTrigger(final String name) { for (PgTrigger trigger : triggers) { if (trigger.getName().equals(name)) { return trigger; } } return null; } public List<PgTrigger> getTriggers() { return Collections.unmodifiableList(triggers); } public void addTrigger(final PgTrigger trigger) { triggers.add(trigger); trigger.setParent(this); resetHash(); } >>>>>>>
<<<<<<< loadDatabase(d); ======= d.getSchema(schema.getName()).setLocation(inputObjectName); Queue<AntlrTask<?>> antlrTasks = new ArrayDeque<>(1); loadDatabase(d, antlrTasks); AntlrParser.finishAntlr(antlrTasks); >>>>>>> Queue<AntlrTask<?>> antlrTasks = new ArrayDeque<>(1); loadDatabase(d, antlrTasks); AntlrParser.finishAntlr(antlrTasks); <<<<<<< monitor, monitoringLevel, listener); ======= monitor, monitoringLevel, listeners, antlrTasks); >>>>>>> monitor, monitoringLevel, listener, antlrTasks); <<<<<<< ======= isInputInAntlrParser = true; >>>>>>> isInputInAntlrParser = true; <<<<<<< monitor, monitoringLevel, listener); ======= monitor, monitoringLevel, listeners, antlrTasks); >>>>>>> monitor, monitoringLevel, listener, antlrTasks);
<<<<<<< import cz.startnet.utils.pgdiff.schema.AbstractTable; ======= import cz.startnet.utils.pgdiff.schema.AbstractTable; import cz.startnet.utils.pgdiff.schema.IRelation; >>>>>>> import cz.startnet.utils.pgdiff.schema.AbstractTable; import cz.startnet.utils.pgdiff.schema.IRelation; <<<<<<< PgObjLocation loc = addFullObjReference(ids, DbObjType.TABLE, StatementActions.ALTER); ======= PgObjLocation loc = addObjReference(ids, DbObjType.TABLE, StatementActions.ALTER); >>>>>>> PgObjLocation loc = addObjReference(ids, DbObjType.TABLE, StatementActions.ALTER); <<<<<<< if (tablAction.column != null && tablAction.DROP() != null) { loc.setWarningText(DangerStatement.DROP_COLUMN); } else if (tablAction.datatype != null) { loc.setWarningText(DangerStatement.ALTER_COLUMN); } // for owners try to get any relation, fail if the last attempt fails ======= if (tablAction.column != null && tablAction.DROP() != null) { loc.setWarningText(PgObjLocation.DROP_COLUMN); } else if (tablAction.datatype != null) { loc.setWarningText(PgObjLocation.ALTER_COLUMN_TYPE); } >>>>>>> if (tablAction.column != null && tablAction.DROP() != null) { loc.setWarningText(DangerStatement.DROP_COLUMN); } else if (tablAction.datatype != null) { loc.setWarningText(DangerStatement.ALTER_COLUMN); } <<<<<<< String name = nameCtx.getText(); PgStatement st = schema.getTable(name); if (st == null) { st = schema.getSequence(name); } if (st == null) { st = getSafe(AbstractSchema::getView, schema, nameCtx); } if (st != null) { fillOwnerTo(tablAction.owner_to(), st); ======= IRelation r = getSafe(AbstractSchema::getRelation, schema, nameCtx); if (r instanceof PgStatement) { fillOwnerTo(tablAction.owner_to(), (PgStatement) r); >>>>>>> IRelation r = getSafe(AbstractSchema::getRelation, schema, nameCtx); if (r instanceof PgStatement) { fillOwnerTo(tablAction.owner_to(), (PgStatement) r); <<<<<<< tabl = (AbstractPgTable) getSafe(AbstractSchema::getTable, schema, nameCtx); if (tablAction.tabl_constraint != null) { AbstractConstraint con = parseAlterTableConstraint(tablAction, createTableConstraintBlank(tablAction.tabl_constraint), db, schema.getName(), nameCtx.getText()); if (!con.getName().isEmpty()) { fillObjDefinition(new PgObjLocation(loc.schema, loc.table, con.getName(), DbObjType.CONSTRAINT), tablAction.tabl_constraint, con); } tabl.addConstraint(con); } if (tablAction.drop_constraint() != null) { IdentifierContext conName = tablAction.drop_constraint().constraint_name; addObjReference(new PgObjLocation(loc.schema, loc.table, conName.getText(), DbObjType.CONSTRAINT), StatementActions.DROP, conName); } if (isRefMode()) { continue; } ======= tabl = (AbstractPgTable) getSafe(AbstractSchema::getTable, schema, nameCtx); if (tablAction.tabl_constraint != null) { IdentifierContext conNameCtx = tablAction.tabl_constraint.constraint_name; AbstractConstraint con = parseAlterTableConstraint(tablAction, createTableConstraintBlank(tablAction.tabl_constraint), db, getSchemaNameSafe(ids), nameCtx.getText()); if (!con.getName().isEmpty()) { addSafe(AbstractPgTable::addConstraint, tabl, con, Arrays.asList( QNameParser.getSchemaNameCtx(ids), nameCtx, conNameCtx)); } else { doSafe(AbstractPgTable::addConstraint, tabl, con); } } if (tablAction.drop_constraint() != null) { addObjReference(Arrays.asList(QNameParser.getSchemaNameCtx(ids), nameCtx, tablAction.drop_constraint().constraint_name), DbObjType.CONSTRAINT, StatementActions.DROP); } if (isRefMode()) { continue; } >>>>>>> tabl = (AbstractPgTable) getSafe(AbstractSchema::getTable, schema, nameCtx); if (tablAction.tabl_constraint != null) { IdentifierContext conNameCtx = tablAction.tabl_constraint.constraint_name; AbstractConstraint con = parseAlterTableConstraint(tablAction, createTableConstraintBlank(tablAction.tabl_constraint), db, getSchemaNameSafe(ids), nameCtx.getText()); if (!con.getName().isEmpty()) { addSafe(AbstractPgTable::addConstraint, tabl, con, Arrays.asList( QNameParser.getSchemaNameCtx(ids), nameCtx, conNameCtx)); } else { doSafe(AbstractPgTable::addConstraint, tabl, con); } } if (tablAction.drop_constraint() != null) { addObjReference(Arrays.asList(QNameParser.getSchemaNameCtx(ids), nameCtx, tablAction.drop_constraint().constraint_name), DbObjType.CONSTRAINT, StatementActions.DROP); } if (isRefMode()) { continue; }
<<<<<<< DbSource dbSource = DbSource.fromFile(true, sourceFile, ApgdiffConsts.UTF_8); DbSource dbTarget = DbSource.fromFile(true, targetFile, ApgdiffConsts.UTF_8); ======= DbSource dbSource = DbSource.fromFile(true, sourceFile.getAbsolutePath(), ApgdiffConsts.UTF_8, ApgdiffConsts.UTC); DbSource dbTarget = DbSource.fromFile(true, targetFile.getAbsolutePath(), ApgdiffConsts.UTF_8, ApgdiffConsts.UTC); >>>>>>> DbSource dbSource = DbSource.fromFile(true, sourceFile, ApgdiffConsts.UTF_8, ApgdiffConsts.UTC); DbSource dbTarget = DbSource.fromFile(true, targetFile, ApgdiffConsts.UTF_8, ApgdiffConsts.UTC);
<<<<<<< import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Ordinary_grouping_setContext; import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Perform_stmtContext; ======= >>>>>>> import cz.startnet.utils.pgdiff.parsers.antlr.SQLParser.Perform_stmtContext; <<<<<<< groupBy(groupBy, vex); ======= groupby(groupBy.grouping_element_list(), vex); >>>>>>> groupby(groupBy.grouping_element_list(), vex); <<<<<<< private void sublist(List<Select_sublistContext> sublist, ValueExpr vex, List<Pair<String, String>> ret) { for (Select_sublistContext target : sublist) { Vex selectSublistVex = new Vex(target.vex()); Qualified_asteriskContext ast; Value_expression_primaryContext valExprPrimary = selectSublistVex.primary(); if (valExprPrimary != null && (ast = valExprPrimary.qualified_asterisk()) != null) { Schema_qualified_nameContext qNameAst = ast.tb_name; ret.addAll(qNameAst == null ? unqualAster() : qualAster(qNameAst)); } else { Pair<String, String> columnPair = vex.analyze(selectSublistVex); IdentifierContext id = target.identifier(); ParserRuleContext aliasCtx = id != null ? id : target.id_token(); if (aliasCtx != null) { columnPair.setFirst(aliasCtx.getText()); } ret.add(columnPair); } } } private void groupBy(Groupby_clauseContext groupBy, ValueExpr vex) { for (Grouping_elementContext group : groupBy.grouping_element_list().grouping_element()) { Ordinary_grouping_setContext groupingSet = group.ordinary_grouping_set(); Grouping_set_listContext groupingSets; if (groupingSet != null) { groupingSet(groupingSet, vex); } else if ((groupingSets = group.grouping_set_list()) != null) { for (Ordinary_grouping_setContext groupingSubset : groupingSets.ordinary_grouping_set_list().ordinary_grouping_set()) { groupingSet(groupingSubset, vex); } } } } ======= private void groupby(Grouping_element_listContext list, ValueExpr vex) { for (Grouping_elementContext el : list.grouping_element()) { VexContext vexCtx = el.vex(); Grouping_element_listContext sub; if (vexCtx != null) { vex.analyze(new Vex(vexCtx)); } else if ((sub = el.c) != null) { groupby(sub, vex); } } } >>>>>>> private void sublist(List<Select_sublistContext> sublist, ValueExpr vex, List<Pair<String, String>> ret) { for (Select_sublistContext target : sublist) { Vex selectSublistVex = new Vex(target.vex()); Qualified_asteriskContext ast; Value_expression_primaryContext valExprPrimary = selectSublistVex.primary(); if (valExprPrimary != null && (ast = valExprPrimary.qualified_asterisk()) != null) { Schema_qualified_nameContext qNameAst = ast.tb_name; ret.addAll(qNameAst == null ? unqualAster() : qualAster(qNameAst)); } else { Pair<String, String> columnPair = vex.analyze(selectSublistVex); IdentifierContext id = target.identifier(); ParserRuleContext aliasCtx = id != null ? id : target.id_token(); if (aliasCtx != null) { columnPair.setFirst(aliasCtx.getText()); } ret.add(columnPair); } } } private void groupby(Grouping_element_listContext list, ValueExpr vex) { for (Grouping_elementContext el : list.grouping_element()) { VexContext vexCtx = el.vex(); Grouping_element_listContext sub; if (vexCtx != null) { vex.analyze(new Vex(vexCtx)); } else if ((sub = el.c) != null) { groupby(sub, vex); } } }
<<<<<<< import ru.taximaxim.codekeeper.ui.PgCodekeeperUIException; import ru.taximaxim.codekeeper.ui.dialogs.ExceptionNotifier; import ru.taximaxim.codekeeper.ui.editors.ProjectEditor; ======= import ru.taximaxim.codekeeper.ui.UIConsts.EDITOR; >>>>>>> import ru.taximaxim.codekeeper.ui.PgCodekeeperUIException; import ru.taximaxim.codekeeper.ui.UIConsts.EDITOR; import ru.taximaxim.codekeeper.ui.dialogs.ExceptionNotifier;
<<<<<<< import ru.taximaxim.codekeeper.apgdiff.licensing.LicenseException; import ru.taximaxim.codekeeper.apgdiff.model.difftree.DbObjType; ======= >>>>>>> import ru.taximaxim.codekeeper.apgdiff.model.difftree.DbObjType; <<<<<<< dbAnalyze(d); args.getLicense().verifyDb(d); ======= >>>>>>> dbAnalyze(d); <<<<<<< dbAnalyze(db); arguments.getLicense().verifyDb(db); ======= >>>>>>> dbAnalyze(db);
<<<<<<< import net.minecraft.util.ResourceLocation; import net.minecraft.world.storage.WorldSavedData; ======= import net.minecraft.world.WorldSavedData; >>>>>>> import net.minecraft.world.storage.WorldSavedData;
<<<<<<< import net.minecraft.client.util.math.MatrixStack; ======= import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.client.util.math.MatrixStack; >>>>>>> import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.client.util.math.MatrixStack; <<<<<<< import net.minecraft.text.TranslatableText; ======= import net.minecraft.sound.SoundEvents; >>>>>>> import net.minecraft.sound.SoundEvents; import net.minecraft.text.TranslatableText; <<<<<<< atlasID, player.world.getDimensionRegistryKey(), ======= atlasID, player.getEntityWorld().getDimensionRegistryKey(), >>>>>>> atlasID, player.getEntityWorld().getDimensionRegistryKey(), <<<<<<< double mouseOffsetX = MinecraftClient.getInstance().getWindow().getFramebufferWidth() / screenScale / 2 - getMouseX(); double mouseOffsetY = MinecraftClient.getInstance().getWindow().getFramebufferHeight() / screenScale / 2 - getMouseY(); ======= double mouseOffsetX = MinecraftClient.getInstance().getWindow().getFramebufferWidth() / screenScale / 2 - getMouseX(); double mouseOffsetY = MinecraftClient.getInstance().getWindow().getFramebufferHeight() / screenScale / 2 - getMouseY(); >>>>>>> double mouseOffsetX = MinecraftClient.getInstance().getWindow().getFramebufferWidth() / screenScale / 2 - getMouseX(); double mouseOffsetY = MinecraftClient.getInstance().getWindow().getFramebufferHeight() / screenScale / 2 - getMouseY(); <<<<<<< .getDimensionData(player.world.getDimensionRegistryKey()); ======= .getDimensionData(player.getEntityWorld().getDimensionRegistryKey()); >>>>>>> .getDimensionData(player.getEntityWorld().getDimensionRegistryKey()); <<<<<<< .getMarkersDataInDimension(player.world.getDimensionRegistryKey()); ======= .getMarkersDataInDimension(player.getEntityWorld().getDimensionRegistryKey()); >>>>>>> .getMarkersDataInDimension(player.getEntityWorld().getDimensionRegistryKey()); <<<<<<< .getMarkersDataInDimension(player.world.getDimensionRegistryKey()); ======= .getMarkersDataInDimension(player.getEntityWorld().getDimensionRegistryKey()); >>>>>>> .getMarkersDataInDimension(player.getEntityWorld().getDimensionRegistryKey()); <<<<<<< public void render(MatrixStack matrix, int mouseX, int mouseY, float par3) { ======= public void render(MatrixStack matrices, int mouseX, int mouseY, float par3) { >>>>>>> public void render(MatrixStack matrices, int mouseX, int mouseY, float par3) { <<<<<<< super.renderBackground(matrix); ======= super.renderBackground(matrices); >>>>>>> super.renderBackground(matrices); <<<<<<< AtlasRenderHelper.drawFullTexture(Textures.BOOK_FRAME, getGuiX(), getGuiY(), WIDTH, HEIGHT); renderScaleOverlay(matrix, deltaMillis); ======= AtlasRenderHelper.drawFullTexture(matrices, Textures.BOOK_FRAME, getGuiX(), getGuiY(), WIDTH, HEIGHT); renderScaleOverlay(matrices, deltaMillis); >>>>>>> AtlasRenderHelper.drawFullTexture(matrices, Textures.BOOK_FRAME, getGuiX(), getGuiY(), WIDTH, HEIGHT); renderScaleOverlay(matrices, deltaMillis); <<<<<<< super.render(matrix, mouseX, mouseY, par3); ======= super.render(matrices, mouseX, mouseY, par3); >>>>>>> super.render(matrices, mouseX, mouseY, par3); <<<<<<< xWidth = textWidth = textRenderer.getWidth(text); xWidth++; textRenderer.draw(matrix, text, -textWidth, 0, scaleAlpha << 24); ======= xWidth = textWidth = this.textRenderer.getWidth(text); xWidth++; this.textRenderer.draw(matrices, text, -textWidth, 0, scaleAlpha << 24); >>>>>>> xWidth = textWidth = this.textRenderer.getWidth(text); xWidth++; this.textRenderer.draw(matrices, text, -textWidth, 0, scaleAlpha << 24); <<<<<<< int centerXtranslate = Math.max(textRenderer.getWidth(parts[0]), textRenderer.getWidth(parts[1]) )/2; GlStateManager.translatef(-xWidth-centerXtranslate, -textRenderer.fontHeight/2, 0); ======= int centerXtranslate = Math.max(this.textRenderer.getWidth(parts[0]), this.textRenderer.getWidth(parts[1]) )/2; GlStateManager.translatef(-xWidth-centerXtranslate, (float)-this.textRenderer.fontHeight/2, 0); >>>>>>> int centerXtranslate = Math.max(this.textRenderer.getWidth(parts[0]), this.textRenderer.getWidth(parts[1]) )/2; GlStateManager.translatef(-xWidth-centerXtranslate, (float)-this.textRenderer.fontHeight/2, 0); <<<<<<< vb.vertex( centerXtranslate, textRenderer.fontHeight - 1, 0.0D).next(); vb.vertex(-centerXtranslate-1, textRenderer.fontHeight - 1, 0.0D).next(); vb.vertex(-centerXtranslate-1, textRenderer.fontHeight , 0.0D).next(); vb.vertex( centerXtranslate, textRenderer.fontHeight , 0.0D).next(); ======= vb.vertex( centerXtranslate, this.textRenderer.fontHeight - 1, 0.0D).next(); vb.vertex(-centerXtranslate-1, this.textRenderer.fontHeight - 1, 0.0D).next(); vb.vertex(-centerXtranslate-1, this.textRenderer.fontHeight , 0.0D).next(); vb.vertex( centerXtranslate, this.textRenderer.fontHeight , 0.0D).next(); >>>>>>> vb.vertex( centerXtranslate, this.textRenderer.fontHeight - 1, 0.0D).next(); vb.vertex(-centerXtranslate-1, this.textRenderer.fontHeight - 1, 0.0D).next(); vb.vertex(-centerXtranslate-1, this.textRenderer.fontHeight , 0.0D).next(); vb.vertex( centerXtranslate, this.textRenderer.fontHeight , 0.0D).next(); <<<<<<< textWidth = textRenderer.getWidth(text); textRenderer.draw(matrix, text, -textWidth/2, 0, scaleAlpha << 24); ======= textWidth = this.textRenderer.getWidth(text); this.textRenderer.draw(matrices, text, (float)-textWidth/2, 0, scaleAlpha << 24); >>>>>>> textWidth = this.textRenderer.getWidth(text); this.textRenderer.draw(matrices, text, (float)-textWidth/2, 0, scaleAlpha << 24); <<<<<<< textWidth = textRenderer.getWidth(text); textRenderer.draw(matrix, text, -textWidth-xWidth + 1, 1, scaleAlpha << 24); ======= textWidth = this.textRenderer.getWidth(text); this.textRenderer.draw(matrices, text, -textWidth-xWidth + 1, 2, scaleAlpha << 24); >>>>>>> textWidth = this.textRenderer.getWidth(text); this.textRenderer.draw(matrices, text, -textWidth-xWidth + 1, 2, scaleAlpha << 24); <<<<<<< PacketDispatcher.sendToServer(new BrowsingPositionPacket(getAtlasID(), player.world.getDimensionRegistryKey(), mapOffsetX, mapOffsetY, mapScale)); ======= PacketDispatcher.sendToServer(new BrowsingPositionPacket(getAtlasID(), player.getEntityWorld().getDimensionRegistryKey(), mapOffsetX, mapOffsetY, mapScale)); >>>>>>> PacketDispatcher.sendToServer(new BrowsingPositionPacket(getAtlasID(), player.getEntityWorld().getDimensionRegistryKey(), mapOffsetX, mapOffsetY, mapScale));