Project

General

Profile

Actions

Bug #63599

closed

Fresh TYPO3 7.0.0 install - Install tool - analyze database

Added by Riccardo De Contardi over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Must have
Category:
Install Tool
Target version:
Start date:
2014-12-05
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Is it normal that after a fresh install of TYPO3 7.0.0 (I repeat: fresh, it means a completely new installation, without any distribution or package, no pages created, no filemount created, no typoscript template created, just the admin be-user created, with any extension installed apart from scheduler, linkvalidator and recycler), if I open the install tool and run the Analyze Database, I already have a lot of fixes that must be done on the db?

ALTER TABLE sys_file_processedfile DROP KEY combined_1;

ALTER TABLE sys_file_processedfile ADD KEY combined_1 (original,task_type,configurationsha1);

ALTER TABLE sys_file_processedfile DROP KEY identifier;

ALTER TABLE sys_file_processedfile ADD KEY identifier (storage,identifier(199));

ALTER TABLE sys_history DROP KEY recordident_1;

ALTER TABLE sys_history ADD KEY recordident_1 (tablename,recuid);

ALTER TABLE sys_history DROP KEY recordident_2;

ALTER TABLE sys_history ADD KEY recordident_2 (tablename,tstamp);

ALTER TABLE sys_refindex DROP KEY lookup_rec;

ALTER TABLE sys_refindex ADD KEY lookup_rec (tablename,recuid);

ALTER TABLE sys_refindex DROP KEY lookup_uid;

ALTER TABLE sys_refindex ADD KEY lookup_uid (ref_table,ref_uid);

ALTER TABLE sys_refindex DROP KEY lookup_string;

ALTER TABLE sys_refindex ADD KEY lookup_string (ref_string);

ALTER TABLE sys_category_record_mm DROP KEY uid_foreign_tablenames;

ALTER TABLE sys_category_record_mm ADD KEY uid_foreign_tablenames (uid_foreign,tablenames);

ALTER TABLE sys_domain DROP KEY getSysDomain;

ALTER TABLE sys_domain ADD KEY getSysDomain (redirectTo,hidden);

ALTER TABLE cf_cache_hash DROP KEY cache_id;

ALTER TABLE cf_cache_hash ADD KEY cache_id (identifier,expires);

ALTER TABLE cf_cache_hash_tags DROP KEY cache_id;

ALTER TABLE cf_cache_hash_tags ADD KEY cache_id (identifier);

ALTER TABLE cf_cache_hash_tags DROP KEY cache_tag;

ALTER TABLE cf_cache_hash_tags ADD KEY cache_tag (tag);

ALTER TABLE cf_cache_pages DROP KEY cache_id;

ALTER TABLE cf_cache_pages ADD KEY cache_id (identifier,expires);

ALTER TABLE cf_cache_pages_tags DROP KEY cache_id;

ALTER TABLE cf_cache_pages_tags ADD KEY cache_id (identifier);

ALTER TABLE cf_cache_pages_tags DROP KEY cache_tag;

ALTER TABLE cf_cache_pages_tags ADD KEY cache_tag (tag);

ALTER TABLE cf_cache_pagesection DROP KEY cache_id;

ALTER TABLE cf_cache_pagesection ADD KEY cache_id (identifier,expires);

ALTER TABLE cf_cache_pagesection_tags DROP KEY cache_id;

ALTER TABLE cf_cache_pagesection_tags ADD KEY cache_id (identifier);

ALTER TABLE cf_cache_pagesection_tags DROP KEY cache_tag;

ALTER TABLE cf_cache_pagesection_tags ADD KEY cache_tag (tag);

ALTER TABLE cf_cache_rootline DROP KEY cache_id;

ALTER TABLE cf_cache_rootline ADD KEY cache_id (identifier,expires);

ALTER TABLE cf_cache_rootline_tags DROP KEY cache_id;

ALTER TABLE cf_cache_rootline_tags ADD KEY cache_id (identifier);

ALTER TABLE cf_cache_rootline_tags DROP KEY cache_tag;

ALTER TABLE cf_cache_rootline_tags ADD KEY cache_tag (tag);

ALTER TABLE cf_extbase_reflection DROP KEY cache_id;

