The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cPanel adds backslash in mysql db table?

Discussion in 'General Discussion' started by dindesign, Oct 26, 2004.

  1. dindesign

    dindesign Registered

    Joined:
    Oct 25, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Anyone knows why cPanel is adding a backslash before the underscore in the mysql "db" table? If I have a subhost called "test", and from cPanel I create a db called "mtest", a user called "muser" for a table called "mtable" in cPanel and check out the mysql db table with root afterwards, the fields Db and user in the db table shows in one row:

    Code:
    Db: "test\_mtest"
    user: "test_muser"
    What is the point of that backslash? The thought crossed my mind that it was a bug, but I checked out /usr/local/cpanel/Cpanel/Mysql.pm and found this on line 276:

    Code:
    if ($db !~ /\\_/) {  $db =~ s/_/\\_/g; }
    A search/replace regexp for _ to \_... So this is deliberate, but I wonder why? It makes the auto-creation scripts I'm making a whole lot more awkward. (bye bye GRANT for example...) :confused:


    /Andreas
     
Loading...

Share This Page