From: magnus.blaudd Date: November 6 2012 12:56pm Subject: bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:5025 to 5026) List-Archive: http://lists.mysql.com/commits/145280 Message-Id: <20121106125642.8427.73206.5026@wholphin> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 5026 magnus.blaudd@stripped 2012-11-06 ndb - add MCP patch for bug 51828 also also to 7.0 which we hit when adding SQL to create ndbinfo tables to mysql_system_tables.sql - same patch as in 7.1 modified: client/mysql_upgrade.c scripts/comp_sql.c 5025 magnus.blaudd@stripped 2012-11-06 [merge] Merge modified: mysql-test/suite/ndb/r/ndb_basic.result mysql-test/suite/ndb/r/ndb_index.result mysql-test/suite/ndb/t/ndb_index.test sql/ha_ndbcluster.cc storage/ndb/src/ndbapi/ndberror.c === modified file 'client/mysql_upgrade.c' --- a/client/mysql_upgrade.c 2012-10-22 09:11:12 +0000 +++ b/client/mysql_upgrade.c 2012-11-06 12:45:44 +0000 @@ -766,10 +766,42 @@ static int run_sql_fix_privilege_tables( if (init_dynamic_string(&ds_result, "", 512, 512)) die("Out of memory"); +#ifndef MCP_BUG51828 + /* + The SQL to run are kept in a big array of string in order + to avoid hitting compiler limits for max string length, + concatenate the strings into dynamic memory before + running the SQL. Significant parts of patch for bug#51828 + backported from trunk + */ + { + const char **query_ptr; + DYNAMIC_STRING ds_script; + + if (init_dynamic_string(&ds_script, "", 65536, 1024)) + die("Out of memory"); + + for ( query_ptr= &mysql_fix_privilege_tables[0]; + *query_ptr != NULL; + query_ptr++ + ) + { + dynstr_append(&ds_script, *query_ptr); + } + + verbose("Running 'mysql_fix_privilege_tables'..."); + run_query(ds_script.str, + &ds_result, /* Collect result */ + TRUE); + + dynstr_free(&ds_script); + } +#else verbose("Running 'mysql_fix_privilege_tables'..."); run_query(mysql_fix_privilege_tables, &ds_result, /* Collect result */ TRUE); +#endif { /* === modified file 'scripts/comp_sql.c' --- a/scripts/comp_sql.c 2009-05-26 18:53:34 +0000 +++ b/scripts/comp_sql.c 2012-11-06 12:45:44 +0000 @@ -74,7 +74,16 @@ int main(int argc, char *argv[]) if (!(out= fopen(outfile_name, "w"))) die("Failed to open output file '%s'", outfile_name); +#ifndef MCP_BUG51828 + /* + Print the SQL as an array of strings instead of one + large string in order to avoid compiler limit on max string length. + Significant parts of patch for bug#51828 backported from trunk. + */ + fprintf(out, "const char* %s[]={\n\"", struct_name); +#else fprintf(out, "const char* %s={\n\"", struct_name); +#endif while (fgets(buff, sizeof(buff), in)) { @@ -115,9 +124,17 @@ int main(int argc, char *argv[]) */ fprintf(out, "\"\n\""); } +#ifndef MCP_BUG51828 + /* new line -> convert to new entry in array */ + fprintf(out, "\",\n\""); +#endif } +#ifndef MCP_BUG51828 + fprintf(out, "\",\nNULL\n};\n"); +#else fprintf(out, "\\\n\"};\n"); +#endif fclose(in); fclose(out); No bundle (reason: useless for push emails).