DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: Debug Mysql DB

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Holzinger Franz
Changed:2013-12-19T14:13:13
Classification:debug_mysql_db
Keywords:forDevelopers, forIntermediates
Author:Stefan Geith
Email:typo3dev2009@geithware.de
Info 4:
Language:en

img-1 img-2 EXT: Debug Mysql DB - debug_mysql_db

EXT: Debug Mysql DB

Extension Key: debug_mysql_db

Language: en

Keywords: forDevelopers, forIntermediates

Copyright 2009-2013, Stefan Geith, <typo3dev2009@geithware.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.org

Table of Contents

EXT: Debug Mysql DB 1

`Introduction 3 <#__RefHeading__968_168664116>`_

What does it do? 3

Screenshots 3

`Users manual 4 <#__RefHeading__974_168664116>`_

`Administration 5 <#__RefHeading__976_168664116>`_

Reference 5

`Known problems 6 <#__RefHeading__980_168664116>`_

`To-Do list 7 <#__RefHeading__982_168664116>`_

`ChangeLog 8 <#__RefHeading__984_168664116>`_

Introduction

What does it do?

  • It transforms SQL error messages into debug messages or any function of your choice. This helps you to get rid of the output of SQL error messagein the Frontend or Backend.
  • It calculates the time for the performance of a SQL query.
  • You can filter to see only buggy SQL queries.
  • You can filter to see only SQL queries which take a long time.

Screenshots

img-3

Users manual

Just install the extension in the Extension Manager. Then all database queries made by the PHP code of TYPO3 or of all TYPO3 extensions which use the $TYPO3_DB object to make the database calls, will be caught , they are checked for errors and time measurements are done on them.

The result of the database queries can be seen directly on the TYPO3 site. But you can configure it to use any functions like sending via email or storing it into a file. An easier method is to use an additional debug extension as fh_debug, beko_debugster or cc_debug with it. By using those extensions you can get a better and more understandable output.

Administration

All administration is don e in the Extension Manager.

Reference

Extension Manager setup

TYPO3_MODE

Property

TYPO3_MODE

Data type

text

Description

Typo3 Mode: FE, BE, ALL or OFF. Normaly set to FE to enable all FE- Plugins SQL-Queries !!!!! Debugging only enabled in this Mode. Use BE only with caution. Use ALL if you are unsure what you shall configure here and want to be certain to get output from this extension under all circumstances.

Default

FE

DISABLE_ERRORS

Property

DISABLE_ERRORS

Data type

integer

Description

Disable mysql errormessages: Normally all mysql_errors() that occur will be displayed. Set to 1 to disable.

Default

1

QUERIES

Property

QUERIES

Data type

text

Description

Comma-sep. list of queries: 'All' for all types of queries. 'None' for none. ALL, SQL (only sql() and sql_query() ), SELECT, UPDATE, INSERT, DELETE

Default

ALL

TABLES

Property

TABLES

Data type

text

Description

Comma-sep. list of tables: 'ALL' for all tables. 'None' for none. List of tables that generate debug-messages.

Default

ALL

PAGES

Property

PAGES

Data type

text

Description

Comma-sep. list of Page-IDs: 0 for all pages. -1 for none. Else list Page-IDs where debug-output has to be generated.

Default

ALL

FEUSERS

Property

FEUSERS

Data type

text

Description

Comma-sep. list of FeUser-IDs: 0 or empty for all fe_users (even without login). Else list FeUser-IDs where debug-output has to be generated.

Default

0

BTRACE_SQL

Property

BTRACE_SQL

Data type

integer

Description

Add Backtrace: Set to 1, if you need debug_backtrace for all sql() and sql_query() calls

Default

OUTPUT

Property

OUTPUT

Data type

text

Description

Output: Destination of the debug info. possible Values: TYPO3CMSUtilityDebugUtility::debug, debug, error_log (see TEXTFORMAT)

OUTPUT = \TYPO3\CMS\Utility\DebugUtility::debug

Default

TYPO3CMSUtilityDebugUtility::debug

TEXTFORMAT

Property

TEXTFORMAT

Data type

boolean

Description

If set, then all the internal debug array is transformed into a normal text before output. This is needed for debug functions which are not able to deal with an array. E.g. if you use error_log as the output method (see OUTPUT), then you must have set this to 1.

Default

0

TCA

Property

TCA

Data type

boolean

Description

Defines that the $TCA for a table must be set to generate an output.

Default

0

TICKER

Property

TICKER

Data type

float

Description

Ticker: Minimum time in miliseconds for the duration of SQL queries which should be reported.

Default

[EM]

((generated))
Example

Install the extension fh_debug and activate the output of it. Now you will see no output of the debug messages. The debug is written into a defined HTML file Instead to the website. Open the HTML file into a browser's tab to show the debug output.

OUTPUT = debug
Example

If you only want textual output instead of an array. Activate the error_log output in your file /etc/php.ini and the display of big lines

php.ini:

log_errors = On
error_log = /var/www/html/error_log
log_errors_max_len = 1024

Extension Manager for debug_mysql_db:

TEXTFORMAT is checked
OUTPUT = error

Known problems

It uses a method to enhance the TYPO3 Core class DatabaseConnection. This could lead to an unknown side effect in an error case. Then some data could get lost.

To-Do list

support of DBAL

ChangeLog

  • Make it running under TYPO3 6.0, 6.1 and 6.2
  • Add all new methods of the class t3lib_DB from TYPO3 4.3

8