Advertisement:

Author Topic: SQL Crash in calendar.php  (Read 16917 times)

Offline Martyn

  • Newbie
  • *
  • Posts: 5
SQL Crash in calendar.php
« on: May 30, 2004, 09:27:14 AM »
everytime i save a profile, the sql service crashes
its version 4.1.1 nt (windows 200)

the error the page then gives is:
Quote
Database Error: Lost connection to MySQL server during query
File: Calendar.php
Line: 226

line 226 is part of the following query:
Quote
   // Collect all of the birthdays for this month.  I know, it's a painful query.
   // !!!SLOW At least it works, but could this really be any faster and still actually work?
   $result = db_query("
      SELECT DAYOFMONTH(birthdate) AS dom, ID_MEMBER, realName, YEAR(birthdate) AS birthYear
      FROM {$db_prefix}members
      WHERE birthdate BETWEEN '$allyear_low' AND '$allyear_high'
         OR CONCAT('{$year_low}-', LPAD(MONTH(birthdate), 2, '0'), '-', LPAD(DAYOFMONTH(birthdate), 2, '0')) BETWEEN '$low_date' AND '$high_date'" . ($year_low == $year_high ? '' : "
         OR CONCAT('{$year_high}-', LPAD(MONTH(birthdate), 2, '0'), '-', LPAD(DAYOFMONTH(birthdate), 2, '0')) BETWEEN '$low_date' AND '$high_date'"), __FILE__, __LINE__);

by the looks of the comment its not a favorite query, but either way, it has a nice habit of killing server lol

not a moan at all, since i know its in beta, just a pointout since that query may need to tweaked

[edit]i dont have masses of members either, its just me and a test account, in an empty board[/edit]

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: SQL Crash in calendar.php
« Reply #1 on: May 30, 2004, 04:39:41 PM »
It's not that slow, it's only slow if you have a lot of members.  It should never crash a proper installation of MySQL.

Remember that 4.1.1 is alpha; it may be prone to errors and crashing.  I recommend you use an earlier and more stable version.

-[Unknown]

Offline Martyn

  • Newbie
  • *
  • Posts: 5
Re: SQL Crash in calendar.php
« Reply #2 on: May 31, 2004, 03:05:37 AM »
bah, windows 200, what was i thinking *remembers to reread posts before posting*

yea, i wont need to change sql servers, i was just running it on my test server (its going to be moved off server once i have tweaked it more (leaving the copyright in tact of course ;))) and that version of sql hasnt failed me in any other sence, so i see no need to change it, just thought id give you a heads up in  case that query will cause problems for others