Drupal 5 should support mysql 3.23.17+, so attached patch makes date api compatible with minimum requirements.
Tested on mysql 4.0.18.

Blessings!

CommentFileSizeAuthor
date_api_sql.inc_.mysql40.patch1.21 KBDevElCuy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KarenS’s picture

Wow, are people really still using 3.23? Removing STR_TO_DATE has implications for the database timezone conversion, so that probably won't work either. I don't want to break all this good stuff for the 95% of people who are using MYSQL 4.1+, so I don't want to just substitute in old code for everyone. Let's do some version testing and only do this where it's needed.

Looks like the magic number for those functions is 4.1.1, and CONVERT_TZ needs 4.1.3, so let's test for 4.1.3.

Do you want to re-roll your patch to leave the code alone for newer versions and make your change only for older versions? Otherwise I'll get back to this when I can.

KarenS’s picture

Status: Active » Fixed

OK, looks like even Drupal 6 only requires MYSQL 4.1 and we have some things that only work in 4.1.1 or 4.1.3, so I added a version check in several places. I also simplified your code quite a bit. I don't have an older MYSQL setup where I can test this, but the simpler code I committed should work correctly.

DevElCuy’s picture

@KarenS, yes, there are still lots of stonehead net admins around there... but Drupal rocks more than they right?, I'm going to test your version an came back.

Blessings!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.