Menu

#2343 (ok 2.11) different mysql library and server version

2.10.0-beta1
fixed
1
2013-06-11
2007-01-31
No

If i edit, or insert on a table with a varbinary field, the HTML input box is always 4 characters long.

To test it, create this table and try to insert a row:

CREATE TABLE `vbtest` (
`id` int(10) unsigned NOT NULL auto_increment,
`whatever` varbinary(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Discussion

  • Christian Meisinger

    Logged In: YES
    user_id=54589
    Originator: YES

    i've tested current svn revision (9895) too.

     
  • Christian Meisinger

    Logged In: YES
    user_id=54589
    Originator: YES

    this bug exists in version 2.9.2 too

     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580
    Originator: NO

    cannot reproduce

    created table
    insert new row
    - field is displayed as long as '123456789012345678901234567890123456'
    - can even enter more chars
    hit OK - all is fine, Data is inserted correctly

    Windows / Apache 2.2.4 / PHP 5.2.0 / MySQL 5.1.12 / mysqli
    Linux / Apache 2.2.4 / PHP 5.2.0 / MySQL 5.0.27 / mysqli

     
  • Christian Meisinger

    screenshot of varbinary field

     
  • Christian Meisinger

    Logged In: YES
    user_id=54589
    Originator: YES

    ok i've tested it with:
    php 5.0.5, apache 2.0.59, mysqli 5.0.33 on linux -> bug
    php 5.2.0, apache 2.0.59, mysqli 5.0.33 on windows -> looks good

    File Added: varbinary.jpg

     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580
    Originator: NO

    still cannot confirm

    Windows / Apache 2.0.59 / PHP 5.0.5 / MySQL 5.1.12 / mysqli 5.0.20

     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580
    Originator: NO

    did you check the HTML source output of this form? possible there is some error?

    do have enabled your PHP error log - is it empty?

     
  • Jürgen Wind

    Jürgen Wind - 2007-02-01

    Logged In: YES
    user_id=1383652
    Originator: NO

    i can't confirm (neither local nor on demo)
    try and restart your webserver.

     
  • Marc Delisle

    Marc Delisle - 2007-02-01

    Logged In: YES
    user_id=210714
    Originator: NO

    To test this, I use $cfg['ProtectBinary'] = 'blob';

    Cannot reproduce the bug in 2.10.1-beta1, on
    Linux / Apache 1.3.37 / PHP 5.2.1RC4 / MySQL 5.0.33/ mysqli 5.0.33

    Maybe you have a MySQL client library non-matching with your MySQL version.

     
  • Christian Meisinger

    Logged In: YES
    user_id=54589
    Originator: YES

    now this is REALLY strange!
    i took a look at the phpMyAdmin source

    PMA_DBI_field_len -> mysqli_fetch_field_direct

    in this function $info->length is returned which doesn't exist in $info on my server...

    [mysqli_fetch_field_direct]:
    +- [name] = pass s
    +- [orgname] = pass s
    +- [table] = transactions s
    +- [orgtable] = transactions s
    +- [def] = s
    +- [max_length] = 6 i (this would be ok. 6 is the correct size)
    +- [flags] = 129 i
    +- [type] = 253 i
    +- [decimals] = 0 i

    what makes this even more mysterious is: in v2.9.1 it doesn't exist either! but
    for some reason size and maxlength is not 4...

    and you are right. client version is 5.0.19 and mysql version is 5.0.33.
    i will update this.

    BUT
    maybe you can check for $info->length AND $info->max_length ?

     
  • Christian Meisinger

    Logged In: YES
    user_id=54589
    Originator: YES

    btw using @ is NOT a good solution

     
  • Marc Delisle

    Marc Delisle - 2007-02-06

    Logged In: YES
    user_id=210714
    Originator: NO

    Here is what is returned in $info for your table, on my server (client lib 5.0.33, mysqli):
    stdClass Object
    (
    [name] => id
    [orgname] => id
    [table] => vbtest
    [orgtable] => vbtest
    [def] =>
    [max_length] => 0
    [length] => 10
    [charsetnr] => 63
    [flags] => 49699
    [type] => 3
    [decimals] => 0
    )

    stdClass Object
    (
    [name] => whatever
    [orgname] => whatever
    [table] => vbtest
    [orgtable] => vbtest
    [def] =>
    [max_length] => 0
    [length] => 255
    [charsetnr] => 63
    [flags] => 4225
    [type] => 253
    [decimals] => 0
    )

     
  • Christian Meisinger

    Logged In: YES
    user_id=54589
    Originator: YES

    updated MySQL client library.
    works now. strange anyway...

    maybe someone else got the same problem and maybe you can check for $info->length AND $info->max_length whatever is higher, for safety?

     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580
    Originator: NO

    MySQL client library should at least be the same as MySQL server version - what was your MySQL client library version?

     
  • Christian Meisinger

    Logged In: YES
    user_id=54589
    Originator: YES

    mysql client api version 5.0.19 (in php compiled)
    mysql server version 5.0.33

     
  • Marc Delisle

    Marc Delisle - 2007-03-08

    Logged In: YES
    user_id=210714
    Originator: NO

    With unmatching client API and server version, so many things can go wrong so we cannot hunt all what can happen...

    but, how about displaying a warning about this on the main page?

     
  • Marc Delisle

    Marc Delisle - 2007-03-08
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2007-03-14
    • assigned_to: lem9 --> nobody
     
  • Sebastian Mendel

    • priority: 5 --> 1
    • assigned_to: nobody --> cybot_tm
    • summary: VARBINARY always 4 characters long --> (ok 2.11) different mysql library and server version
    • status: open --> open-fixed
     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580
    Originator: NO

    message added

     
  • Marc Delisle

    Marc Delisle - 2007-08-21
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed