> On Feb. 18, 2016, 1:34 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java, > > line 487 > > <https://reviews.apache.org/r/43727/diff/1/?file=1254729#file1254729line487> > > > > Why the double single quotes?
You need to double-escape the single quotes to have them show up as ' Think of the SQL statement: SELECT * FROM table WHERE column = 'someValue' This won't work without the quotes > On Feb. 18, 2016, 1:34 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java, > > line 1054 > > <https://reviews.apache.org/r/43727/diff/1/?file=1254728#file1254728line1054> > > > > Why was the extra ' needed? See my answer below. > On Feb. 18, 2016, 1:34 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java, > > line 424 > > <https://reviews.apache.org/r/43727/diff/1/?file=1254729#file1254729line424> > > > > All of these methods should be transactional. Some of them should; the ones that also create data. The ones which just alter the DDL don't need to since this isn't something that can be rolled back. > On Feb. 18, 2016, 1:34 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java, > > line 431 > > <https://reviews.apache.org/r/43727/diff/1/?file=1254729#file1254729line431> > > > > Will add column do a no-op if it already exists? Yes > On Feb. 18, 2016, 1:34 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java, > > line 481 > > <https://reviews.apache.org/r/43727/diff/1/?file=1254729#file1254729line481> > > > > May want to check that resultSet is not null. Can't be non-null ... you'd have no components :) But I'll check so you can sleep at night. - Jonathan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/43727/#review119658 ----------------------------------------------------------- On Feb. 18, 2016, 1:28 p.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/43727/ > ----------------------------------------------------------- > > (Updated Feb. 18, 2016, 1:28 p.m.) > > > Review request for Ambari, Dmitro Lisnichenko and Nate Cole. > > > Bugs: AMBARI-15094 > https://issues.apache.org/jira/browse/AMBARI-15094 > > > Repository: ambari > > > Description > ------- > > This JIRA will be used to keep track of the changes required for the > UpgradeCatalog that will be used for PU. > > +Changed tables+ > {{repo_version}} > * Add {{type}} column, default 'STANDARD' > * Add {{version_url}} varchar(1024) > * Add {{version_xml}} mediumtext/text > * Add {{version_xsd}} varchar(512) > * Add {{parent_id}} bigint, nullable > > {{servicecomponentdesiredstate}} > * Add PK {{id}} column > * Remove existing PK, create {{UNIQUE}} constraint out of same columns > * Create {{INDEX}} on old PK columns > > {{hostcomponentdesiredstate}} > * Reorder {{hstcmpnntdesiredstatecmpnntnme}} {{FOREIGN KEY}} > ** {{(component_name, service_name, cluster_id)}} > > {{hostcomponentstate}} > * Reorder {{hstcomponentstatecomponentname}} {{FOREIGN KEY}} > ** {{(component_name, service_name, cluster_id)}} > > {{servicecomponent_history}} > * Creation of new table > * Addition of new sequence to track PK ID > > > Diffs > ----- > > ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java > 49f108b > > ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java > abd05bc > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java > d97962f > ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 8c626f5 > > Diff: https://reviews.apache.org/r/43727/diff/ > > > Testing > ------- > > Upgraded a trunk database to a branch-dev-patch-upgrade database on MySQL and > Postgres. > > Unit tests pending... > > > Thanks, > > Jonathan Hurley > >
