From a798377f983deb3c2db8ca93e97e7b86fd5ed1f7 Mon Sep 17 00:00:00 2001 From: Ryan Graham Date: Tue, 9 Aug 2016 18:33:34 -0700 Subject: [PATCH] test: skip cardinality, update sub_part Index cardinality is actually a metric that is based on MySQL analyzing the table contents, so its value here has more to do with whether the tests are running against a new table, an old table, or whether it has any data in it. The Sub_part field is similarly unimportant for the purposes of these tests since it refers to indexing internals based on data type and partial indexing. See: https://dev.mysql.com/doc/refman/5.5/en/show-index.html --- test/migration.test.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test/migration.test.js b/test/migration.test.js index 4a84196..9118b7d 100644 --- a/test/migration.test.js +++ b/test/migration.test.js @@ -89,7 +89,10 @@ describe('migrations', function () { Seq_in_index: 1, Column_name: 'id', Collation: 'A', - Cardinality: 0, + // XXX: this actually has more to do with whether the table existed or not and + // what kind of data is in it that MySQL has analyzed: + // https://dev.mysql.com/doc/refman/5.5/en/show-index.html + // Cardinality: /^5\.[567]/.test(mysqlVersion) ? 0 : null, Sub_part: null, Packed: null, Null: '', @@ -102,8 +105,11 @@ describe('migrations', function () { Seq_in_index: 1, Column_name: 'email', Collation: 'A', - Cardinality: /^5\.7/.test(mysqlVersion) ? 0 : null, - Sub_part: /^5\.7/.test(mysqlVersion) ? null : 333, + // XXX: this actually has more to do with whether the table existed or not and + // what kind of data is in it that MySQL has analyzed: + // https://dev.mysql.com/doc/refman/5.5/en/show-index.html + // Cardinality: /^5\.[567]/.test(mysqlVersion) ? 0 : null, + Sub_part: /^5\.7/.test(mysqlVersion) ? null : /^5\.5/.test(mysqlVersion) ? 255 : 333, Packed: null, Null: '', Index_type: 'BTREE', @@ -115,8 +121,11 @@ describe('migrations', function () { Seq_in_index: 1, Column_name: 'email', Collation: 'A', - Cardinality: /^5\.7/.test(mysqlVersion) ? 0 : null, - Sub_part: /^5\.7/.test(mysqlVersion) ? null : 333, + // XXX: this actually has more to do with whether the table existed or not and + // what kind of data is in it that MySQL has analyzed: + // https://dev.mysql.com/doc/refman/5.5/en/show-index.html + // Cardinality: /^5\.[567]/.test(mysqlVersion) ? 0 : null, + Sub_part: /^5\.7/.test(mysqlVersion) ? null : /^5\.5/.test(mysqlVersion) ? 255 : 333, Packed: null, Null: '', Index_type: 'BTREE',