|
Rozšírené detaily chyby |
[ Preskočiť na poznámky k chybám ]
[ História chýb ]
[ Vytlačiť ]
|
|
ID |
Kategória |
Dôležitosť |
Reprodukovateľnosť |
Dátum vloženia |
Posledná zmena |
|
0000405 |
setup script |
vlastnosť |
vždy |
2006-09-20 14:09 |
2006-09-22 15:35 |
|
|
|
Autor |
zucarino |
Zobraziť status |
verejný |
|
|
Priradené |
|
|
Priorita |
normálna |
Riešenie |
otvorený |
Platforma |
|
|
Stav |
schválený |
Duplicitné ID |
|
OS |
|
|
Projection |
žiadny |
|
Verzia |
|
|
ETA |
žiadny |
|
Verzia produktu |
5.6 (stable) |
|
|
Build produktu |
Core class: 1.188 , Script: 1.48 |
|
|
Hlasy |
1 |
|
|
|
Zhrnutie |
Incorrect key_type |
|
Popis |
After the php file creation via browser, the key_type option don't get the correct type when the unique key is "bigint". Then you can't Edit, Copy, Remove, etc the field. |
|
Kroky k vyvolaniu |
- My table:
CREATE TABLE `visitantes` (
`ID_Visit` bigint(10) NOT NULL default '0',
`Nome_Visit` varchar(40) NOT NULL default '',
`ID_Empresa` varchar(14) default NULL,
`Tel1` varchar(12) default '021-',
`Tel2` varchar(12) default NULL,
PRIMARY KEY (`ID_Visit`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
- Data:
INSERT INTO `visitantes` (`ID_Visit`, `Nome_Visit`, `ID_Empresa`, `Tel1`, `Tel2`) VALUES (8989898811, 'Sergio Pampolini', '33064262000500', '', ''),
(2392839832, 'Ricardo Aued', '33064262000330', '', ''),
(3232352637, 'Paulo Fernando', '33064262000411', '', ''),
(4390749823, 'Luiz Maganhi', '64736478248767', '', ''),
(7362784678, 'Marcos', '33064262000330', '021-88992222', ''); |
|
Dalšie informácie |
Open created php file and change the line like this:
[code]
// Type of key field (int/real/string/date etc.)
// $opts['key_type'] = 'int';
$opts['key_type'] = 'bigint';
[/code] |
|
Pripojené súbory |
|
|
|
|
Poznámky k chybe |
michal
2006-09-20 15:24
|
afaik, this could have some side effects (if someone has primary as integer).
correctly, setup script should try to determine key_type.
can you post a patch ? |
|
|
zucarino
2006-09-20 19:10
|
Hi Michal,
The code below don't work:
(phpMyEditSetup.php line 335)
if ($id == '') {
echo_buffer("\$opts['key_type'] = '';");
} else {
$fds = @mysql_list_fields($db,$tb,$dbl);
for ($j = 0; ($fd = @mysql_field_name($fds, $j)) != ''; $j++) {
if ($fd == $id) {
// Added to check the type:
$field_type = @mysql_field_type($fds, $j);
if ($field_type == 'bigint') {
echo_buffer("\$opts['key_type'] = 'bigint';");
} else {
echo_buffer("\$opts['key_type'] = '".@mysql_field_type($fds, $j)."';");
// echo_buffer($field_type);
break;
}
}
}
}
Because mysql_field_type don't give the exact type, but:
(MySQL 4.3.4)
STRING, VAR_STRING: string
TINY, SHORT, LONG, LONGLONG, INT24: int
FLOAT, DOUBLE, DECIMAL: real
TIMESTAMP: timestamp
YEAR: year
DATE: date
TIME: time
DATETIME: datetime
TINY_BLOB, MEDIUM_BLOB, LONG_BLOB, BLOB: blob
NULL: null
So... I'm looking for the right way to get the correct type. Any help? |
|
|
michal
2006-09-22 08:56
|
an ugly hack to use 'show columns' or 'describe' sql commands, and then sed/awk/regexp the types. maybe it's the right place to make textarea/dropdown work also. |
|
|
zucarino
2006-09-22 12:43
|
Hi Michal
Yes, 'DESCRIBE' show the correct types and is the way to get this data. But some hack using sed/awk/regexp work only if the server is Linux (and others *UX). Set manually the 'key_type' as 'bigint' or 'string' work for me now because no calculation is necessary (over this exemple). Perhaps a short description on the PME manual (chapter 3.2) about this 'limitation' is valid for who need bigint, tinyint and other not auto-recognized types. |
|
|
|
História chýb |
|
Dátum poslednej úpravy |
Používateľské meno |
Pole |
Zmeniť |
|
2006-09-20 14:09 |
zucarino |
Nová chyba |
|
|
2006-09-20 15:24 |
michal |
Poznámka k chybe pridaná: 0001828 |
|
|
2006-09-20 19:10 |
zucarino |
Poznámka k chybe pridaná: 0001829 |
|
|
2006-09-22 08:56 |
michal |
Poznámka k chybe pridaná: 0001830 |
|
|
2006-09-22 12:43 |
zucarino |
Poznámka k chybe pridaná: 0001831 |
|
|
2006-09-22 15:35 |
michal |
category |
core / general => setup script |
|
2006-09-22 15:35 |
michal |
status |
nový => schválený |
|
|