|
Lines 110-126
sub _new_schema {
Link Here
|
| 110 |
|
110 |
|
| 111 |
my $dbh = $schema->storage->dbh; |
111 |
my $dbh = $schema->storage->dbh; |
| 112 |
eval { |
112 |
eval { |
|
|
113 |
my $HandleError = $dbh->{HandleError}; |
| 113 |
if ( $ENV{KOHA_DB_DO_NOT_RAISE_OR_PRINT_ERROR} ) { |
114 |
if ( $ENV{KOHA_DB_DO_NOT_RAISE_OR_PRINT_ERROR} ) { |
| 114 |
$dbh->{RaiseError} = 0; |
115 |
$dbh->{HandleError} = sub { return 1 }; |
| 115 |
$dbh->{PrintError} = 0; |
|
|
| 116 |
} |
116 |
} |
| 117 |
$dbh->do(q| |
117 |
$dbh->do(q| |
| 118 |
SELECT * FROM systempreferences WHERE 1 = 0 | |
118 |
SELECT * FROM systempreferences WHERE 1 = 0 | |
| 119 |
); |
119 |
); |
| 120 |
$dbh->{RaiseError} = 1; |
120 |
$dbh->{HandleError} = $HandleError; |
| 121 |
$dbh->{PrintError} = 1; |
|
|
| 122 |
}; |
121 |
}; |
| 123 |
$dbh->{RaiseError} = 0 if $@; |
122 |
|
|
|
123 |
if ( $@ ) { |
| 124 |
$dbh->{HandleError} = sub { warn $_[0]; return 1 }; |
| 125 |
} |
| 124 |
|
126 |
|
| 125 |
return $schema; |
127 |
return $schema; |
| 126 |
} |
128 |
} |