)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"b93e5c143408d7a3de5f9e20cd961579fbc391b6","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     oorgeron \u003coctave.orgeron@oracle.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-02-01 16:45:01 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Closes-Bug: 1564110"},{"line_number":8,"context_line":"Task: Enables new functionality for selecting"},{"line_number":9,"context_line":"InnoDB or MySQL Cluster as a DB storage"},{"line_number":10,"context_line":"backend in OpenStack services."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I9f1fd2a87fdf75332de2339d3ff4f08ce9220dcf"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3a461143_a5e1c6d2","line":10,"range":{"start_line":7,"start_character":0,"end_line":10,"end_character":30},"updated":"2017-02-02 14:51:06.000000000","message":"It seems like to order of the commit message is not the best one according to the guidelines[1]\n\nEnable MySql Engine selection\n\nEnables new functionality for selecting InnoDB or MySQL Cluster as a DB storage backend in OpenStack services.\n\nCloses-Bug: 1564110\n\n[1] https://wiki.openstack.org/wiki/GitCommitMessages","commit_id":"08db5b95850122a24c9e7a47ad10a22592774949"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"d11a1b71a30170cc60e0c0dfea7b217bddabc0ad","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     oorgeron \u003coctave.orgeron@oracle.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-02-01 16:45:01 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Closes-Bug: 1564110"},{"line_number":8,"context_line":"Task: Enables new functionality for selecting"},{"line_number":9,"context_line":"InnoDB or MySQL Cluster as a DB storage"},{"line_number":10,"context_line":"backend in OpenStack services."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I9f1fd2a87fdf75332de2339d3ff4f08ce9220dcf"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3a461143_422c8dab","line":10,"range":{"start_line":7,"start_character":0,"end_line":10,"end_character":30},"in_reply_to":"3a461143_a5e1c6d2","updated":"2017-02-02 18:07:25.000000000","message":"I\u0027ll adjust the comment for the change set. On your comment about the the InnoDB engine, that is for the general purpose version of MySQL DB. MySQL Cluster is a completely separate product that is based on the NDB engine and has a very different architecture. The point of enabling support is to give the community another option that has built-in active/active HA, auto-sharding, replication, and the ability to scale-out to 48 data nodes. If it makes sense, I include links to both of the databases:\n\nMySQL (InnoDB): https://dev.mysql.com/doc/refman/5.7/en/\nMySQL Cluster (NDB): https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html\n\nAs to where to place them, I\u0027m open to suggestions. Placing them in the options.py file in the cfg section may be the most useful for end-users.","commit_id":"08db5b95850122a24c9e7a47ad10a22592774949"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"707f294d5ed0b881a223c3612f295b76a5e50c45","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     oorgeron \u003coctave.orgeron@oracle.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-02-02 11:12:29 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Closes-Bug: 1564110"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":" Enable MySQL Storage Engine selection"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1a430d35_f4ebae76","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":19},"updated":"2017-02-09 15:29:32.000000000","message":"Usually this tag goes to the bottom of the commit message","commit_id":"db1457560fba641a47e79b6b24d6a2d0c509071d"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"707f294d5ed0b881a223c3612f295b76a5e50c45","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Closes-Bug: 1564110"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":" Enable MySQL Storage Engine selection"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":" Enables new functionality for selecting InnoDB or MySQL Cluster"},{"line_number":12,"context_line":" as a DB storage backend in OpenStack services."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1a430d35_54fba247","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":1},"updated":"2017-02-09 15:29:32.000000000","message":"there is no needed to add a space in the title","commit_id":"db1457560fba641a47e79b6b24d6a2d0c509071d"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"707f294d5ed0b881a223c3612f295b76a5e50c45","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":" Enable MySQL Storage Engine selection"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":" Enables new functionality for selecting InnoDB or MySQL Cluster"},{"line_number":12,"context_line":" as a DB storage backend in OpenStack services."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I9f1fd2a87fdf75332de2339d3ff4f08ce9220dcf"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1a430d35_94934a00","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":1},"updated":"2017-02-09 15:29:32.000000000","message":"ditto: line 9","commit_id":"db1457560fba641a47e79b6b24d6a2d0c509071d"}],"oslo_db/options.py":[{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"b93e5c143408d7a3de5f9e20cd961579fbc391b6","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    cfg.StrOpt(\u0027mysql_storage_engine\u0027,"},{"line_number":56,"context_line":"               default\u003d\u0027InnoDB\u0027,"},{"line_number":57,"context_line":"               help\u003d\u0027This configures the MySQL storage engine. \u0027"},{"line_number":58,"context_line":"                    \u0027This allows for OpenStack to support different storage \u0027"},{"line_number":59,"context_line":"                    \u0027engine such as InnoDB, NDB, etc. By default, \u0027"},{"line_number":60,"context_line":"                    \u0027this value will be set to InnoDB. For MySQL Cluster, \u0027"},{"line_number":61,"context_line":"                    \u0027set to NDBCLUSTER. Example: mysql_storage_engine\u003d\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a461143_a51626a5","line":58,"range":{"start_line":58,"start_character":33,"end_line":58,"end_character":46},"updated":"2017-02-02 14:51:06.000000000","message":"nit: given that this change can benefit other projects outside of the Big Tent, I don\u0027t think that it\u0027s necessary to specify \"OpenStack\"","commit_id":"08db5b95850122a24c9e7a47ad10a22592774949"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"d11a1b71a30170cc60e0c0dfea7b217bddabc0ad","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    cfg.StrOpt(\u0027mysql_storage_engine\u0027,"},{"line_number":56,"context_line":"               default\u003d\u0027InnoDB\u0027,"},{"line_number":57,"context_line":"               help\u003d\u0027This configures the MySQL storage engine. \u0027"},{"line_number":58,"context_line":"                    \u0027This allows for OpenStack to support different storage \u0027"},{"line_number":59,"context_line":"                    \u0027engine such as InnoDB, NDB, etc. By default, \u0027"},{"line_number":60,"context_line":"                    \u0027this value will be set to InnoDB. For MySQL Cluster, \u0027"},{"line_number":61,"context_line":"                    \u0027set to NDBCLUSTER. Example: mysql_storage_engine\u003d\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a461143_7d620aaf","line":58,"range":{"start_line":58,"start_character":33,"end_line":58,"end_character":46},"in_reply_to":"3a461143_a51626a5","updated":"2017-02-02 18:07:25.000000000","message":"I\u0027ll make this change for you.","commit_id":"08db5b95850122a24c9e7a47ad10a22592774949"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"1c58b45b6875adc04141825e27fe8743b4f8ed33","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                    \u0027server-set SQL mode. To use whatever SQL mode \u0027"},{"line_number":53,"context_line":"                    \u0027is set by the server configuration, \u0027"},{"line_number":54,"context_line":"                    \u0027set this to no value. Example: mysql_sql_mode\u003d\u0027),"},{"line_number":55,"context_line":"    cfg.BoolOpt(\u0027mysql_enable_ndb\u0027,"},{"line_number":56,"context_line":"                default\u003dFalse,"},{"line_number":57,"context_line":"                help\u003d\u0027If True, transparently enables support for handling \u0027"},{"line_number":58,"context_line":"                     \u0027MySQL Cluster (NDB).\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_ee3f6284","line":55,"range":{"start_line":55,"start_character":17,"end_line":55,"end_character":33},"updated":"2017-03-06 14:35:06.000000000","message":"I haven\u0027t read through every post in the mailing list thread, so maybe there\u0027s a reason this is this way. But it seems it would be better to have something like \"mysql_engine\" with possible values being [\"InnoDB\", \"ndbcluster\"].","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"17a956311df36c4941d3b816e0f76ebe16b002e0","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                    \u0027server-set SQL mode. To use whatever SQL mode \u0027"},{"line_number":53,"context_line":"                    \u0027is set by the server configuration, \u0027"},{"line_number":54,"context_line":"                    \u0027set this to no value. Example: mysql_sql_mode\u003d\u0027),"},{"line_number":55,"context_line":"    cfg.BoolOpt(\u0027mysql_enable_ndb\u0027,"},{"line_number":56,"context_line":"                default\u003dFalse,"},{"line_number":57,"context_line":"                help\u003d\u0027If True, transparently enables support for handling \u0027"},{"line_number":58,"context_line":"                     \u0027MySQL Cluster (NDB).\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_bf091297","line":55,"range":{"start_line":55,"start_character":17,"end_line":55,"end_character":33},"in_reply_to":"ba2be162_ee3f6284","updated":"2017-03-06 15:39:12.000000000","message":"I was opposed to this when the option here was considered to be a pass-through, since it implied that the engine can be anything and it doesn\u0027t complicate the action to take, which is the opposite of the case here, selecting \"ndb\" has to pull in a large amount of behavioral change, and a selection like \"MyISAM\" is impossible.  However, if it can be limited to a fixed set of two choices I can see how that\u0027s just going to be a much more popular way of doing it, so sure.","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"}],"oslo_db/sqlalchemy/enginefacade.py":[{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"b93e5c143408d7a3de5f9e20cd961579fbc391b6","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"    :keyword mysql_sql_mode: the SQL mode to be used for MySQL sessions."},{"line_number":1112,"context_line":"                             (defaults to TRADITIONAL)"},{"line_number":1113,"context_line":"    :keyword mysql_storage_engine: configures MySQL storage engine which"},{"line_number":1114,"context_line":"                                   effects SQL logic and behaviour."},{"line_number":1115,"context_line":"                                   (defaults to InnoDB)"},{"line_number":1116,"context_line":"    :keyword idle_timeout: timeout before idle sql connections are reaped"},{"line_number":1117,"context_line":"                           (defaults to 3600)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a461143_05b0da8a","line":1114,"range":{"start_line":1114,"start_character":35,"end_line":1114,"end_character":42},"updated":"2017-02-02 14:51:06.000000000","message":"nit: s/effects/affects ?","commit_id":"08db5b95850122a24c9e7a47ad10a22592774949"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"d11a1b71a30170cc60e0c0dfea7b217bddabc0ad","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"    :keyword mysql_sql_mode: the SQL mode to be used for MySQL sessions."},{"line_number":1112,"context_line":"                             (defaults to TRADITIONAL)"},{"line_number":1113,"context_line":"    :keyword mysql_storage_engine: configures MySQL storage engine which"},{"line_number":1114,"context_line":"                                   effects SQL logic and behaviour."},{"line_number":1115,"context_line":"                                   (defaults to InnoDB)"},{"line_number":1116,"context_line":"    :keyword idle_timeout: timeout before idle sql connections are reaped"},{"line_number":1117,"context_line":"                           (defaults to 3600)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a461143_ddf85ec7","line":1114,"range":{"start_line":1114,"start_character":35,"end_line":1114,"end_character":42},"in_reply_to":"3a461143_05b0da8a","updated":"2017-02-02 18:07:25.000000000","message":"I\u0027ll make this change.","commit_id":"08db5b95850122a24c9e7a47ad10a22592774949"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"73ded6969513b8612ae303775126121a86bdd3ed","unresolved":false,"context_lines":[{"line_number":271,"context_line":"         level or savepoint :class:`.Session` transaction exits - in this way"},{"line_number":272,"context_line":"         it behaves like a \"subtransaction\" from a :class:`.Session`"},{"line_number":273,"context_line":"         perspective."},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        .. seealso::"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"            :meth:`._TransactionFactory.configure`"}],"source_content_type":"text/x-python","patch_set":18,"id":"5ff73747_678cb9d6","line":274,"updated":"2017-04-28 17:44:26.000000000","message":"mysql_enable_ndb must be added here too.","commit_id":"367de350836a3431097abccac317a6c5013634ea"}],"oslo_db/sqlalchemy/engines.py":[{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"a6f9296b77b6289e4d59350e2cde9dd356392f85","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"def create_engine(sql_connection, sqlite_fk\u003dFalse, mysql_sql_mode\u003dNone,"},{"line_number":105,"context_line":"                  mysql_storage_engine\u003dNone,"},{"line_number":106,"context_line":"                  idle_timeout\u003d3600,"},{"line_number":107,"context_line":"                  connection_debug\u003d0, max_pool_size\u003dNone, max_overflow\u003dNone,"},{"line_number":108,"context_line":"                  pool_timeout\u003dNone, sqlite_synchronous\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa31d9ce_da4735ba","line":105,"updated":"2017-02-13 19:52:34.000000000","message":"this parameter is ignored.  Until it does something, such as, place a memoization in engine.info, or something that is detectable, it should be removed and not passed.\n\nPut another way, there would need to be a unit test that when create_engine() is called with this parameter passed, the test asserts that create_engine() does the right thing with this parameter.","commit_id":"53d8a02f0ccf00a889488bba1dddbdf21381bbf8"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"04b98e203a41572b0991722c92b0d6b82e333a25","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"def create_engine(sql_connection, sqlite_fk\u003dFalse, mysql_sql_mode\u003dNone,"},{"line_number":105,"context_line":"                  mysql_storage_engine\u003dNone,"},{"line_number":106,"context_line":"                  idle_timeout\u003d3600,"},{"line_number":107,"context_line":"                  connection_debug\u003d0, max_pool_size\u003dNone, max_overflow\u003dNone,"},{"line_number":108,"context_line":"                  pool_timeout\u003dNone, sqlite_synchronous\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa31d9ce_8e0c9b3c","line":105,"in_reply_to":"fa31d9ce_da4735ba","updated":"2017-02-13 21:38:24.000000000","message":"I added this because the tox tests would fail without this being added. If you have some suggestions on how we can remove this and not have the tox tests fail that the mysql_storage_engine is missing from the create_engine function, I\u0027d like to see them. Also, I suspect that some of these other settings are in the same boat where they do nothing on their own.","commit_id":"53d8a02f0ccf00a889488bba1dddbdf21381bbf8"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"06d1c2b8e0977a5d167a97bbf3d3bb9d6644aa1c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"from oslo_db.sqlalchemy import utils"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":41,"context_line":"CONF \u003d cfg.CONF"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def _thread_yield(dbapi_con, con_record):"}],"source_content_type":"text/x-python","patch_set":18,"id":"5ff73747_2768f11a","line":41,"updated":"2017-04-28 17:43:09.000000000","message":"We must not use global the cfg.CONF in library","commit_id":"367de350836a3431097abccac317a6c5013634ea"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"06d1c2b8e0977a5d167a97bbf3d3bb9d6644aa1c","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"def create_engine(sql_connection, sqlite_fk\u003dFalse, mysql_sql_mode\u003dNone,"},{"line_number":108,"context_line":"                  mysql_enable_ndb\u003dFalse,"},{"line_number":109,"context_line":"                  idle_timeout\u003d3600,"},{"line_number":110,"context_line":"                  connection_debug\u003d0, max_pool_size\u003dNone, max_overflow\u003dNone,"},{"line_number":111,"context_line":"                  pool_timeout\u003dNone, sqlite_synchronous\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":18,"id":"5ff73747_87e345a4","line":108,"range":{"start_line":108,"start_character":17,"end_line":108,"end_character":41},"updated":"2017-04-28 17:43:09.000000000","message":"This must be the last param to not break the API","commit_id":"367de350836a3431097abccac317a6c5013634ea"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"06d1c2b8e0977a5d167a97bbf3d3bb9d6644aa1c","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    engine \u003d sqlalchemy.create_engine(url, **engine_args)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    if CONF.database.mysql_enable_ndb:"},{"line_number":141,"context_line":"        ndb.enable_ndb_support(engine)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    _init_events("}],"source_content_type":"text/x-python","patch_set":18,"id":"5ff73747_674959b5","line":140,"range":{"start_line":140,"start_character":8,"end_line":140,"end_character":21},"updated":"2017-04-28 17:43:09.000000000","message":"you must directly use mysql_enable_ndb","commit_id":"367de350836a3431097abccac317a6c5013634ea"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"06d1c2b8e0977a5d167a97bbf3d3bb9d6644aa1c","unresolved":false,"context_lines":[{"line_number":273,"context_line":"                    \"consider enabling TRADITIONAL or STRICT_ALL_TABLES\","},{"line_number":274,"context_line":"                    realmode)"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"    if CONF.database.mysql_enable_ndb:"},{"line_number":277,"context_line":"        ndb.init_ndb_events(engine)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"5ff73747_07e9757e","line":276,"range":{"start_line":276,"start_character":4,"end_line":276,"end_character":38},"updated":"2017-04-28 17:43:09.000000000","message":"ditto","commit_id":"367de350836a3431097abccac317a6c5013634ea"}],"oslo_db/sqlalchemy/ndb.py":[{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"876c5202536131448717a322f113af70e7dacbba","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    to MySQL Cluster (NDB)."},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    engine.dialect._oslodb_enable_ndb_support \u003d True"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"@compiles(schema.CreateTable, \"mysql\")"},{"line_number":37,"context_line":"def prefix_inserts(create_table, compiler, **kw):"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_13a65610","line":34,"updated":"2017-03-01 17:18:08.000000000","message":"setup the ndb-specific events here, inside the def","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"e5ec49c3fca0d8483db16f45df4722f5c3a6cf78","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    to MySQL Cluster (NDB)."},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    engine.dialect._oslodb_enable_ndb_support \u003d True"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"@compiles(schema.CreateTable, \"mysql\")"},{"line_number":37,"context_line":"def prefix_inserts(create_table, compiler, **kw):"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_b71baf1a","line":34,"in_reply_to":"ba2be162_13a65610","updated":"2017-03-01 20:33:48.000000000","message":"So the @compiles prefix_inserts and @events.listens_for before_cursor_execute should move here?","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"fb5e01dda8b1015da6a7e4ab112822e7ed2f1734","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    to MySQL Cluster (NDB)."},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    engine.dialect._oslodb_enable_ndb_support \u003d True"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"@compiles(schema.CreateTable, \"mysql\")"},{"line_number":37,"context_line":"def prefix_inserts(create_table, compiler, **kw):"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_a7d34403","line":34,"in_reply_to":"ba2be162_b71baf1a","updated":"2017-03-02 17:52:30.000000000","message":"yes, either directly or as part of a function defined elsewhere.","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"876c5202536131448717a322f113af70e7dacbba","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    existing \u003d compiler.visit_create_table(create_table, **kw)"},{"line_number":44,"context_line":"    search_string \u003d re.compile(\"engine\u003dinnodb\", re.IGNORECASE)"},{"line_number":45,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":46,"context_line":"        existing \u003d search_string.sub(\"ENGINE\u003dNDBCLUSTER\", existing)"},{"line_number":47,"context_line":"    return existing"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_70694825","line":45,"updated":"2017-03-01 17:18:08.000000000","message":"OK so here, you can see we are calling upon the flag we stuck into compiler.dialect as a result of create_engine(), to test if we are NDB.  However everywhere else, I see we are doing a global check CONF.database.mysql_enable_ndb.   This is inconsistent.  It\u0027s better if the \"ndb-ness\" can be localized to a specific engine that specified the flag in create_engine().   that can be done everywhere here.","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"e5ec49c3fca0d8483db16f45df4722f5c3a6cf78","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    existing \u003d compiler.visit_create_table(create_table, **kw)"},{"line_number":44,"context_line":"    search_string \u003d re.compile(\"engine\u003dinnodb\", re.IGNORECASE)"},{"line_number":45,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":46,"context_line":"        existing \u003d search_string.sub(\"ENGINE\u003dNDBCLUSTER\", existing)"},{"line_number":47,"context_line":"    return existing"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_97914b55","line":45,"in_reply_to":"ba2be162_70694825","updated":"2017-03-01 20:33:48.000000000","message":"I originally tried this with the flag from the compiler.dialect, but it didn\u0027t work in the context of sql alchemy migrations or alembic upgrades. That\u0027s why I brought in the CONF.database.mysql_enable_ndb stuff. I\u0027ll see what happens if I move this up into the enable_ndb_support() def.","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"876c5202536131448717a322f113af70e7dacbba","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    return existing"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"@event.listens_for(Engine, \"before_cursor_execute\", retval\u003dTrue)"},{"line_number":51,"context_line":"def before_cursor_execute(conn, cursor, statement, parameters, context,"},{"line_number":52,"context_line":"                          executemany):"},{"line_number":53,"context_line":"    \"\"\"Replace InnoDB with NDBCLUSTER automatically."}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_d0c75410","line":50,"updated":"2017-03-01 17:18:08.000000000","message":"if we are indeed only doing the replace when ndb is enabled, then this whole event listener should only be set up when mysql_enable_ndb is enabled.  Basically create_engine() should be invoking a function here called something like \"setup_for_ndb()\" that then invokes the event.   example: https://github.com/openstack/oslo.db/blob/master/oslo_db/sqlalchemy/engines.py#L242","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"e5ec49c3fca0d8483db16f45df4722f5c3a6cf78","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    return existing"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"@event.listens_for(Engine, \"before_cursor_execute\", retval\u003dTrue)"},{"line_number":51,"context_line":"def before_cursor_execute(conn, cursor, statement, parameters, context,"},{"line_number":52,"context_line":"                          executemany):"},{"line_number":53,"context_line":"    \"\"\"Replace InnoDB with NDBCLUSTER automatically."}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_37a09f43","line":50,"in_reply_to":"ba2be162_d0c75410","updated":"2017-03-01 20:33:48.000000000","message":"Should this be moved up to enable_ndb_support() def? \n\nOr are you saying that we need a new call (i.e. setup_ndb()) from create_engine() after the enable_ndb_support() call that kicks off the event listener? Something like:\n\ndef setup_ndb(engine)\n    if getattr(conn.engine.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):\n         @event.listens_for(Engine, \"before_cursor_execute\", retval\u003dTrue)\n        ....","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"876c5202536131448717a322f113af70e7dacbba","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"@event.listens_for(Engine, \"before_cursor_execute\", retval\u003dTrue)"},{"line_number":51,"context_line":"def before_cursor_execute(conn, cursor, statement, parameters, context,"},{"line_number":52,"context_line":"                          executemany):"},{"line_number":53,"context_line":"    \"\"\"Replace InnoDB with NDBCLUSTER automatically."},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_5096044d","line":51,"updated":"2017-03-01 17:18:08.000000000","message":"OK so.  if you want to make this event only invoke for when migrations are running, we would have to add some kind of indicator into the create_engine() when called under an alembic env.py or under sqlalchemy-migrate.   This is easy to do in the alembic case however for the sqlalchemy-migrate case we might need some more creativity.  For now, just trying to get this to work, if we leave the event listener local to the \"enable_ndb\" case that will prevent it from any surprises in existing deployments.","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"fb5e01dda8b1015da6a7e4ab112822e7ed2f1734","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"@event.listens_for(Engine, \"before_cursor_execute\", retval\u003dTrue)"},{"line_number":51,"context_line":"def before_cursor_execute(conn, cursor, statement, parameters, context,"},{"line_number":52,"context_line":"                          executemany):"},{"line_number":53,"context_line":"    \"\"\"Replace InnoDB with NDBCLUSTER automatically."},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_c7f75889","line":51,"in_reply_to":"ba2be162_174e3b96","updated":"2017-03-02 17:52:30.000000000","message":"that\u0027s what I was basically saying, yes.  However I\u0027m not sure how to do it unless we make a change within each calling project to set some flag.","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"e5ec49c3fca0d8483db16f45df4722f5c3a6cf78","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"@event.listens_for(Engine, \"before_cursor_execute\", retval\u003dTrue)"},{"line_number":51,"context_line":"def before_cursor_execute(conn, cursor, statement, parameters, context,"},{"line_number":52,"context_line":"                          executemany):"},{"line_number":53,"context_line":"    \"\"\"Replace InnoDB with NDBCLUSTER automatically."},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_174e3b96","line":51,"in_reply_to":"ba2be162_5096044d","updated":"2017-03-01 20:33:48.000000000","message":"Yeah, I\u0027m concerned about the different ways the services call into sqlalchemy migrate and alembic causing issues here. If we had to add stuff to each service, that may be a pain as well to maintain. Maybe we need something in sqlalchemy and alembic to automatically set a flag when doing a migrate or upgrade?","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"876c5202536131448717a322f113af70e7dacbba","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    convert InnoDB with NDBCLUSTER."},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    search_string \u003d re.compile(\"engine\u003dinnodb\", re.IGNORECASE)"},{"line_number":59,"context_line":"    if CONF.database.mysql_enable_ndb:"},{"line_number":60,"context_line":"        statement \u003d search_string.sub(\"ENGINE\u003dNDBCLUSTER\", statement)"},{"line_number":61,"context_line":"    return statement, parameters"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_90dcfc13","line":59,"updated":"2017-03-01 17:18:08.000000000","message":"::\n\n    if getattr(conn.engine.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"876c5202536131448717a322f113af70e7dacbba","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    return Text().with_variant(dialects.mysql.TINYTEXT(), \u0027mysql\u0027)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"def AutoStringTinyText(size):"},{"line_number":73,"context_line":"    \"\"\"Replace String with TinyText for MySQL Cluster."},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    Function will determine if MySQL Cluster is enabled and"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_b3190a7c","line":72,"updated":"2017-03-01 17:18:08.000000000","message":"For each of these we can localize the effect to the dialect flag and also use less code by moving this logic to compilation + a custom type, \"def TinyText()\" and \"def AutoStringTinyText()\" would be replaced by:\n\n\tfrom sqlalchemy.ext.compiler import compiles\n\n\n\tclass NDBCapableTinyText(String):\n\t    pass\n\n\t@compiles(NDBCapableTinyText, \u0027mysql\u0027)\n\tdef _ndb_capable_tinytext(element, compiler, **kw):\n\t    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):\n\t        return \"TINYTEXT\"\n\t    else:\n\t        return compiler.visit_string(element, **kw)\n\nsimilar for AutoStringText","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"fb5e01dda8b1015da6a7e4ab112822e7ed2f1734","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    return Text().with_variant(dialects.mysql.TINYTEXT(), \u0027mysql\u0027)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"def AutoStringTinyText(size):"},{"line_number":73,"context_line":"    \"\"\"Replace String with TinyText for MySQL Cluster."},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    Function will determine if MySQL Cluster is enabled and"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_47ce082f","line":72,"in_reply_to":"ba2be162_7a73de80","updated":"2017-03-02 17:52:30.000000000","message":"the code example above is overriding the string compilation of the types, so we return a string.  Also yes, these particular callables are not part of the \"create_engine()\" thing, they are defined at the same level as the NDBCapableTinyText class.","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"e5ec49c3fca0d8483db16f45df4722f5c3a6cf78","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    return Text().with_variant(dialects.mysql.TINYTEXT(), \u0027mysql\u0027)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"def AutoStringTinyText(size):"},{"line_number":73,"context_line":"    \"\"\"Replace String with TinyText for MySQL Cluster."},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    Function will determine if MySQL Cluster is enabled and"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_7a73de80","line":72,"in_reply_to":"ba2be162_b3190a7c","updated":"2017-03-01 20:33:48.000000000","message":"For these functions, wouldn\u0027t they need to work regardless of if NDB is enabled or not? If you look at the cinder patch, we call into these ndb module functions for the volume table. Wouldn\u0027t the returns above have to be TinyText() or String(size)?","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"0e2d4a28a310a49275076b9ca744ce8f4c3dbbc0","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"@compiles(AutoStringTinyText, \u0027mysql\u0027)"},{"line_number":79,"context_line":"def _auto_string_tiny_text(element, compiler, **kw):"},{"line_number":80,"context_line":"    if CONF.database.mysql_enable_ndb:"},{"line_number":81,"context_line":"        return \"TINYTEXT\""},{"line_number":82,"context_line":"    else:"},{"line_number":83,"context_line":"        return compiler.visit_string(element, **kw)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_1dfaff42","line":80,"updated":"2017-03-07 15:22:11.000000000","message":"dialect is always there, this is why the flag is on \"dialect\" and not \"engine\"::\n\n    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):","commit_id":"0868f7ab8dc143127b482a1c20c1d0fa54af7903"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"5ad3d5c7dcb504e32f43c8dc1c3fbbbe599660c3","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"@compiles(AutoStringTinyText, \u0027mysql\u0027)"},{"line_number":79,"context_line":"def _auto_string_tiny_text(element, compiler, **kw):"},{"line_number":80,"context_line":"    if CONF.database.mysql_enable_ndb:"},{"line_number":81,"context_line":"        return \"TINYTEXT\""},{"line_number":82,"context_line":"    else:"},{"line_number":83,"context_line":"        return compiler.visit_string(element, **kw)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_bf6e0bff","line":80,"in_reply_to":"9a30ddce_1dfaff42","updated":"2017-03-08 18:45:54.000000000","message":"Thank you! This worked and I was able to create the AutoStringSize class and get that to work. I\u0027ll post the updated patch shortly.","commit_id":"0868f7ab8dc143127b482a1c20c1d0fa54af7903"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"d4307f5086b875f89bdec07f3dd852ed93ff163e","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    Class is used by the compiler function _auto_string_size()."},{"line_number":121,"context_line":"    \"\"\""},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def __init__(self, innodb_size, ndb_size, length\u003dNone):"},{"line_number":124,"context_line":"        \"\"\"Initialize and extend the String arguments."},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        Function adds the innodb_size and ndb_size arguments to the"}],"source_content_type":"text/x-python","patch_set":14,"id":"bff0334d_878b611d","line":123,"updated":"2017-04-10 23:00:53.000000000","message":"you need super(AutoStringSize, self).__init__(length) here, so that this existing Python class may initialize it\u0027s ordinary state including such flags as convert_unicode.","commit_id":"19ce6857041d7b14308b7b6b9f4fe582652ca692"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"00e7eb37407e45f83b0b1ff2e5bb11899f3f87c6","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        convert InnoDB to NDBCLUSTER, drop SAVEPOINT requests, and"},{"line_number":68,"context_line":"        drop ROLLBACK requests."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        search_string \u003d re.compile(\"engine\u003dinnodb\", re.IGNORECASE)"},{"line_number":71,"context_line":"        search_savepoint \u003d re.compile(\"savepoint\", re.IGNORECASE)"},{"line_number":72,"context_line":"        search_rollback \u003d re.compile(\"rollback\", re.IGNORECASE)"},{"line_number":73,"context_line":"        search_release \u003d re.compile(\"release savepoint\", re.IGNORECASE)"}],"source_content_type":"text/x-python","patch_set":16,"id":"5ff73747_034b242b","line":70,"updated":"2017-04-25 17:23:11.000000000","message":"so just some performance things, do these re.compile()\u0027s *outside* of the event hook, otherwise this is a lot of time spent each statement...","commit_id":"c827d3b3f7b34bf39668324dc6fec5a0ee552b4a"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"00e7eb37407e45f83b0b1ff2e5bb11899f3f87c6","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        search_string \u003d re.compile(\"engine\u003dinnodb\", re.IGNORECASE)"},{"line_number":71,"context_line":"        search_savepoint \u003d re.compile(\"savepoint\", re.IGNORECASE)"},{"line_number":72,"context_line":"        search_rollback \u003d re.compile(\"rollback\", re.IGNORECASE)"},{"line_number":73,"context_line":"        search_release \u003d re.compile(\"release savepoint\", re.IGNORECASE)"},{"line_number":74,"context_line":"        if getattr(engine.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":75,"context_line":"            statement \u003d search_string.sub(\"ENGINE\u003dNDBCLUSTER\", statement)"},{"line_number":76,"context_line":"            if re.match(search_savepoint, statement):"}],"source_content_type":"text/x-python","patch_set":16,"id":"5ff73747_a3fd90b2","line":73,"updated":"2017-04-25 17:23:11.000000000","message":"next, these all have the same outcome.  so make *one* re:\n\n    savepoint_regex \u003d re.compile(\"savepoint|rollback\")\n\nthen you don\u0027t need those conditionals down there.","commit_id":"c827d3b3f7b34bf39668324dc6fec5a0ee552b4a"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"00e7eb37407e45f83b0b1ff2e5bb11899f3f87c6","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        if getattr(engine.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":75,"context_line":"            statement \u003d search_string.sub(\"ENGINE\u003dNDBCLUSTER\", statement)"},{"line_number":76,"context_line":"            if re.match(search_savepoint, statement):"},{"line_number":77,"context_line":"                statement \u003d \"SET @ignore_me \u003d 0;\""},{"line_number":78,"context_line":"            if re.match(search_rollback, statement):"},{"line_number":79,"context_line":"                statement \u003d \"SET @ignore_me \u003d 0;\""},{"line_number":80,"context_line":"            if re.match(search_release, statement):"}],"source_content_type":"text/x-python","patch_set":16,"id":"5ff73747_63a428ba","line":77,"updated":"2017-04-25 17:23:11.000000000","message":"I would recommend making this statement somewhat indicative of why it\u0027s here, because it is going to look very odd in the logs.   Either \"SET @placeholder_for_savepoint \u003d 0\" or maybe a comment \"SET @ignore_me \u003d 0 -- overwriting a savepoint instruction\", something like that, so this isn\u0027t totally mysterious in the logs.","commit_id":"c827d3b3f7b34bf39668324dc6fec5a0ee552b4a"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"f599f4883ee6cda1becf06027c3efa6530cc2e4d","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return statement, parameters"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"@compiles(schema.CreateTable, \"mysql\")"},{"line_number":68,"context_line":"def prefix_inserts(create_table, compiler, **kw):"},{"line_number":69,"context_line":"    \"\"\"Replace InnoDB with NDBCLUSTER automatically."},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    Function will intercept CreateTable() calls and automatically"},{"line_number":72,"context_line":"    convert InnoDB to NDBCLUSTER."},{"line_number":73,"context_line":"    \"\"\""},{"line_number":74,"context_line":"    existing \u003d compiler.visit_create_table(create_table, **kw)"},{"line_number":75,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":76,"context_line":"        existing \u003d engine_regex.sub(\"ENGINE\u003dNDBCLUSTER\", existing)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    return existing"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"class AutoStringTinyText(String):"}],"source_content_type":"text/x-python","patch_set":24,"id":"df140735_eafdb3b1","line":78,"range":{"start_line":67,"start_character":0,"end_line":78,"end_character":19},"updated":"2017-05-31 02:29:52.000000000","message":"Moving this out of the init_ndb_events() function breaks the db sync operation of services like glance and neutron. Moving it back to init_ndb_events and changing the compiler.dialect back to engine.dialect fixes problem. Will do more testing to determine if other services are impacted and then validate back against the tox test before making another revision.","commit_id":"81c6edcd4cb6fb7248a202b09293a992867cc1e3"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    engine.dialect._oslodb_enable_ndb_support \u003d True"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def ndb_status(engine):"},{"line_number":35,"context_line":"    \"\"\"Test if NDB Support is enabled."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    Function to test if NDB support is enabled or not."}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_3240f935","line":34,"updated":"2017-06-20 18:46:11.000000000","message":"call this:\n\n    def ndb_status(engine_or_compiler):\n\nsince we can send a compiler object here too.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    engine.dialect._oslodb_enable_ndb_support \u003d True"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def ndb_status(engine):"},{"line_number":35,"context_line":"    \"\"\"Test if NDB Support is enabled."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    Function to test if NDB support is enabled or not."}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_8d09ecde","line":34,"in_reply_to":"5f201791_3240f935","updated":"2017-06-20 20:25:57.000000000","message":"I\u0027ll make this change.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    Function to test if NDB support is enabled or not."},{"line_number":38,"context_line":"    \"\"\""},{"line_number":39,"context_line":"    if getattr(engine.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":40,"context_line":"        return True"},{"line_number":41,"context_line":"    else:"},{"line_number":42,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_d72d37a9","line":39,"updated":"2017-06-20 18:46:11.000000000","message":"the if/else is redundant here:\n\n    return getattr(\n       engine_or_compiler.dialect, \n       \u0027_oslodb_enable_ndb_support\u0027,\n       False)","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    Function to test if NDB support is enabled or not."},{"line_number":38,"context_line":"    \"\"\""},{"line_number":39,"context_line":"    if getattr(engine.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":40,"context_line":"        return True"},{"line_number":41,"context_line":"    else:"},{"line_number":42,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_2df898c2","line":39,"in_reply_to":"5f201791_d72d37a9","updated":"2017-06-20 20:25:57.000000000","message":"I\u0027ll make this simplification.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        convert InnoDB to NDBCLUSTER, drop SAVEPOINT requests, drop"},{"line_number":57,"context_line":"        ROLLBACK requests, and drop RELEASE SAVEPOINT requests."},{"line_number":58,"context_line":"        \"\"\""},{"line_number":59,"context_line":"        if getattr(engine.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":60,"context_line":"            statement \u003d engine_regex.sub(\"ENGINE\u003dNDBCLUSTER\", statement)"},{"line_number":61,"context_line":"            if re.match(trans_regex, statement):"},{"line_number":62,"context_line":"                statement \u003d \"SET @oslo_db_ndb_savepoint_rollback_disabled \u003d 0;\""}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_9730df09","line":59,"updated":"2017-06-20 18:46:11.000000000","message":"if ndb_status(engine):","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        convert InnoDB to NDBCLUSTER, drop SAVEPOINT requests, drop"},{"line_number":57,"context_line":"        ROLLBACK requests, and drop RELEASE SAVEPOINT requests."},{"line_number":58,"context_line":"        \"\"\""},{"line_number":59,"context_line":"        if getattr(engine.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":60,"context_line":"            statement \u003d engine_regex.sub(\"ENGINE\u003dNDBCLUSTER\", statement)"},{"line_number":61,"context_line":"            if re.match(trans_regex, statement):"},{"line_number":62,"context_line":"                statement \u003d \"SET @oslo_db_ndb_savepoint_rollback_disabled \u003d 0;\""}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_4de194fe","line":59,"in_reply_to":"5f201791_9730df09","updated":"2017-06-20 20:25:57.000000000","message":"Agreed.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return statement, parameters"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @compiles(schema.CreateTable, \"mysql\")"},{"line_number":67,"context_line":"    def prefix_inserts(create_table, compiler, **kw):"},{"line_number":68,"context_line":"        \"\"\"Replace InnoDB with NDBCLUSTER automatically."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        Function will intercept CreateTable() calls and automatically"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_f2b7213a","line":67,"updated":"2017-06-20 18:46:11.000000000","message":"this event handler is redundant (and also incorrect), should be removed","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"7174cdc13da47c30efa38044eff52979b5451900","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return statement, parameters"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @compiles(schema.CreateTable, \"mysql\")"},{"line_number":67,"context_line":"    def prefix_inserts(create_table, compiler, **kw):"},{"line_number":68,"context_line":"        \"\"\"Replace InnoDB with NDBCLUSTER automatically."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        Function will intercept CreateTable() calls and automatically"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_9659d85b","line":67,"in_reply_to":"5f201791_6db570ee","updated":"2017-06-21 23:04:27.000000000","message":"it\u0027s incorrect becaue it is looking at \"engine\", which is not passed to this event handler.\n\nHere\u0027s a test failure (this could be made into a test in the test suite too):\n\n    from oslo_db.sqlalchemy import engines\n    from sqlalchemy import MetaData, Table, Column, Integer\n    from sqlalchemy.schema import CreateTable\n\n    e1 \u003d engines.create_engine(\n        \"mysql+pymysql://scott:tiger@localhost/test\", mysql_enable_ndb\u003dTrue)\n    e2 \u003d engines.create_engine(\n        \"mysql+pymysql://scott:tiger@localhost/test\")\n\n\n    t \u003d Table(\u0027t\u0027, MetaData(), Column(\u0027q\u0027, Integer), mysql_engine\u003d\u0027InnoDB\u0027)\n\n    create \u003d CreateTable(t)\n\n    assert \"NDBCLUSTER\" in str(create.compile(e1))\n\n    assert \"NDBCLUSTER\" not in str(create.compile(e2))\n\n\nnote that NDBCLUSTER is present in both CREATE TABLE statements, even though the second engine does **not** request NDB support, because the function here does not look at the dialect.\n\nThe event handler that\u0027s outside of the listen here should be sufficient as it is global once ndb.py is imported; the Neutron case is likely that the flag is still not being set up correctly.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"fb7ce14cabe0c43b42fd078596f43adf989a7530","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return statement, parameters"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @compiles(schema.CreateTable, \"mysql\")"},{"line_number":67,"context_line":"    def prefix_inserts(create_table, compiler, **kw):"},{"line_number":68,"context_line":"        \"\"\"Replace InnoDB with NDBCLUSTER automatically."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        Function will intercept CreateTable() calls and automatically"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_41bdb8b5","line":67,"in_reply_to":"5f201791_9659d85b","updated":"2017-06-21 23:38:18.000000000","message":"I\u0027ll have to take a closer look at why Neutron and Glance don\u0027t work without this being here before removing or changing this.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return statement, parameters"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @compiles(schema.CreateTable, \"mysql\")"},{"line_number":67,"context_line":"    def prefix_inserts(create_table, compiler, **kw):"},{"line_number":68,"context_line":"        \"\"\"Replace InnoDB with NDBCLUSTER automatically."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        Function will intercept CreateTable() calls and automatically"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_6db570ee","line":67,"in_reply_to":"5f201791_f2b7213a","updated":"2017-06-20 20:25:57.000000000","message":"I\u0027ve tried removing this, but it ends up breaking neutron and a few others. So I\u0027ve kept it here. What\u0027s incorrect with this one?","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    convert InnoDB to NDBCLUSTER. Targets compiler events."},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":"    existing \u003d compiler.visit_create_table(create_table, **kw)"},{"line_number":88,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":89,"context_line":"        existing \u003d engine_regex.sub(\"ENGINE\u003dNDBCLUSTER\", existing)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    return existing"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_b2e88916","line":88,"updated":"2017-06-20 18:46:11.000000000","message":"use ndb_status:\n\n    if ndb_status(compiler):\n\nthe hardcoded string \"_oslodb_enable_ndb_support\" and the method we use to set/get this flag, should be in only two places, once in the setter function, once in the getter function.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    convert InnoDB to NDBCLUSTER. Targets compiler events."},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":"    existing \u003d compiler.visit_create_table(create_table, **kw)"},{"line_number":88,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":89,"context_line":"        existing \u003d engine_regex.sub(\"ENGINE\u003dNDBCLUSTER\", existing)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    return existing"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_ada028a7","line":88,"in_reply_to":"5f201791_b2e88916","updated":"2017-06-20 20:25:57.000000000","message":"Agreed.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"@compiles(AutoStringTinyText, \u0027mysql\u0027)"},{"line_number":104,"context_line":"def _auto_string_tiny_text(element, compiler, **kw):"},{"line_number":105,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":106,"context_line":"        return \"TINYTEXT\""},{"line_number":107,"context_line":"    else:"},{"line_number":108,"context_line":"        return compiler.visit_string(element, **kw)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_52f7f5f6","line":105,"updated":"2017-06-20 18:46:11.000000000","message":"if ndb_status(compiler):","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"@compiles(AutoStringTinyText, \u0027mysql\u0027)"},{"line_number":104,"context_line":"def _auto_string_tiny_text(element, compiler, **kw):"},{"line_number":105,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":106,"context_line":"        return \"TINYTEXT\""},{"line_number":107,"context_line":"    else:"},{"line_number":108,"context_line":"        return compiler.visit_string(element, **kw)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_6daa1086","line":105,"in_reply_to":"5f201791_52f7f5f6","updated":"2017-06-20 20:25:57.000000000","message":"Agreed.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"@compiles(AutoStringText, \u0027mysql\u0027)"},{"line_number":121,"context_line":"def _auto_string_text(element, compiler, **kw):"},{"line_number":122,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":123,"context_line":"        return \"TEXT\""},{"line_number":124,"context_line":"    else:"},{"line_number":125,"context_line":"        return compiler.visit_string(element, **kw)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_b2d1a95a","line":122,"updated":"2017-06-20 18:46:11.000000000","message":"if ndb_status(compiler)","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"@compiles(AutoStringText, \u0027mysql\u0027)"},{"line_number":121,"context_line":"def _auto_string_text(element, compiler, **kw):"},{"line_number":122,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":123,"context_line":"        return \"TEXT\""},{"line_number":124,"context_line":"    else:"},{"line_number":125,"context_line":"        return compiler.visit_string(element, **kw)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_2d941844","line":122,"in_reply_to":"5f201791_b2d1a95a","updated":"2017-06-20 20:25:57.000000000","message":"Agreed.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        super(AutoStringSize, self).__init__(length\u003dlength, **kw)"},{"line_number":141,"context_line":"        self.innodb_size \u003d innodb_size"},{"line_number":142,"context_line":"        self.ndb_size \u003d ndb_size"},{"line_number":143,"context_line":"        self.length \u003d length"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_f2be01fe","line":142,"updated":"2017-06-20 18:46:11.000000000","message":"can ndb_size be determined automatically?  it\u0027s basically just a shorter limit right?  \n\nwhat\u0027s the difference between \"length\" and \"innodb_size\" ?","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"354f3a11669531788aad06cbd6251a6e56c10f36","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        super(AutoStringSize, self).__init__(length\u003dlength, **kw)"},{"line_number":141,"context_line":"        self.innodb_size \u003d innodb_size"},{"line_number":142,"context_line":"        self.ndb_size \u003d ndb_size"},{"line_number":143,"context_line":"        self.length \u003d length"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_49ddda12","line":142,"in_reply_to":"5f201791_13571505","updated":"2017-06-22 05:05:10.000000000","message":"InnoDB and NDB use the same MySQL standard for the syntax and object types. So from a MySQL perspective the differences have more to do with storage engine level features (snapshots, replication, clustering, how data is physically stored, etc.). Now one of the big differences that we have to contend with is the maximum row length that the engines support. InnoDB supports 65k and NDB 14k. So in OpenStack, we have some tables that go over the 14k limit. This is only a handful, that are in services that could use some database schema cleanup; like Cinder, Nova, Neutron. In these few use cases, we have to change the size of some of the columns to bring the table back within the 14k row limit. Selecting which ones and how much we can shrink them is based off criteria such as.. what is the column being used for? How much space is actually required for the possible values? Is it being used for an index or foreign key? Etc. Typically, I\u0027ll pick the columns that hold status info (i.e. active, inactive, failed, etc.) because these don\u0027t need 255 chars and they are usually not used for indexes or FKCs. The other most common use case are columns that contain text output from commands (i.e. iscsi commands, NFS shares, SSL keys, etc.) and turn those to TEXT blobs.\n\nSo the point of these functions is to remove the need for doing if/then logic and make it a simple function call that will change the size or type based on the engine being used. In this case, the size of the string column.\n\nSo to your question on if applications need to be aware of how large they make tables? Absolutely! Even without NDB, there have been cases where tables have crossed the 65k limit, which causes teams to reorganize tables and split things out into multiple tables. This has happened with Neutron, Nova, and Cinder in the past. It\u0027s part of the churn. So bringing NDB into the picture doesn\u0027t introduce something completely new from a database schema perspective. It just increases the chances of a really large table having to be modified sooner, rather than later. There are some good services like Barbican and Designate that have put more thought into their database schemas and don\u0027t waste space unnecessarily or make use of TEXT blobs for sensible things.\n\nNow considering that my company is heavily invested in using MySQL Cluster (NDB) and that we use the kola framework, we have to keep an eye on each of the services to make sure that it works. This is why you see lots of other patches that I\u0027m working on to fix services like Cinder, Neutron, Nova, etc. So has time goes by, we will continue to make patches to enable these services to work with NDB.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"d70d17ed400a01c052847bbbfd6966ac12866843","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        super(AutoStringSize, self).__init__(length\u003dlength, **kw)"},{"line_number":141,"context_line":"        self.innodb_size \u003d innodb_size"},{"line_number":142,"context_line":"        self.ndb_size \u003d ndb_size"},{"line_number":143,"context_line":"        self.length \u003d length"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_13571505","line":142,"in_reply_to":"5f201791_410b788d","updated":"2017-06-22 02:09:04.000000000","message":"\u003e  If you recall, you were the one who suggested this approach to eliminate the if/then logic that was in my original patches for the other services.\n\nyes, but that was just to get us started.  now it\u0027s time to reduce things that aren\u0027t needed, if they are in fact not needed:\n\n1. what is the max size on NDB for varchar?  Is it 64?  Or is this based on a \"row size\" that is across the whole table?\n\nFor the next four questions, only answer them **if the answer to #1 is \"64\"*, or some fixed number N - otherwise, skip to the next section:\n\n2. **If the answer to #1 is \"64\"*: If given a column has size 255 as the default / mysql / etc.   when would you *not* use 64 as the size for NDB?\n\n3. **If the answer to #1 is \"64\"*: same, given size of say, 129?\n\n4. **If the answer to #1 is \"64\"*: If a given column has size 58 as the default / mysql /etc.  when would you *not* use 58 as the size for NDB?\n\nI can sum up all of 1-4 as the following:\n\n5. **If the answer to #1 is \"64\"*: Why is the ndb_size not simply:\n\n   self.ndb_size \u003d min(self.innodb_size, 64)\n\n?\n\nNow, I see you have used the phrase \"fit within the NDB row size\", which implies, there\u0027s a \"row size\" we are working towards.    Meaning, it\u0027s not \"NDB is \u003c64 chars\", it\u0027s, \"there\u0027s a row size we need to not go over\".   As I said, if that is the case, then:\n\n1. how will openstack applications then be able to add new columns to a table, if all the existing columns have already maxed out the NDB \"row size\"?   Is this an issue we\u0027re going to have to anticipate ?","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"fb7ce14cabe0c43b42fd078596f43adf989a7530","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        super(AutoStringSize, self).__init__(length\u003dlength, **kw)"},{"line_number":141,"context_line":"        self.innodb_size \u003d innodb_size"},{"line_number":142,"context_line":"        self.ndb_size \u003d ndb_size"},{"line_number":143,"context_line":"        self.length \u003d length"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_410b788d","line":142,"in_reply_to":"5f201791_61ff9401","updated":"2017-06-21 23:38:18.000000000","message":"I think you are misunderstanding what this function is for and why it is being used. This function doesn\u0027t look at the row size or try to magically figure out what the column size should be. Tables across the OpenStack services very significantly and to build some automated logic is way beyond the scope of work here and is overkill.  So the intent here is that the developer( i.e. ME) would have to make a decision on if a string column needs to be adjusted to fit within the NDB row size and determine the optimal length. By using this function, we avoid having to do if/then logic in the SQL Alchemy or Alembic scripts for InnoDB vs. NDB use cases. Instead, one would just adjust the String(255) to ndb.AutoStringSize(255, 64) so that if InnoDB is turned on it\u0027ll be 255 and if it NDB is turned on then it\u0027ll be 64. If you recall, you were the one who suggested this approach to eliminate the if/then logic that was in my original patches for the other services. Hopefully this recap clears things up for you.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"7174cdc13da47c30efa38044eff52979b5451900","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        super(AutoStringSize, self).__init__(length\u003dlength, **kw)"},{"line_number":141,"context_line":"        self.innodb_size \u003d innodb_size"},{"line_number":142,"context_line":"        self.ndb_size \u003d ndb_size"},{"line_number":143,"context_line":"        self.length \u003d length"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_61ff9401","line":142,"in_reply_to":"5f201791_cda80479","updated":"2017-06-21 23:04:27.000000000","message":"\u003e No it can\u0027t be determined automatically as the table may have multiple columns that need to be adjusted\n\nIs the idea that ndb_size is based on the total size of *all* character columns in the row?   E.g. it\u0027s not just that the size is maxed out at 50 or something.\n\nIf NDB has a simple \"smaller max\" for the size, then this could be automatic, since it is just max(given_length, ndb_max).    But if these have to be hand-picked based on \"total row size\", that\u0027s a lot more elaborate (and how will openstack applications then be able to add new columns to a table??)","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        super(AutoStringSize, self).__init__(length\u003dlength, **kw)"},{"line_number":141,"context_line":"        self.innodb_size \u003d innodb_size"},{"line_number":142,"context_line":"        self.ndb_size \u003d ndb_size"},{"line_number":143,"context_line":"        self.length \u003d length"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_cda80479","line":142,"in_reply_to":"5f201791_f2be01fe","updated":"2017-06-20 20:25:57.000000000","message":"No it can\u0027t be determined automatically as the table may have multiple columns that need to be adjusted. So the function here will take two arguments, the size we want for InnoDB and the size we want for NDB. Length is the value that will be returned to the compiler after we make our determination of which size to use.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"@compiles(AutoStringSize, \u0027mysql\u0027)"},{"line_number":147,"context_line":"def _auto_string_size(element, compiler, **kw):"},{"line_number":148,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":149,"context_line":"        element.length \u003d element.ndb_size"},{"line_number":150,"context_line":"        return compiler.visit_string(element, **kw)"},{"line_number":151,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_b25f69e4","line":148,"updated":"2017-06-20 18:46:11.000000000","message":"if ndb_status(compiler):","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"@compiles(AutoStringSize, \u0027mysql\u0027)"},{"line_number":147,"context_line":"def _auto_string_size(element, compiler, **kw):"},{"line_number":148,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":149,"context_line":"        element.length \u003d element.ndb_size"},{"line_number":150,"context_line":"        return compiler.visit_string(element, **kw)"},{"line_number":151,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_6db1f0e1","line":148,"in_reply_to":"5f201791_b25f69e4","updated":"2017-06-20 20:25:57.000000000","message":"Agreed.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":146,"context_line":"@compiles(AutoStringSize, \u0027mysql\u0027)"},{"line_number":147,"context_line":"def _auto_string_size(element, compiler, **kw):"},{"line_number":148,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":149,"context_line":"        element.length \u003d element.ndb_size"},{"line_number":150,"context_line":"        return compiler.visit_string(element, **kw)"},{"line_number":151,"context_line":"    else:"},{"line_number":152,"context_line":"        element.length \u003d element.innodb_size"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_b20409c8","line":149,"updated":"2017-06-20 18:46:11.000000000","message":"it\u0027s very poor practice to mutate the element here.   for the compilation, just make a new string object.  Assuming we can do away with innodb_size and just have ndb_size:\n\n    if ndb_status(compiler):\n        return compiler.process(VARCHAR(element.ndb_size), **kw)\n    else:\n       return compiler.visit_string(element, **kw)\n\ndoes NDB VARCHAR have all the COLLATE / encoding / etc. options as well?","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"fb7ce14cabe0c43b42fd078596f43adf989a7530","unresolved":false,"context_lines":[{"line_number":146,"context_line":"@compiles(AutoStringSize, \u0027mysql\u0027)"},{"line_number":147,"context_line":"def _auto_string_size(element, compiler, **kw):"},{"line_number":148,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":149,"context_line":"        element.length \u003d element.ndb_size"},{"line_number":150,"context_line":"        return compiler.visit_string(element, **kw)"},{"line_number":151,"context_line":"    else:"},{"line_number":152,"context_line":"        element.length \u003d element.innodb_size"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_41cc9834","line":149,"in_reply_to":"5f201791_4165b8b4","updated":"2017-06-21 23:38:18.000000000","message":"I\u0027ll take a look at dropping the innodb_size and just use length for that variable. I\u0027ll have to test this against the services that I know this works with today. As far as any concerns about Postgresql, if I do drop innodb_size, will that address your API concerns? If not, then I\u0027d like your guidance on how to address that. I would assume that the \"@compiles(AutoStringSize, \u0027mysql\u0027)\" should have addressed this to only effect mysql events. Are there other flags or things we have to add to this module to prevent this from effecting any non-MySQL databases? Also, in your example, when you create the tables, shouldn\u0027t the different engines prevent this from crossing over? Or do we have another bug here? Would there ever be a use case where a customer is using different database flavors within the context a single OpenStack service? In all of the services I\u0027ve worked on and clients I\u0027ve worked with, I haven\u0027t seen this.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"d70d17ed400a01c052847bbbfd6966ac12866843","unresolved":false,"context_lines":[{"line_number":146,"context_line":"@compiles(AutoStringSize, \u0027mysql\u0027)"},{"line_number":147,"context_line":"def _auto_string_size(element, compiler, **kw):"},{"line_number":148,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":149,"context_line":"        element.length \u003d element.ndb_size"},{"line_number":150,"context_line":"        return compiler.visit_string(element, **kw)"},{"line_number":151,"context_line":"    else:"},{"line_number":152,"context_line":"        element.length \u003d element.innodb_size"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_b3f501ce","line":149,"in_reply_to":"5f201791_41cc9834","updated":"2017-06-22 02:09:04.000000000","message":"\u003e As far as any concerns about Postgresql, if I do drop innodb_size, will that address your API concerns?\n\nI work iteratively so once we do that, we can look again, but as it stands I don\u0027t think innodb_size is accomplishing anything.\n\n\u003e I would assume that the \"@compiles(AutoStringSize, \u0027mysql\u0027)\" should have addressed this to only effect mysql events.\n\nThat is true, however the \"AutoStringSize\" type object is being used directly in place of String throughout all the openstack applications, and it has an API that is not directly compatible with that of String; as I illustrated in the Neutron file, the length of \"8191\" in that example was not also applied to \"length\" so the behavior was changed.\n\n\u003e Are there other flags or things we have to add to this module to prevent this from effecting any non-MySQL databases? \n\nJust that when you find an occurence of \"String()\" in a migration file and replace it with AutoStringSize, you make sure every argument passed to String() is properly accounted for in that the state of the underlying String is built up the same way as it was before.  I don\u0027t think Openstack is using any of the other arguments (they would be things like \"collation\", mostly applicable to MySQL anyway).\n\n\u003e Also, in your example, when you create the tables, shouldn\u0027t the different engines prevent this from crossing over?\n\nThat\u0027s the plan yes but as implemented here you are altering the state of the type object which stays permanent when received by a different compilation function.\n\n\u003e Would there ever be a use case where a customer is using different database flavors within the context a single OpenStack service? \n\nabsolutely, when we run the test suites which run against SQlite, Mysql, and Postgresql all in one run.  There is currently process-level isolation that is helping here but it is poor practice to rely upon a distant artifact of the test suite to resolve an issue that doesn\u0027t need to exist in the first place.    Additionally, Openstack applications definitely may want to be able to use multiple kinds of databases at once, an Openstack application may someday want to interact with some library that happens to use a SQLite database; we don\u0027t want to get in the habit of producing side effects that leak out of where we need them to be.   \n\nWith the override for CreateTable and with the fact that AutoStringSize replaces \"String\" everywhere, we are dealing with global state.  It is important that we are careful to not produce side effects.\n\n\u003e In all of the services I\u0027ve worked on and clients I\u0027ve worked with, I haven\u0027t seen this.\n\nthat doesn\u0027t mean it won\u0027t happen someday and if we bury this subtle, hard-to-spot global side effect here, it will be a total nightmare when it suddenly pops up randomly.   \n\nThere\u0027s not a need to decide if these practices should be followed or not as I have already provided implementations that solve all these problems, it\u0027s just a matter of using them.   For the typing issue, make a local copy of the type object with the \"length\" that you need and \"visit\" that, or just spit out the string \"VARCHAR(\u003cwhatever\u003e)\" yourself for the NDB case.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"7174cdc13da47c30efa38044eff52979b5451900","unresolved":false,"context_lines":[{"line_number":146,"context_line":"@compiles(AutoStringSize, \u0027mysql\u0027)"},{"line_number":147,"context_line":"def _auto_string_size(element, compiler, **kw):"},{"line_number":148,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":149,"context_line":"        element.length \u003d element.ndb_size"},{"line_number":150,"context_line":"        return compiler.visit_string(element, **kw)"},{"line_number":151,"context_line":"    else:"},{"line_number":152,"context_line":"        element.length \u003d element.innodb_size"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_4165b8b4","line":149,"in_reply_to":"5f201791_88a55ab8","updated":"2017-06-21 23:04:27.000000000","message":"\u003e Length is set to None in the class __init__, \n\nAs it is now, unless \"length\" is named explictly, this AutoStringSize datatype has moved \"length\" out as the first positional argument, which unnecessarily breaks the API for any dialect other than MySQL, e.g. such as in https://review.openstack.org/#/c/446136/8/neutron/db/migration/alembic_migrations/versions/mitaka/expand/31ed664953e6_add_resource_versions_row_to_agent_table.py. This datatype would resolve to \"VARCHAR(8191)\" on all databases, now it comes out as \"VARCHAR\" on Postgresql, SQLite (unless the program also resolves the datatype against MySQL in the same process, see below).   It happens to not matter much for those two databases as their VARCHAR types can be efficiently un-lengthed, but it still inappropriately removes the length limits for those databases (and any others that are supported in the future).\n\nBeyond the API breakage, there\u0027s no case where innodb_size would ever be different from length; these two numbers should always be identical which means innodb_size is redundant.  \n\n\u003e Any specific reason why this isn\u0027t good for an element setting here? \n\nwhen a compilation function mutates the thing it is compiling it leaks that side effect into the rest of the application.   Just like the case of the Table, here\u0027s the test illustrating the failure:\n\n    from oslo_db.sqlalchemy import engines\n    from oslo_db.sqlalchemy.ndb import AutoStringSize\n    from sqlalchemy import MetaData, Table, Column, Integer\n    from sqlalchemy.schema import CreateTable\n\n    e1 \u003d engines.create_engine(\n        \"mysql+pymysql://scott:tiger@localhost/test\", mysql_enable_ndb\u003dTrue)\n    e2 \u003d engines.create_engine(\n        \"postgresql://scott:tiger@localhost/test\")\n\n\n    t \u003d Table(\n        \u0027t\u0027, MetaData(),\n        Column(\u0027q\u0027, AutoStringSize(innodb_size\u003d50, ndb_size\u003d20, length\u003d50)),\n        mysql_engine\u003d\u0027InnoDB\u0027\n    )\n\n    create \u003d CreateTable(t)\n\n    # Postgresql wants VARCHAR(50)\n    assert \"VARCHAR(50)\" in str(create.compile(e2))\n\n    # NDB wants VARCHAR(20)\n    assert \"VARCHAR(20)\" in str(create.compile(e1))\n\n    # Postgresql wants VARCHAR(50) - fails\n    assert \"VARCHAR(50)\" in str(create.compile(e2))\n\n\u003e I do see examples of element being mutated in SQL Alchemy in sql/elements.py, sql/annotation.py, and sql/selectable.py. \n\nMutation by itself is not the issue, it\u0027s mutation as a side effect of calling a function, passing an object that was generated on the outside of that function.   If I pass an object to some function that is going to give me some result based on what\u0027s in that structure, it should not modify the structure.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":146,"context_line":"@compiles(AutoStringSize, \u0027mysql\u0027)"},{"line_number":147,"context_line":"def _auto_string_size(element, compiler, **kw):"},{"line_number":148,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":149,"context_line":"        element.length \u003d element.ndb_size"},{"line_number":150,"context_line":"        return compiler.visit_string(element, **kw)"},{"line_number":151,"context_line":"    else:"},{"line_number":152,"context_line":"        element.length \u003d element.innodb_size"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_88a55ab8","line":149,"in_reply_to":"5f201791_b20409c8","updated":"2017-06-20 20:25:57.000000000","message":"Length is set to None in the class __init__, here we are setting it to either the InnoDB or NDB size that we want depending on which one is enabled. Any specific reason why this isn\u0027t good for an element setting here? I do see examples of element being mutated in SQL Alchemy in sql/elements.py, sql/annotation.py, and sql/selectable.py. Also, this is modeled after the mysql dialect modules in SQL Alchemy. Any reason why you are suggested a different approach from what you originally suggested here? Are there any benefits or pros/cons on these two approaches?\n\nNDB VARCHAR isn\u0027t different from InnoDB VARCHAR in capabilities or options. The difference is in the storage engine layer and the limits on row lengths.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"354f3a11669531788aad06cbd6251a6e56c10f36","unresolved":false,"context_lines":[{"line_number":146,"context_line":"@compiles(AutoStringSize, \u0027mysql\u0027)"},{"line_number":147,"context_line":"def _auto_string_size(element, compiler, **kw):"},{"line_number":148,"context_line":"    if getattr(compiler.dialect, \u0027_oslodb_enable_ndb_support\u0027, False):"},{"line_number":149,"context_line":"        element.length \u003d element.ndb_size"},{"line_number":150,"context_line":"        return compiler.visit_string(element, **kw)"},{"line_number":151,"context_line":"    else:"},{"line_number":152,"context_line":"        element.length \u003d element.innodb_size"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_44bca1db","line":149,"in_reply_to":"5f201791_b3f501ce","updated":"2017-06-22 05:05:10.000000000","message":"So, I\u0027ve tested dropping the innodb_size and using length in standard position and this seems to work just fine. So, I\u0027ll have that in the next version of the patch. Should that address your concerns on this leaking globally across String()?\n\nThe thing I have to chase down is why removing the duplicate event breaks Glance and Neutron.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ef06aa8ead656106de3f41efe57ae1bc49f3a0c8","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        Function adds the innodb_size and ndb_size arguments to the"},{"line_number":125,"context_line":"        function String()."},{"line_number":126,"context_line":"        \"\"\""},{"line_number":127,"context_line":"        super(AutoStringSize, self).__init__(length\u003dlength, **kw)"},{"line_number":128,"context_line":"        self.ndb_size \u003d ndb_size"},{"line_number":129,"context_line":"        self.length \u003d length"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"5f201791_9b7f2565","line":127,"updated":"2017-06-27 18:03:07.000000000","message":"perfect, thanks!","commit_id":"c5db636d4e4b20346061caf86729bc9299c62754"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ef06aa8ead656106de3f41efe57ae1bc49f3a0c8","unresolved":false,"context_lines":[{"line_number":132,"context_line":"@compiles(AutoStringSize, \u0027mysql\u0027)"},{"line_number":133,"context_line":"def _auto_string_size(element, compiler, **kw):"},{"line_number":134,"context_line":"    if ndb_status(compiler):"},{"line_number":135,"context_line":"        return compiler.process(VARCHAR(element.ndb_size), **kw)"},{"line_number":136,"context_line":"    else:"},{"line_number":137,"context_line":"        return compiler.visit_string(element, **kw)"}],"source_content_type":"text/x-python","patch_set":27,"id":"5f201791_9ba6050f","line":135,"updated":"2017-06-27 18:03:07.000000000","message":"perfect, that\u0027s all it needed.  thanks!","commit_id":"c5db636d4e4b20346061caf86729bc9299c62754"}],"oslo_db/sqlalchemy/utils.py":[{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"ac49f60747d4c9d6d343c8fc8fe194c1f573826b","unresolved":false,"context_lines":[{"line_number":1139,"context_line":"    return [i[0] for i in noninnodb]"},{"line_number":1140,"context_line":""},{"line_number":1141,"context_line":""},{"line_number":1142,"context_line":"def get_non_ndbcluster_tables(connectable, skip_tables\u003dNone):"},{"line_number":1143,"context_line":"    \"\"\"Get a list of tables which don\u0027t use MySQL Cluster (NDB) storage engine."},{"line_number":1144,"context_line":""},{"line_number":1145,"context_line":"    :param connectable: a SQLAlchemy Engine or Connection instance"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_72279166","line":1142,"updated":"2017-06-20 18:46:11.000000000","message":"is this being used somewhere?","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"df7fd1bec03ba0a0c7f0d5c95f1c681304a165cd","unresolved":false,"context_lines":[{"line_number":1139,"context_line":"    return [i[0] for i in noninnodb]"},{"line_number":1140,"context_line":""},{"line_number":1141,"context_line":""},{"line_number":1142,"context_line":"def get_non_ndbcluster_tables(connectable, skip_tables\u003dNone):"},{"line_number":1143,"context_line":"    \"\"\"Get a list of tables which don\u0027t use MySQL Cluster (NDB) storage engine."},{"line_number":1144,"context_line":""},{"line_number":1145,"context_line":"    :param connectable: a SQLAlchemy Engine or Connection instance"}],"source_content_type":"text/x-python","patch_set":26,"id":"5f201791_0dd95c82","line":1142,"in_reply_to":"5f201791_72279166","updated":"2017-06-20 20:25:57.000000000","message":"Yes, this is used in the test_ndb.py module.","commit_id":"69b70075737d6febbcd64215bfd80094aefd5e35"}],"oslo_db/tests/sqlalchemy/test_sqlalchemy.py":[{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"876c5202536131448717a322f113af70e7dacbba","unresolved":false,"context_lines":[{"line_number":331,"context_line":"        }"},{"line_number":332,"context_line":"        for optname, optvalue in overrides.items():"},{"line_number":333,"context_line":"            conf.set_override(optname, optvalue, group\u003d\u0027database\u0027)"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"        session.EngineFacade.from_config(conf,"},{"line_number":336,"context_line":"                                         autocommit\u003dFalse,"},{"line_number":337,"context_line":"                                         expire_on_commit\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_93bfa6fa","line":334,"updated":"2017-03-01 17:18:08.000000000","message":"we\u0027ll need to probably add a test_ndb.py test suite and ensure all these codepaths do what\u0027s expected","commit_id":"7a891efbe9898e707424b2b6c418ebce9758ae03"}]}
