FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » upgrade.php and q_bitand() (Does not take into account appropriate DB driver)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
upgrade.php and q_bitand() [message #167363] Sun, 10 June 2012 15:20 Go to next message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
There is a hack in upgrade.php (around line 605) which works only for a few DBs.
  // Another hack: q_bitand() was introduced in 3.0.2 and is used in this script.
  // but the possibly older driver we've loaded may not have it yet.
  if (!function_exists('q_bitand')) {
    function q_bitand($fieldLeft, $fieldRight) {
      return $fieldLeft .' & '. $fieldRight;
    }
  }

We should really find the appropriate db.inc and load it before ever using the function.
Re: upgrade.php and q_bitand() [message #167366 is a reply to message #167363] Sun, 10 June 2012 19:25 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
We need to load db.inc before we unpack the new files. Thus, the db.inc we load may not have q_bitand() in it yet (versions 3.0.0 and 3.0.1).

Also, once loaded, you cannot load it again after unpacking the new files as all functions are already defined.
Re: upgrade.php and q_bitand() [message #167371 is a reply to message #167366] Mon, 11 June 2012 03:46 Go to previous messageGo to next message
NeXuS is currently offline  NeXuS   Korea, Republic of
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
Well, then we need to have different implementations in the installer as well, otherwise it will not work with some of the DBs.
Re: upgrade.php and q_bitand() [message #167372 is a reply to message #167371] Mon, 11 June 2012 05:46 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
This is why I want to make 3.0.4 the terminal release of the 3.0 series.
Users on older releases will have to upgrade to 3.0.4 before they will be allowed to upgrade to subsequent releases.
Thus, in future db.inc will always have the q_bit*() functions.
Re: upgrade.php and q_bitand() [message #167449 is a reply to message #167372] Fri, 22 June 2012 07:53 Go to previous messageGo to next message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
Anyway I have a patch ready for this problem. I'll submit it ASAP.
Re: upgrade.php and q_bitand() [message #167450 is a reply to message #167449] Fri, 22 June 2012 08:03 Go to previous messageGo to next message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
Commited @5516, please double check
Re: upgrade.php and q_bitand() [message #167455 is a reply to message #167450] Sat, 23 June 2012 16:13 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Nothing wrong with the patch, except that it's unnecessary. Support for Oracle (oci8 & pdo_oci) was added in 3.0.2 and support for DB2 and Firebird (Interbase) was added in 3.0.3. So, if we load their DB drivers, we will always have a q_bit* function. No need to define it in the installer. On the other hand, it's quite harmless.
Re: upgrade.php and q_bitand() [message #167458 is a reply to message #167455] Mon, 25 June 2012 07:09 Go to previous message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
Oh, I didn't look through the changelog, so I thought it would be necessary to have the function around for all the DBs. My bad! XD

Still waiting for an answer from the MySQL guys regarding the problem with the group_cache view. Sad
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Sort Private Messages by Name
Next Topic: fud30_group_cache table, shouldn't it be a view?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 10:01:09 GMT 2024

Total time taken to generate the page: 0.02569 seconds