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

Marc Balmer marc at msys.ch
Sat Apr 7 21:19:24 CEST 2012





Am 07.04.2012 um 07:53 schrieb Chris Cormack <chris at bigballofwax.co.nz>:

> 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


bla bla

using return as a column name is wrong in the first place.




More information about the Koha-patches mailing list