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 ;
Logged In: YES
user_id=54589
Originator: YES
i've tested current svn revision (9895) too.
Logged In: YES
user_id=54589
Originator: YES
this bug exists in version 2.9.2 too
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
screenshot of varbinary field
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
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
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?
Logged In: YES
user_id=54589
Originator: YES
html source looks ok. no errors.
password part:
<input type="hidden" name="fields_prev[multi_edit][`transactions`.`id` = 634773][username]" value="WHATEVER" />
<input type="text" name="fields[multi_edit][`transactions`.`id` = 634773][username]" value="WHATEVER" size="4" maxlength="4" class="textfield" onchange="return unNullify('username', '`transactions`.`id` = 634773')" tabindex="22" id="field_8_3" />
size and maxsize is wrong for some reason...
error log:
PHP Notice: Undefined index: cfg in /usr/local/htdocs/phpMyAdmin-SVN/libraries/Theme.class.php on line 105, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP Stack trace:, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 1. {main}() /usr/local/htdocs/phpMyAdmin-SVN/main.php:0, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 2. require_once() /usr/local/htdocs/phpMyAdmin-SVN/main.php:15, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 3. require_once() /usr/local/htdocs/phpMyAdmin-SVN/libraries/common.lib.php:2601, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 4. session_start() /usr/local/htdocs/phpMyAdmin-SVN/libraries/session.inc.php:99, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 5. PMA_Theme->__wakeup() /usr/local/htdocs/phpMyAdmin-SVN/libraries/Theme.class.php:0, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 6. PMA_Theme->checkImgPath() /usr/local/htdocs/phpMyAdmin-SVN/libraries/Theme.class.php:44, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP Notice: Undefined index: strThemeNoValidImgPath in /usr/local/htdocs/phpMyAdmin-SVN/libraries/Theme.class.php on line 110, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP Stack trace:, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 1. {main}() /usr/local/htdocs/phpMyAdmin-SVN/main.php:0, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 2. require_once() /usr/local/htdocs/phpMyAdmin-SVN/main.php:15, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 3. require_once() /usr/local/htdocs/phpMyAdmin-SVN/libraries/common.lib.php:2601, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 4. session_start() /usr/local/htdocs/phpMyAdmin-SVN/libraries/session.inc.php:99, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 5. PMA_Theme->__wakeup() /usr/local/htdocs/phpMyAdmin-SVN/libraries/Theme.class.php:0, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
PHP 6. PMA_Theme->checkImgPath() /usr/local/htdocs/phpMyAdmin-SVN/libraries/Theme.class.php:44, referer: https://db.local/phpMyAdmin-SVN/index.php?server=3
Logged In: YES
user_id=1383652
Originator: NO
i can't confirm (neither local nor on demo)
try and restart your webserver.
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.
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 ?
Logged In: YES
user_id=54589
Originator: YES
btw using @ is NOT a good solution
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
)
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?
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?
Logged In: YES
user_id=54589
Originator: YES
mysql client api version 5.0.19 (in php compiled)
mysql server version 5.0.33
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?
Logged In: YES
user_id=326580
Originator: NO
message added