Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
be7c6139
Commit
be7c6139
authored
Jul 19, 2013
by
Bart Visscher
Browse files
Fix errors from unit tests
parent
b66c9098
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/db/adapter.php
View file @
be7c6139
...
...
@@ -38,8 +38,7 @@ class Adapter {
$inserts
=
array_merge
(
$inserts
,
$inserts
);
try
{
$statement
=
$this
->
conn
->
prepare
(
$query
);
$result
=
$statement
->
execute
(
$inserts
);
$result
=
$this
->
conn
->
executeUpdate
(
$query
,
$inserts
);
}
catch
(
\
Doctrine\DBAL\DBALException
$e
)
{
$entry
=
'DB Error: "'
.
$e
->
getMessage
()
.
'"<br />'
;
$entry
.
=
'Offending command was: '
.
$query
.
'<br />'
;
...
...
lib/db/adaptersqlite.php
View file @
be7c6139
...
...
@@ -27,7 +27,7 @@ class AdapterSqlite extends Adapter {
$query
=
substr
(
$query
,
0
,
strlen
(
$query
)
-
5
);
try
{
$stmt
=
$this
->
conn
->
prepare
(
$query
);
$result
=
$stmt
->
execute
(
array
(
$input
));
$result
=
$stmt
->
execute
(
array
_values
(
$input
));
}
catch
(
\
Doctrine\DBAL\DBALException
$e
)
{
$entry
=
'DB Error: "'
.
$e
->
getMessage
()
.
'"<br />'
;
$entry
.
=
'Offending command was: '
.
$query
.
'<br />'
;
...
...
@@ -36,7 +36,7 @@ class AdapterSqlite extends Adapter {
\
OC_Template
::
printErrorPage
(
$entry
);
}
if
(
$stmt
->
fetchColumn
()
===
0
)
{
if
(
$stmt
->
fetchColumn
()
===
'0'
)
{
$query
=
'INSERT INTO `'
.
$table
.
'` (`'
.
implode
(
'`,`'
,
array_keys
(
$input
))
.
'`) VALUES('
.
str_repeat
(
'?,'
,
count
(
$input
)
-
1
)
.
'? '
.
')'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment