Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Error with database name prefix in queries...  (Read 3927 times)

0 Members and 1 Guest are viewing this topic.

bmd_online

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
    • My gallery
Error with database name prefix in queries...
« on: July 31, 2005, 12:24:15 pm »

When connecting to my gallery, I have this error :
Code: [Select]
While executing query "delete from `bmd.online`.cpg_sessions where time<1122742088 and remember=0;" on Resource id #5

mySQL error: Incorrect table name 'cpg_sessions'

(I have replaced my database name (from my provider) with "bmd.online". My real database name was "firstname.lastname").

In the file bridge/coppermine.inc.php, I have changed (lines 68-70)
Code: [Select]
                $this->usertable = '`' . $this->db['name'] . '`.' . $this->db['prefix'] . $this->table['users'];
                $this->groupstable =  '`' . $this->db['name'] . '`.' . $this->db['prefix'] . $this->table['groups'];
                $this->sessionstable =  '`' . $this->db['name'] . '`.' . $this->db['prefix'] . $this->table['sessions'];

like this (removed database name).
Code: [Select]
                $this->usertable = $this->db['prefix'] . $this->table['users'];
                $this->groupstable =  $this->db['prefix'] . $this->table['groups'];
                $this->sessionstable =  $this->db['prefix'] . $this->table['sessions'];

Now, it works correctly.
Maybe it's due to "dot" in my database name  ???


I'm using latest devel from CVS.
« Last Edit: July 31, 2005, 12:27:22 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Error with database name prefix in queries...
« Reply #1 on: July 31, 2005, 12:27:02 pm »

yes: database names mustn't contain dots! Not a coppermine issue, marking as "invalid"
Logged

bmd_online

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
    • My gallery
Re: Error with database name prefix in queries...
« Reply #2 on: July 31, 2005, 12:31:58 pm »

It was due to my provider, it's not my fault !
Version 1.3 working correctly. With this change, 1.4.x works too.

In this topic, I read the same problem in another file :
If you replace that code with :

Code: [Select]
        // Derived full table names
        if (strpos($db_prefix, '.') === false) {
            $this->usertable = '`' . $this->db['name'] . '`.' . $this->db['prefix'] . $this->table['users'];
            $this->groupstable =  '`' . $this->db['name'] . '`.' . $this->db['prefix'] . $this->table['groups'];
        } else {
            $this->usertable = $this->db['prefix'] . $this->table['users'];
            $this->groupstable = $this->db['prefix'] . $this->table['groups'];
        }

It will work for both 1.0.3 and 1.1 beta 1.

Should I commit this to devel?
Logged

Nibbler

  • Guest
Re: Error with database name prefix in queries...
« Reply #3 on: July 31, 2005, 12:35:42 pm »

That's not the same problem.
Logged

bmd_online

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
    • My gallery
Re: Error with database name prefix in queries...
« Reply #4 on: July 31, 2005, 12:37:32 pm »

Sorry, never mind.
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.