Permalink
Browse files

Fix the DB charset-corruption test to handle long descriptions. Backp…

…orts [22747] and [22749] from trunk.

git-svn-id: http://svn.mythtv.org/svn/branches/release-0-22-fixes@22750 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
1 parent 45f9a89 commit ab98d03477b985315a1cf70f7b109677b0f72125 @sphery sphery committed Nov 6, 2009
Showing with 17 additions and 8 deletions.
  1. +17 −8 mythtv/libs/libmythtv/dbcheck.cpp
@@ -3628,6 +3628,7 @@ NULL
QString thequery = QString("CREATE TEMPORARY TABLE temp_%1 "
"SELECT * FROM %2;")
.arg(table).arg(table);
+ QString modify;
ok &= query.exec(thequery);
if (ok)
{
@@ -3636,9 +3637,12 @@ NULL
for (column = columns.constBegin();
column != columns.constEnd(); ++column)
{
- thequery.append(QString(" MODIFY %1 varbinary(255) "
- " NOT NULL default '',")
- .arg(*column));
+ if ("description" == *column)
+ modify = " MODIFY %1 BLOB NOT NULL,";
+ else
+ modify = " MODIFY %1 VARBINARY(255)"
+ " NOT NULL default '',";
+ thequery.append(modify.arg(*column));
}
thequery.chop(1);
thequery.append(";");
@@ -3651,11 +3655,16 @@ NULL
for (column = columns.constBegin();
column != columns.constEnd(); ++column)
{
- thequery.append(QString(" MODIFY %1 char(255) "
- " CHARACTER SET utf8 "
- " COLLATE utf8_bin "
- " NOT NULL default '',")
- .arg(*column));
+ if ("description" == *column)
+ modify = " MODIFY %1 TEXT"
+ " CHARACTER SET utf8 "
+ " COLLATE utf8_bin ";
+ else
+ modify = " MODIFY %1 CHAR(255)"
+ " CHARACTER SET utf8 "
+ " COLLATE utf8_bin "
+ " NOT NULL default '',";
+ thequery.append(modify.arg(*column));
}
thequery.chop(1);
thequery.append(";");

0 comments on commit ab98d03

Please sign in to comment.