FoundationDB/sql-layer — pull request #1256 by MMcM (2014-04-11 02:17:27+00:00)
Title: Make schema manager the ordinary source for the type translator

That is, outside of tests. The MCOMPAT translator is still hard-wired there, but only there (again, outside of tests).

Remove type-name-based column / parameter construction from AISBuilder, simplifying its contract to only take a TInstance, and thereby removing the need for it to reference the types registry. Make the primary interface for manually building tables, such as in the information schema, JDBC type-based instead. This way only the types translator knows about selection between several potential candidates for the same type.

Since this would result in TIMESTAMP columns in system tables getting MCOMPAT_ DATETIME, whose internal representation would require more work, add a special method to continue to get MCOMPAT_ TIMESTAMP. As soon as the new TIMESTAMP type is added, this can change to use it and row constructors can switch from dividing by 1000 to multiplying by whatever power of ten gets to the internal representation we choose.

The bulk of the change is in tests, where AISBuilder is often used to build test tables. The exact change strategy depends on the subsystem under test. But, in general, the idea is (1) to use colXxx from the new types builder to get the SQL-like system default type mapping or (2) to name MCOMPAT explicitly to get a particular type. In the second category, sometimes the test really is testing the MySQL compatible behavior of that type or access to a type that normally doesn't appear in SQL. Other times it is just testing some low-level behavior of AIS construction. These last can migrate to name new more standard bundle types as these get added.