> On Aug. 28, 2017, 5:16 p.m., Alexander Kolbasov wrote: > > For MySQL I see this: > > > > ALTER TABLE `SENTRY_DB_PRIVILEGE` > > ADD UNIQUE `SENTRY_DB_PRIV_PRIV_NAME_UNIQ` > > (`SERVER_NAME`,`DB_NAME`,`TABLE_NAME`,`COLUMN_NAME`,`URI`(250),`ACTION`,`WITH_GRANT_OPTION`); > > > > Does it match your changes? > > Na Li wrote: > Yes. Before this change, both the unique index defined in jdo and the > unique index defined in SQL are inserted in the database table. After this > change, the unique index in datanucleus (jdo) is removed, there will be only > one unique index in that table.
I see two differences - the sql script uses URI with the lengh 250, while you use 128. And sql scripts does use unique on a bunch of fields which you do remove in package.jdo file. SHouldn't these two match each other? - Alexander ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61793/#review183955 ----------------------------------------------------------- On Aug. 25, 2017, 7:25 p.m., Na Li wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61793/ > ----------------------------------------------------------- > > (Updated Aug. 25, 2017, 7:25 p.m.) > > > Review request for sentry, Alexander Kolbasov, Sergio Pena, and Vamsee > Yarlagadda. > > > Repository: sentry > > > Description > ------- > > reduce field size `SERVER_NAME`,`DB_NAME`,`TABLE_NAME`,`COLUMN_NAME` in > `SENTRY_DB_PRIVILEGE` from 4000 to 128, and remove `URI` from being part of > the unique id > > > Diffs > ----- > > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo > 734ea7f > > > Diff: https://reviews.apache.org/r/61793/diff/2/ > > > Testing > ------- > > run datanucleus schema tool. Without this change, it complains > "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was > too long; max key length is 767 bytes. > After those change, the datanucleus schema tool finishes successfully with > command "mvn datanucleus:schema-create -X -e" > > > Thanks, > > Na Li > >