From: Arnie P. v. a. <we...@ma...> - 2009-11-05 21:40:30
|
Log Message: ----------- In MySQL like state only find tables of the form coursename_* with the underscore Modified Files: -------------- webwork2/lib/WeBWorK/Utils: CourseIntegrityCheck.pm Revision Data ------------- Index: CourseIntegrityCheck.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/CourseIntegrityCheck.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -Llib/WeBWorK/Utils/CourseIntegrityCheck.pm -Llib/WeBWorK/Utils/CourseIntegrityCheck.pm -u -r1.6 -r1.7 --- lib/WeBWorK/Utils/CourseIntegrityCheck.pm +++ lib/WeBWorK/Utils/CourseIntegrityCheck.pm @@ -127,9 +127,10 @@ # fetch fetch corresponding tables in the database and # search for corresponding schema entries. ########################################################## - - my $dbh = $self->dbh; - my $stmt = "show tables like '${courseName}%'"; # mysql request + + my $dbh = $self->dbh; + my $tablePrefix = "${courseName}\\_"; # _ represents any single character in the MySQL like statement so we escape it + my $stmt = "show tables like '${tablePrefix}%'"; # mysql request my $result = $dbh->selectall_arrayref($stmt) ; my @tableNames = map {@$_} @$result; # drill down in the result to the table name level |