Bug #14790
closedInstall tool want to recreate the tables, and drop the old ones
0%
Description
Hi,
I am running in a little problem with the install tool on 3.8. and mysql 4.0.20.
The layout of the database.sql delivered with the packages are different then the file on the 3.7.0. distribution.
Everything is now 'quoted' :
CREATE TABLE `be_groups` (
`uid` int(11) unsigned NOT NULL auto_increment,
`pid` int(11) unsigned NOT NULL default '0',
[...]
`custom_options` blob NOT NULL,
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) TYPE=MyISAM;
When the install tool compares the database ($FDdb without quoses) to the file ($FDfile with quotes) it would like to install all tables and rename the old ones.
In the install tool, import the database.sql, and then compare it with the database.
the import is working correctly when the quotes are removed from the sql file.
(issue imported from #M1155)
Files
Updated by old_anojszewski over 19 years ago
Typo3 3.8.0, mySQL 4.1.11
Trying to import database.sql file
"No tables" error occured.
Stripping backquotes (`) helped.
Updated by old_henk over 19 years ago
Hi,
I uploaded a modified t3lib of the install tool. Can somebody, post or mail the output? So I can compare it to my own installation, to see where it is going wrong. On my side, It looks like the comparison part is going wrong. please only use 1 table in sql file of the import to make the results readable. This should give enough output. Maybe useless to say, to do this on an new /empty database. :)
Regards,
Henk
Updated by old_henk over 19 years ago
just added my result of the modified php file. maybe somebody else can see what is going wrong.
to anojszewski: what do you want to tell me/us. It is a bit to cryptic (short)for me.
Updated by old_anojszewski over 19 years ago
I am sorry for beeing so 'cryptic'...
I have confirmed, that the problem with importing database.sql file lies in these "backquotes" (I don't know the right name for the 0x0060 character). This is rather common thing with mySQL, which dumps sql data with these quotes, but on the other hand does not like them during import.
Removing these quotes solved the problem. - I don't think mySQL really needs them.
best regards
Adam
Updated by Christian Hernmarck over 19 years ago
Hi
I just came to this problem too. I think the problem is in class.t3lib_install.php - to be exact: the function getCreateTables.
Until Typo3 3.7.0 the typo3conf/database.sql didn't use quotes for table and field names:
CREATE TABLE be_groups (
uid int(11) unsigned NOT NULL auto_increment,
since 3.7.1 a new dump-program was used (see header of the file) an quotes were inserted (they are needed if you use special chars in the name like äöü etc):
CREATE TABLE `be_groups` (
`uid` int(11) unsigned NOT NULL auto_increment,
The funktion getCreateTables has a ereg-statement to recognize the SQL statements:
eregi('^create[[:space:]]*table[[:space:]]*([[:alnum:]_]*)',substr($linecontent,0,100),$reg)
and therefore:
[[:alnum:]_]* doen't match "`tablename`" because of the backticks (or whatever they are called)
Important:
In the same function there is a ereg-statement for the INSERTs too, so maybe there are more functions using this method (recognition of table fields???)
Hope to help solving this bug
Updated by Michael Stucki about 19 years ago
Thanks hernmarck for your research. If you are right then the attached patch should work.
Since I cannot reproduce the problem here I would like any of you to confirm that this solves the problem.
Updated by Christian Hernmarck about 19 years ago
Hi
Looks good. I just tested that with Typo3 3.8.0 and both versions of "database.sql" (from 3.8.0 and 3.7.0). The Install-Tool could analyze and import the sql file.
Any other feedback??
Thanks Michael
Updated by old_henk about 19 years ago
Hi folks,
thanks hernmarck for helping to solve this issue.
The patch did not what I want it to do. sorry....
By mee, the comparasing part goes wrong. not in the install part, but you bring me on an idea to solve this for me. I add a patch file, who solved most problems for me (not the indexes).
I think it is not a good solution (the way I did it), but can give you an idea what is going wrong.
Updated by Christian Hernmarck about 19 years ago
would have been nice to have had at least some patch in the 3.8.1... :-(
What sort of help is needed?
/Christian