HIVE-3764: Support metastore version consistency check
Review Request #14169 - Created Sept. 17, 2013 and updated
This is a 0.12 specific patch. The trunk patch will include additional metastore scripts which I will attach separately to the ticket. - Added a new table in the metastore schema to store the Hive version in the metastore. - Metastore handler compare the version stored in the schema with its own version. If there's a mismatch, then it can either record the correct version or raise error. The behavior is configurable via a new Hive config. This config when set, also restrict dataNucleus to auto upgrade the schema. - The new schema creation and upgrade scripts record the new version in the metastore version table. - Added 0.12 upgrade scripts for all supported DBs to creates the new table version tables in 0.12 metastore schema The current patch has the verification turned off by default. I would prefer to keep it enabled, though it require any add-hoc setup to explicitly disable it (or create the metastore schema by running scripts). The default can be changed or left as is as per the consensus.
Added new tests for schema verification. Manually tested the upgrades using derby and MySQL.