scripts/dbupgrade2_tool.pl: UTF-8-encodierte Upgradescripte richtig behandeln
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 30 Jan 2013 17:52:58 +0000 (18:52 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 30 Jan 2013 18:07:46 +0000 (19:07 +0100)
scripts/dbupgrade2_tool.pl

index 3ed2186..50cd27b 100755 (executable)
@@ -331,6 +331,9 @@ sub apply_upgrade {
     exit 0;
   }
 
+  my $db_charset = $::lx_office_conf{system}->{dbcharset};
+  $db_charset ||= Common::DEFAULT_CHARSET();
+
   foreach my $control (@upgradescripts) {
     $control->{file} =~ /\.(sql|pl)$/;
     my $file_type = $1;
@@ -339,9 +342,9 @@ sub apply_upgrade {
     print "Applying upgrade $control->{file}\n";
 
     if ($file_type eq "sql") {
-      $dbupgrader->process_query($dbh, "sql/$form->{dbdriver}-upgrade2/$control->{file}", $control);
+      $dbupgrader->process_query($dbh, "sql/$form->{dbdriver}-upgrade2/$control->{file}", $control, $db_charset);
     } else {
-      $dbupgrader->process_perl_script($dbh, "sql/$form->{dbdriver}-upgrade2/$control->{file}", $control);
+      $dbupgrader->process_perl_script($dbh, "sql/$form->{dbdriver}-upgrade2/$control->{file}", $control, $db_charset);
     }
   }