Closed Bug 989753 Opened 11 years ago Closed 11 years ago

mysql syntax error

Categories

(Air Mozilla :: Other, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: vremendm, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1521.3 Safari/537.36 Steps to reproduce: run server with mysql MariaDB 10.0.9 and open the page 127.0.0.1:8000 ./manage.pu runserver Actual results: When opening the main page 127.0.0.1:8000 DatabaseError at / (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '::int + 1) * total_hits/ extract(days from (now() - archive_time)) ^ 1.8) AS `sc' at line 1") Expected results: Main page must have opened successfully
This can solve the problem --- airmozilla_diff/airmozilla/main/context_processors.py 2014-03-30 20:43:58.886415831 +0600 +++ airmozilla/airmozilla/main/context_processors.py 2014-03-30 20:46:57.721810001 +0600 @@ -40,8 +40,8 @@ select={ # being 'featured' pretends the event has twice as # many hits as actually does - 'score': '(featured::int + 1) * total_hits' - '/ extract(days from (now() - archive_time)) ^ 1.8', + 'score': '(featured + 1) * total_hits' + '/ extract(day from (now() - archive_time)) ^ 1.8', } ) .select_related('event') --- airmozilla_diff/airmozilla/manage/views.py 2014-03-30 20:43:58.907415525 +0600 +++ airmozilla/airmozilla/manage/views.py 2014-03-30 20:55:44.031148136 +0600 @@ -2093,10 +2093,10 @@ .filter(event__archive_time__lt=yesterday) .order_by('-%s' % order_by) .extra(select={ - 'hits_per_day': 'total_hits / extract(days from (now() ' + 'hits_per_day': 'total_hits / extract(day from (now() ' '- main_event.archive_time))', - 'score': '(featured::int + 1) * total_hits' - '/ extract(days from (now() - archive_time)) ^ 1.8', + 'score': '(featured + 1) * total_hits' + '/ extract(day from (now() - archive_time)) ^ 1.8', }) .select_related('event') )
The site requires that you use PostgreSQL See https://github.com/mozilla/airmozilla/blob/master/README.md#about-the-database It's a deliberate choice. Many aspects of the code is just using the Django ORM so it should work with any database. But ultimately, it needs to be PostgreSQL.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.