ALTER TABLE cf_extbase_reflection ADD KEY cache_id (identifier,expires);

ALTER TABLE cf_extbase_reflection_tags DROP KEY cache_id;

ALTER TABLE cf_extbase_reflection_tags ADD KEY cache_id (identifier);

ALTER TABLE cf_extbase_reflection_tags DROP KEY cache_tag;

ALTER TABLE cf_extbase_reflection_tags ADD KEY cache_tag (tag);

ALTER TABLE cf_extbase_typo3dbbackend_tablecolumns DROP KEY cache_id;

ALTER TABLE cf_extbase_typo3dbbackend_tablecolumns ADD KEY cache_id (identifier,expires);

ALTER TABLE cf_extbase_typo3dbbackend_tablecolumns_tags DROP KEY cache_id;

ALTER TABLE cf_extbase_typo3dbbackend_tablecolumns_tags ADD KEY cache_id (identifier);

ALTER TABLE cf_extbase_typo3dbbackend_tablecolumns_tags DROP KEY cache_tag;

ALTER TABLE cf_extbase_typo3dbbackend_tablecolumns_tags ADD KEY cache_tag (tag);

ALTER TABLE cf_extbase_typo3dbbackend_queries DROP KEY cache_id;

ALTER TABLE cf_extbase_typo3dbbackend_queries ADD KEY cache_id (identifier,expires);

ALTER TABLE cf_extbase_typo3dbbackend_queries_tags DROP KEY cache_id;

ALTER TABLE cf_extbase_typo3dbbackend_queries_tags ADD KEY cache_id (identifier);

ALTER TABLE cf_extbase_typo3dbbackend_queries_tags DROP KEY cache_tag;

ALTER TABLE cf_extbase_typo3dbbackend_queries_tags ADD KEY cache_tag (tag);

ALTER TABLE cf_extbase_datamapfactory_datamap DROP KEY cache_id;

ALTER TABLE cf_extbase_datamapfactory_datamap ADD KEY cache_id (identifier,expires);

ALTER TABLE cf_extbase_datamapfactory_datamap_tags DROP KEY cache_id;

ALTER TABLE cf_extbase_datamapfactory_datamap_tags ADD KEY cache_id (identifier);

ALTER TABLE cf_extbase_datamapfactory_datamap_tags DROP KEY cache_tag;

ALTER TABLE cf_extbase_datamapfactory_datamap_tags ADD KEY cache_tag (tag);

ALTER TABLE cf_extbase_object DROP KEY cache_id;

ALTER TABLE cf_extbase_object ADD KEY cache_id (identifier,expires);

ALTER TABLE cf_extbase_object_tags DROP KEY cache_id;

ALTER TABLE cf_extbase_object_tags ADD KEY cache_id (identifier);

ALTER TABLE cf_extbase_object_tags DROP KEY cache_tag;

ALTER TABLE cf_extbase_object_tags ADD KEY cache_tag (tag);

Files

Cattura_MAC.tiff (105 KB) Cattura_MAC.tiff Riccardo De Contardi, 2015-01-12 15:14
Cattura_WINDOWS.PNG (33.4 KB) Cattura_WINDOWS.PNG Riccardo De Contardi, 2015-01-12 15:14
cattura_MAC_fromphpmyadmin.tiff (103 KB) cattura_MAC_fromphpmyadmin.tiff Riccardo De Contardi, 2015-01-12 16:22

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #38932: EM creates INDEX with space after the commas again and againClosed2012-07-13

Actions
Actions #1

Updated by Riccardo De Contardi over 9 years ago

BTW: if I check all the fields and "execute" the update, nothing happens, the list of database changes to be performed remains the same

Actions #2

Updated by Mathias Schreiber over 9 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)
Actions #3

Updated by Mathias Schreiber over 9 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Mathias Schreiber

Is it possible that you run mysql in strict mode, deny a certain table type or something alike?
If we take a look at the code you supplied it is always the same thing going on:

  • It finds an index with name X
  • it wants to drop the index
  • it wants to re-generate the index

This normally happens when the MySQL Server returns a string different from what TYPO3 expects.

