Menu

#2205 dbi/mysqli: MYSQLI_* constants

Latest_Git
fixed
5
2013-06-11
2006-08-01
Lierduh
No

Script: mysqli.dbi.lib.php,v 2.50
Section in script: function PMA_DBI_get_fields_meta
($result)

Bugs:

1) MYSQLI_TYPE_CHAR although defined by php. It has
the value of "1". Unfortunately MYSQLI_TYPE_TINY's
value is also "1". The result is the tiny_int type
will be returned as "string" type by this function!

Suggest: remove this line
$typeAr[MYSQLI_TYPE_CHAR] = 'string';

Type CHAR and VARCHAR are covered by other constants!

2) In this line:
$fields[$k]->blob = (int) (bool)
($fields[$k]->_flags & MYSQLI_TYPE_BLOB);

MYSQLI_TYPE_BLOB should really be MYSQLI_BLOB_FLAG!

3)
The two constants below are only available for MySQL
5.0.3 and up. Suggest change code to:

if (defined('MYSQLI_TYPE_NEWDECIMAL'))
{
//MySQL 5.0.3 and up
$typeAr[MYSQLI_TYPE_NEWDECIMAL]
= 'real';
}

if (defined('MYSQLI_TYPE_BIT'))
{
//MySQL 5.0.3 and up
$typeAr[MYSQLI_TYPE_BIT] = 'bool';
}

Discussion

  • Sebastian Mendel

    Logged In: YES
    user_id=326580

    3)
    all below MySQL 5.0.3 is Alpha status - i don't think that
    phpMyAdmin should/will support every developer and alpha
    version! - it is not written but i think officially
    phpMyAdmin supports only production releases of MySQL! Only
    sometimes we make an exception if the latest release of a
    branch is not in production state - but once reached we will
    not pay attention to outdated developer/alpha or beta releases.

     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580

    1) and 2) what is your MySQL client lib version? can you
    confirm this also with current MySQL-client-lib and -server
    versions?

     
  • Lierduh

    Lierduh - 2006-08-01

    Logged In: YES
    user_id=1565724

    1) I am using
    MySQL-client-5.0.18-4mdk
    MySQL-5.0.18-4mdk
    php-mysqli-5.0.4-1mdk

    Unfortunately this is my production server. There is no
    easy way for me to test out a newer version.

    However it should be easy for someone running the latest to
    check using

    print_r(get_defined_constants());

    Official php site does not list 'MYSQLI_TYPE_CHAR' as a
    constant. See:
    http://au2.php.net/mysqli

    2) Indeed looks like a typo to me.

    3) My current set up does not have them defined. MySQLi
    support was introduced in MySQL 4.1 and php 4.1.3

    See:
    http://au2.php.net/mysqli

    If it is version related, then fair enough.

     
  • Lierduh

    Lierduh - 2006-08-01

    Logged In: YES
    user_id=1565724

    1) I am using
    MySQL-client-5.0.18-4mdk
    MySQL-5.0.18-4mdk
    php-mysqli-5.0.4-1mdk

    Unfortunately this is my production server. There is no
    easy way for me to test out a newer version.

    However it should be easy for someone running the latest to
    check using

    print_r(get_defined_constants());

    Official php site does not list 'MYSQLI_TYPE_CHAR' as a
    constant. See:
    http://au2.php.net/mysqli

    2) Indeed looks like a typo to me.

    3) My current set up does not have them defined. MySQLi
    support was introduced in MySQL 4.1 and php 4.1.3

    See:
    http://au2.php.net/mysqli

    If it is version related, then fair enough.

     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580

    2) why? MYSQLI_TYPE_BLOB exists

    3)
    i mean your mysql client lib linked with php (see phpinfo())
    or the start page of phpMyAdmin: the first point under
    phpMyAdmin heading

    and the MYSQLI_* constants defined depends on this version

     
  • Lierduh

    Lierduh - 2006-08-01

    Logged In: YES
    user_id=1565724

    Whoops, of cause MySQLi support was introduced in php5, not
    php 4.3.1 as I pretended to know in the last post.:)

     
  • Lierduh

    Lierduh - 2006-08-01

    Logged In: YES
    user_id=1565724

    2) I thought this line is not about the column type, but to
    test the blob flag in bitwise.

    3)
    MySQL client version: 4.1.12

     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580

    3) you should update your packages - it is not recommended
    using different versions in mysql client lib in php and
    mysql server

     
  • Sebastian Mendel

    • assigned_to: nobody --> cybot_tm
     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580

    3) phpMyAdmin defines this constants by itself if they are
    missing (php bug), why should we also check the MySQL
    version if we can ensure that this constants are always defined

     
  • Sebastian Mendel

    • labels: --> Compatibility
     
  • Sebastian Mendel

    • summary: typo plus trivia issue --> dbi/mysqli: MYSQLI_* constants
     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580

    1) and 2) fixed in CVS

     
  • Marc Delisle

    Marc Delisle - 2006-11-19
    • status: open --> closed
     
  • Marc Delisle

    Marc Delisle - 2006-11-19

    Logged In: YES
    user_id=210714
    Originator: NO

    Looks to me that work on this is finished.

     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed --> fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.