Project

General

Profile

Actions

Bug #14790

closed

Install tool want to recreate the tables, and drop the old ones

Added by old_henk over 19 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Install Tool
Target version:
-
Start date:
2005-06-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

class.t3lib_install.php (28.6 KB) class.t3lib_install.php Administrator Admin, 2005-06-06 22:30
result_henk.html (41.9 KB) result_henk.html Administrator Admin, 2005-06-06 22:38
bug_1155.diff (1.11 KB) bug_1155.diff Administrator Admin, 2005-08-21 03:02
notyetcomplete.diff (1.42 KB) notyetcomplete.diff Administrator Admin, 2005-10-18 17:40
Actions #1

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.

Actions #2

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

Actions #3

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.

Actions #4

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

Actions #5

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

Actions #6

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.

Actions #7

Updated by Michael Stucki about 19 years ago

Waiting for any feedback...

Actions #8

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

Actions #9

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.

Actions #10

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

Actions #11

Updated by Michael Stucki almost 19 years ago

Fixed in CVS / 4.0beta1

Actions

Also available in: Atom PDF