- Change Summary:
-
Added a missing file.
- Diff:
-
Revision 2 (+549 -311)
Introduce new structures for storing SQL statements.
Review Request #5187 — Created Jan. 3, 2014 and submitted
Introduce new structures for storing SQL statements.
This introduces
SQLResultandAlterTableSQLResult, which are used to
return and store lists of SQL statements.
SQLResulthas three fields:pre_sql,sql, andpost_sql.pre_sqland
post_sqlare used to store SQL statements that should be executed
before/after sql. These can be converted to a single list of SQL
statements with theto_sql()function.
AlterTableSQLResultextends this to also have analter_tablefield that
contains a list ofALTER TABLErules. When callingto_sql(), these are
turned intoALTER TABLEstatements.Where these structures come into play is with the next round of
optimizations. By knowing up-front what SQL statements must be executed
before/after a main set of statements, and whichALTER TABLErules are
going to be executed, a post-processor will be able to batch operations
in an intelligent way. For example, joining all the results together to
drop all indexes before a batch of statements, combiningALTER TABLE
rules into a singleALTER TABLEstatement, and then creating all new
indexes after they execute.That will come in the next big change.
All unit tests pass for all supported database types.
The SQL result of an upgrade from RB 1.7.x to 2.0 remained unchanged,
since optimizations aren't added yet.
- Change Summary:
-
Changed the format for the
alter_tableitems, to allow for later batch processing. - Diff:
-
Revision 3 (+614 -312)
- Change Summary:
-
- Condensed some single-line alter table formatting.
- Passed parameters for log output as parameters to logging.
- Diff:
-
Revision 4 (+607 -313)