[Koha-patches] [PATCH] Bug 7886 - C4/ShelfBrowser slow SQL performance

Chris Cormack chris at bigballofwax.co.nz
Sat Apr 7 07:53:14 CEST 2012


On 7 April 2012 08:55, Dobrica Pavlinusic <dpavlin at rot13.org> wrote:
> On Fri, Apr 06, 2012 at 10:04:26PM +0200, Marc Balmer wrote:

>> ah, it's these MySQL backquotes again... Can't we get rid of them in new
>> code?
>
> I wrote updatedatabase.pl in non-database specific way, but
> data/mysql/kohastructure.sql is MySQL specific anyway, so I decided to be
> consistent with rest of SQL file since there is also
> installer/data/Pg/kohastructure.sql and DDL syntax in
> data/mysql/kohastructure.sql wouldn't work on PostgreSQL even if it didn't
> have quotes.
>
> Is this wrong assumption?
>
No, it is the correct assumption, removing backticks from a mysql
specific file is at best a pointless exercise and at worst a dangerous
one. In fact, if we were to remove them all, this file would no longer
be able to be used to create a mysql db.


mysql -uroot -p test_comments < installer/data/mysql/kohastructure.sql
Enter password:
ERROR 1064 (42000) at line 1421: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near 'return varchar(4) default NULL,
  renewals tinyint(4) default NULL,
  timestamp' at line 9

As you pointed out we have a postgres schema file already, and a much
better use of time would be, rather than badgering people to break the
mysql specific file, bring the postgre schema file up to date.

Chris


More information about the Koha-patches mailing list