• Aucun résultat trouvé

The Server Limit Test (crash-me)

Dans le document MySQL Enterprise Solutions (Page 77-90)

The crash-me test name is rather self-explanatory. It explores the limits of the server to see how it will respond and whether it will crash when given certain types of input, such as

■■ Using particularly long queries

■■ Handling requests to create a table with a large number of columns

■■ Creating a key over a large number of fields

■■ Creating a column of a particular type that is very long

In order to run crashme you first need to make sure you have Perl installed along with DBI/DBD modules for MySQL (for installation instructions, see Chapter 10).

Change to the sql-bench directory (on source and binary installations, it is /usr/local/mysql/sql-bench and on the RPM installation it is /usr/share/sql-bench) and type ./crash-me --config-file=/tmp/mysql.cnf. You will first see out-put similar to that shown in Listing 4.2.

The Ser ver Limit Test (crash-me) 55

Running ./crash-me 1.54 on 'MySQL 3.23.51 debug log'

I hope you didn't have anything important running on this server....

NOTE: You should be familiar with './crash-me —help' before continuing!

This test should not crash MySQL if it was distributed together with the running MySQL version. If this is the case you can probably continue without having to worry about destroying something.

Some of the tests you are about to execute may require a lot of memory. Your tests WILL adversely affect system performance. It’s not uncommon that either this crash-me test program, or the actual database back-end, will DIE with an Listing 4.2 crash-me disclaimer message. (continues)

Listing 4.2 crash-me disclaimer message. (continued)

At this, point if you really mean it, type yes and press the Enter key. As the test progresses, you will see output similar to that shown in Listing 4.3.

out-of-memory error. So might any other program on your system if it requests more memory at the wrong time.

Note also that while crash-me tries to find limits for the database server it will make a lot of queries that can’t be categorized as 'normal'. It's not unlikely that crash-me finds some limit bug in your server so if you run this test you have to be prepared that your server may die during it!

We, the creators of this utility, are not responsible in any way if your database server unexpectedly crashes while this program tries to find the limitations of your server. By accepting the following question with 'yes', you agree to the above!

You have been warned!

Start test (yes/no) ?

Tables without primary key: yes SELECT without FROM: yes Select constants: yes Select table_name.*: yes

Allows ' and " as string markers: yes Double '' as ' in strings: yes Multiple line strings: yes

" as identifier quote (ANSI SQL): error