We can go into a 1:1 debug session on Slack if you like, because right now no-one in the team can reproduce the error

Actions #4

Updated by Riccardo De Contardi over 9 years ago

Hi thank you for your reply. I will gladly be of help...how can I be of help? How can I check if I am on STRICT mode? (I'm using a MAMP enviroment just now).

If it is of help, after starting Mysql, this is the error log:

150111 15:09:16 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql
150111 15:09:17 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
150111 15:09:17 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql/ is case insensitive
150111 15:09:17 [Note] Plugin 'FEDERATED' is disabled.
150111 15:09:17 InnoDB: The InnoDB memory heap is disabled
150111 15:09:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150111 15:09:17 InnoDB: Compressed tables use zlib 1.2.3
150111 15:09:17 InnoDB: Initializing buffer pool, size = 128.0M
150111 15:09:17 InnoDB: Completed initialization of buffer pool
150111 15:09:17 InnoDB: highest supported file format is Barracuda.
150111 15:09:21  InnoDB: Waiting for the background threads to start
150111 15:09:22 InnoDB: 5.5.33 started; log sequence number 1467896902

Executing the query does not trigger anything in the log.

Actions #5

Updated by Mathias Schreiber over 9 years ago

Does the same error occur in 6.2.x installs too?
And maybe 4.5?

If you could check that, that'd be awesome.

Actions #6

Updated by Riccardo De Contardi over 9 years ago

I am sure it does not occur in 6.2.x; cannot check in 4.5 sorry

Actions #7

Updated by Mathias Schreiber over 9 years ago

Please try the following:

  • open typo3/sysext/core/ext_tables.sql
  • go to line 383 (or search for "combined_1")
  • add spaces after the commas in the brackets

Check again in the install tool.

Actions #8

Updated by Riccardo De Contardi over 9 years ago

Before:

KEY combined_1 (original,task_type,configurationsha1),

After:

KEY combined_1 (original, task_type, configurationsha1),

I run the install tool > compare db but no... nothing happens: performing the update nothing changes; the only difference is the line:

ALTER TABLE sys_file_processedfile ADD KEY combined_1 (original, task_type, configurationsha1);

with spaces. The enviroment in which the error occurs is a MAMP enviroment (PHP 5.5.3. Mysql 5.5.33)

I've done another test on a Windows enviroment WAMP (PHP 5.5.12, Mysql 5.6.17) and here the error does not occur. After performing the changes in ext_tables.sql

ALTER TABLE sys_file_processedfile DROP KEY combined_1;
ALTER TABLE sys_file_processedfile ADD KEY combined_1 (original, task_type, configurationsha1);
Actions #9

Updated by Mathias Schreiber over 9 years ago

Ok, I think the problem might be here somehow:

typo3/sysext/install/Classes/Service/SqlSchemaMigrationService.php

Function: getFieldDefinitions_database()

Can you debug $total['sys_file_processedfile']['keys'] here?

I still think that your MAMP returns something different than what TYPO3 expects ;-)

Actions #10

Updated by Riccardo De Contardi over 9 years ago

@Mathias Schreiber

I'd want to thank you very much for your time; can you guide me about how to do the debug? Alas, I'm not a programmer ;) something like "for dummies" ;)?

Actions #11

Updated by Mathias Schreiber over 9 years ago

no problem.

we'll just to the "rambo" way of doing things.
At the end of the function it says "return $total;".

add two lines on top of that:

var_dump($total['sys_file_processedfile']['keys'] );
die();

The die() will exit the script immediately, so make sure to comment out this two lines later :)

Actions #12

Updated by Riccardo De Contardi over 9 years ago

ok, I like the "Rambo" way ;)

Added the lines after "//RDC"

