core icon indicating copy to clipboard operation
core copied to clipboard

MySQL: autocommit is required

Open fgusinde opened this issue 12 years ago • 10 comments

Hi,

I have a MariaDB running with autocommit=0 (because of another application, so I can't change) and owncloud is not working because we're expecting autocommit is on. I think we should explicitely commit or rollback every transaction.

As a quick workaround I added

358 $this->executeQuery('SET SESSION AUTOCOMMIT=1;', '');

to

3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php

Regards, Florian

fgusinde avatar Aug 31 '14 04:08 fgusinde

sounds like a good idea. @DeepDiver1975 what do you think?

karlitschek avatar Aug 31 '14 10:08 karlitschek

sounds like a good idea. @DeepDiver1975 what do you think?

FULL ACK - we indeed rely on auto commit - actually we shall double check on all databases we support :fire_engine:

Additional initializations are to be added here: https://github.com/owncloud/core/blob/master/lib/private/db/connectionfactory.php#L87

SQL can be injected via the class Doctrine\DBAL\Event\Listeners\SQLSessionInit

DeepDiver1975 avatar Aug 31 '14 11:08 DeepDiver1975

@th3fallen another one for you?

DeepDiver1975 avatar Aug 31 '14 11:08 DeepDiver1975

@DeepDiver1975 I have no way to test all supported databases to verify this fix, im not sure this is a good one for me.

th3fallen avatar Sep 05 '14 13:09 th3fallen

Who else can look into that?

karlitschek avatar Dec 06 '14 02:12 karlitschek

@DeepDiver1975 I have no way to test all supported databases to verify this fix, im not sure this is a good one for me.

Missed your comment - sorry - there are two solutions to the issue:

  • install all databases locally
  • at least test this on MySQL locally and let Jenkins do the rest for you

Anyway - someone else can take over this task

DeepDiver1975 avatar Jan 07 '15 12:01 DeepDiver1975

I believe this might already be fixed through https://github.com/owncloud/core/pull/12695 from @icewind1991

PVince81 avatar Jan 07 '15 13:01 PVince81

oops wrong ticket, sorry

PVince81 avatar Jan 07 '15 13:01 PVince81

Btw I couldn't find any code that uses beginTransaction without commit() or rollback()

nickvergessen avatar Jan 07 '15 13:01 nickvergessen

Btw I couldn't find any code that uses beginTransaction without commit() or rollback()

quite expected - what are you trying to tell us? :speak_no_evil:

DeepDiver1975 avatar Jan 07 '15 15:01 DeepDiver1975