` as identifier quote: yes [] as identifier quote: no Column alias: yes

Table alias: yes Functions: yes Group functions: yes

Group functions with distinct: yes Group by: yes

Group by position: yes Group by alias: yes

Group on unused column: yes Order by: yes

Order by position: yes Order by function: yes

Order by on unused column: yes Listing 4.3 crashme results. (continues)

The Ser ver Limit Test (crash-me) 57

Order by DESC is remembered: no Compute: no

INSERT with Value lists: yes INSERT with set syntax: yes allows end ';': yes

LIMIT number of rows: with LIMIT SELECT with LIMIT #,#: yes Alter table add column: yes Alter table add many columns: yes Alter table change column: yes Alter table modify column: yes Alter table alter column default: yes Alter table drop column: yes

Alter table rename table: yes rename table: yes

truncate: yes

Alter table add constraint: yes Alter table drop constraint: no Alter table add unique: yes

Alter table drop unique: with drop key Alter table add primary key: with constraint Alter table add foreign key: yes

Alter table drop foreign key: with drop foreign key Alter table drop primary key: drop primary key Case insensitive compare: yes

Ignore end space in compare: yes Group on column with null values: yes Having: yes

Having with group function: yes Order by alias: yes

Value of logical operation (1=1): 1

Simultaneous connections (installation default): 1000 query size: 2097150

Supported sql types Type character(1 arg): yes Type char(1 arg): yes

Type char varying(1 arg): yes Type character varying(1 arg): yes Type boolean: no

Type varchar(1 arg): yes Type integer: yes

Listing 4.3 crashme results. (continues)

Type int: yes Type bit varying(1 arg): no Type float: yes

Type interval year to month: no Type interval month: no

Type interval day: no

Type interval day to hour: no Type interval day to minute: no Type interval day to second: no Type interval hour: no

Type interval hour to minute: no Type interval hour to second: no Type interval minute: no

Type interval minute to second: no Type interval second: no

Type national character varying(1 arg): yes Type national character(1 arg): yes

Type nchar(1 arg): yes

Type national char varying(1 arg): yes Type nchar varying(1 arg): yes

Type national character varying(1 arg): yes Type timestamp with time zone: no

Supported odbc types

Listing 4.3 crashme results. (continues)

The Ser ver Limit Test (crash-me) 59

Type image: no Type text: yes Type text(1 arg): no Type mediumtext: yes

Type long varchar(1 arg): no Type varchar2(1 arg): no

Type int(1 arg) zerofill: yes Type serial: no

Type char(1 arg) binary: yes

Type int not null auto_increment: yes Type abstime: no

Type int not null identity: no Type box: no

Listing 4.3 crashme results. (continues)

Type macaddr: no

Remembers end space in char(): no Remembers end space in varchar(): no Supports 0000-00-00 dates: yes Supports 0001-01-01 dates: yes Supports 9999-12-31 dates: yes Supports 'infinity dates: error Supports YY-MM-DD dates: yes

Supports YY-MM-DD 2000 compilant dates: yes Storage of float values: round

Type for row id: auto_increment Automatic row id: _rowid Supported sql functions Function +, -, * and /: yes Function ANSI SQL SUBSTRING: yes Function BIT_LENGTH: no

Function NULLIF with strings: yes Function NULLIF with numbers: yes Listing 4.3 crashme results. (continues)

The Ser ver Limit Test (crash-me) 61

Function concatenation with ||: error Supported odbc functions

Listing 4.3 crashme results. (continues)

Function POWER: yes

Function ODBC syntax LEFT & RIGHT: yes Supported extra functions

Function & (bitwise and): yes Function | (bitwise or): yes

Function << and >> (bitwise shifts): yes Function <> in SELECT: yes

Function =: yes

Function ~* (case insensitive compare): no Function ADD_MONTHS: no

Function AND and OR in SELECT: yes Function AND as '&&': yes

Function ASCII_CHAR: no Function ASCII_CODE: no Function ATN2: no

Listing 4.3 crashme results. (continues)

The Ser ver Limit Test (crash-me) 63

Function BETWEEN in SELECT: yes Function BIT_COUNT: yes

Function IN on numbers in SELECT: yes Function IN on strings in SELECT: yes Function INITCAP: no

Function INSTR (Oracle syntax): no Function INSTRB: no

Function LIKE ESCAPE in SELECT: yes Function LIKE in SELECT: yes Function LN: no

Function LOCATE as INSTR: yes Function LOG(m,n): no

Function LOGN: no Function LPAD: yes Function MDY: no Function MOD as %: yes Function MONTHS_BETWEEN: no

Function NOT BETWEEN in SELECT: yes Function NOT LIKE in SELECT: yes Function NOT as '!' in SELECT: yes Function NOT in SELECT: yes

Function ODBC CONVERT: no

Listing 4.3 crashme results. (continues)

Function OR as '||': yes

Function REGEXP in SELECT: yes Function REPLICATE: no

Function SUBSTRING as MID: yes Function SUBSTRING_INDEX: yes

Function TRIM; Many char extension: error Function TRIM; Substring extension: yes Function TRUNC: no

Function automatic num->string convert: yes Function automatic string->num convert: yes Function concatenation with +: error

Supported where functions

Function IN on numbers: yes Listing 4.3 crashme results. (continues)

The Ser ver Limit Test (crash-me) 65 Group function COUNT (*): yes

Group function COUNT column name: yes Group function COUNT(DISTINCT expr): yes Group function MAX on numbers: yes Group function MAX on strings: yes Group function MIN on numbers: yes Group function MIN on strings: yes Group function SUM: yes

Group function COUNT(DISTINCT expr,expr,...): yes Group function STD: yes

Group function STDDEV: yes Group function VARIANCE: no

mixing of integer and float in expression: yes No need to cast from integer to float: yes Is 1+NULL = NULL: yes

Is concat('a',NULL) = NULL: yes LIKE on numbers: yes

column LIKE column: yes update of column= -column: yes String functions on date columns: yes char are space filled: no

Update with many tables: no DELETE FROM table1,table2...: no Update with sub select: no Calculate 1—1: yes

ANSI SQL simple joins: yes Listing 4.3 crashme results. (continues)

max text or blob size: 2097119

constant string size in where: 2097115 constant string size in SELECT: 2097141 return string size from function: 2096128 simple expressions: 1507

big expressions: 10 stacked expressions: 1507 OR and AND in WHERE: 84773 tables in join: 31

primary key in create table: yes unique in create table: yes unique null in create: yes default value for column: yes

default value function for column: no temporary tables: yes

create table from select: yes index in create table: yes create index: yes

drop index: with 'ON' null in index: yes null in unique index: yes

null combination in unique index: yes null in unique index: yes

index on column part (extension): yes different namespace for index: yes case independent table names: no drop table if exists: yes create table if not exists: yes inner join: yes

left outer join: yes

natural left outer join: yes left outer join using: yes left outer join odbc style: yes right outer join: yes

full outer join: no

cross join (same as from a,b): yes natural join: yes

natural join (incompatible lists): yes Listing 4.3 crashme results. (continues)

The Ser ver Limit Test (crash-me) 67

union (incompatible lists): no union all (incompatible lists): no intersect (incompatible lists): no intersect all (incompatible lists): no except (incompatible lists): no

except all (incompatible lists): no except (incompatible lists): no except all (incompatible lists): no minus (incompatible lists): no subqueries: no

insert INTO ... SELECT ...: yes transactions: no

NULL constraint (SyBase style): yes Triggers (ANSI SQL): no

PSM procedures (ANSI SQL): no PSM modules (ANSI SQL): no PSM functions (ANSI SQL): no Domains (ANSI SQL): no lock table: yes

many tables to drop table: yes drop table with cascade/restrict: yes

— as comment (ANSI): yes // as comment (ANSI): no

# as comment: yes

select alias name length: +512 table alias name length: +512 index name length: 64

max char() size: 255 max varchar() size: 255

max text or blob size: 2097119 (cache) Columns in table: 3398

unique indexes: 32 index parts: 16

max index part length: 255 Listing 4.3 crashme results. (continues)

Listing 4.3 crashme results. (continued)

In some cases, crashme might actually succeed in crashing the server. If that were to happen, it is important to understand the reason and verify that the lim-itation is not critical for your application. For example, some crashme tests might push the server usage of system resources to the point that the operating system decides to panic, but the tested limit might actually far exceed your needs. In this case, you may lower the appropriate limit in /tmp/mysql.cnf and try the test again.

Each test explores a certain limit of the server. The output of each test is rather self-explanatory. For example, indexes: 32 means that a table can have the max-imum of 32 indexes, while index length: 500 means that the longest key can span no more than 500 bytes. If you see a + before a number, this means that the MySQL team has tested the lower limit but the actual value can be higher. For example, number of columns in order by: +64 means that the server can handle a query using 64 columns in an ORDER BY expression but that the team has not tested a higher limit. In actuality, it might be able to do more.

The One-Threaded Standard MySQL

Dans le document MySQL Enterprise Solutions (Page 77-90)