public function getFieldDefinitions_database() {

[.....]
        // Compile key information:
        if (count($tempKeys)) {
            foreach ($tempKeys as $table => $keyInf) {
                foreach ($keyInf as $kName => $index) {
                    ksort($index);
                    $total[$table]['keys'][$kName] = $tempKeysPrefix[$table][$kName] . ' (' . implode(',', $index) . ')';
                }
            }
        }

        //RDC
        var_dump($total['sys_file_processedfile']['keys'] );
        die();

        return $total;

This is the result:

array(3) { ["PRIMARY"]=> string(17) "PRIMARY KEY (uid)" ["combined_1"]=> string(58) "KEY combined_1 (original,task_type(191),configurationsha1)" ["identifier"]=> string(40) "KEY identifier (storage,identifier(191))" }
Actions #13

Updated by Mathias Schreiber over 9 years ago

ok, cool.
Do you see the difference?
Compare

YOURS: KEY combined_1 (original,task_type(191),configurationsha1)
TYPO3: KEY combined_1 (original,task_type,configurationsha1)

Please try this in MySQL (phpMyAdmin or alike):

SHOW KEYS FROM sys_file_processedfile;

Updated by Riccardo De Contardi over 9 years ago

Ok, I attach the screenshots from both enviroments:

cattura_WINDOWS = WAMP (no error)
cattura_MAC = MAMP (error)

Don't know where the "191" comes from :S :S

Actions #15

Updated by Mathias Schreiber over 9 years ago

The column called "Sub_part" on your system returns a value where it should not.
Same goes in the last key... see that your windows install says 199, while your MAMP says 191.

I think this is mamp related and there is no way TYPO3 can deal with it :(

Actions #16

Updated by Riccardo De Contardi over 9 years ago

so the correct value is "NULL"?
Apart from that, I don't like what happened because it is very difficult to trace such an error; I mean, even if I want to change it manually, it is not a good news if the enviroment makes the database not consistent (I hope I made myself clear)

The only thing I can test is the following: I don't remember if I created the empty DB via phpmyadmin and then choose it in the installation procedure or I had it created by TYPO3 itself during the installation.

If you think this could aid, I'll do this test removing the whole installation and creating everything again

Actions #17

Updated by Mathias Schreiber over 9 years ago

Personally, I'd ignore the error on your local machine.
As you see this is what TYPO3 instructs your DB to do:

ALTER TABLE sys_file_processedfile ADD KEY combined_1 (original,task_type,configurationsha1);

The result is somewhat different from that instruction and TYPO3 can only check "did the DB do what I told it to do?"

One last thing you can try is to manually delete the key in PHPMyAdmin and then run the SQL statement above.
Maybe it shows an error or a warning.

Actions #18

Updated by Riccardo De Contardi over 9 years ago

I have performed the following test:

1. drop the DB
2. create DB via phpmyadmin: db name: typo3.70.test.it, collation utf8_general_ci
3. Install TYPO3
4. SHOW KEYS FROM sys_file_processedfile; > result: cattura_MAC_fromphpmyadmin.tiff
5. the problem is not present

I also tried to let TYPO3 create the db, but the result is the same, and no problem is shown, even after installing system extensions.
BTW: when creating the DB from the installation procedure, I was not able to name the database with dots, I had to name it typo3_70_test_it

MORALE DELLA FAVOLA (yes, in italian): I don't know where it came from!!!!!!
so... closed as not reproducible?

Thank you for your patience

Actions #19

Updated by Mathias Schreiber over 9 years ago

  • Status changed from Needs Feedback to Closed

Riccardo De Contardi wrote:

I also tried to let TYPO3 create the db, but the result is the same, and no problem is shown, even after installing system extensions.
BTW: when creating the DB from the installation procedure, I was not able to name the database with dots, I had to name it typo3_70_test_it

Well, to be honest, that's not a good idea anyways.
Here's why:
The "." ist used as a delimiter for database.table.field.
So by using a . in the DB name will cause mysql to constantly check whether your SQL refers to a DB, a table or a field :)

MORALE DELLA FAVOLA (yes, in italian): I don't know where it came from!!!!!!

a volte basta perdere

I guess I will close this one down, but at least we keep it as a reference in case others have the same problem.

Actions #20

Updated by Joerg Kummer over 8 years ago

I run into same issue in production environment and solved it, by using "utf8_general_ci" instead of "utf8mb_general_ci" as collation, which was pre configured.

This makes the different for the "Sub_part" value beeing set to 199 what was expected by TYPO3 instead of 191, which was set, when creating tables with collation "utf8mb_general_ci".

Actions

Also available in: Atom PDF