Commit b031f5f4 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

Merge work:/home/bk/mysql-4.0

into serg.mysql.com:/usr/home/serg/Abk/mysql-4.0
parents f29224c6 1115b3d9
OriginalAuthor: Paul DuBois
!!! ManualStyleGuidelines
''Version 1.1''
!! Revision History
* 2002-05-17 ArjenLentz - Version 1.0, Posted to Wiki
* 2002-06-03 ArjenLentz - Version 1.1, updates.
!! MySQL Manual Style Guidelines
Paul DuBois <paul@snake.net>
The following list of guidelines contains items that I've been jotting
down over time as style questions have come up in relation to the
MySQL manual. I wouldn't say they're exactly "official", but they
do reflect current working practice. Arjen asked me to post this
on the list some time ago so that it can be discussed with a view
to adding it (or something like it) to the source tree. So here it is!
Present in the mysql-4.0 source tree: Docs/ManualStyleGuidelines.wiki
The manual is written in UK English, not American English. This means:
colour, not color
behaviour, not behavior
authorise, not authorize
optimise, not optimize
etc.
Write MySQL, not @strong{MySQL} (the manual used to use the latter, but no
more).
Write Unix, not UNIX.
Use uppercase for SQL keywords, functions names, etc., when writing
SQL statement examples.
To write a list of items, add commas after all items preceding the last one:
Correct: Features, products, and services
Incorrect: Features, products and services
How to pluralize keywords that are enclosed in @code:
Correct: @code{SELECT}s
Incorrect: @code{SELECTs} or @code{SELECT}'s or @code{SELECT}:s
Use "its" and "it's" correctly. These words are exceptions to
the normal use of "'s" to indicate possession:
it's = it is (e.g., "one of the strengths of MySQL is that it's fast")
its = possession (e.g., "MySQL is fast, which is one of its strengths")
"a lot" is two words. "alot" is rebarbative.
Write lowercase, not lower case
Write uppercase, not upper case
Write lettercase, not letter case
Write "web site" (two words), not "website", and "web page" rather
than "webpage".
The word "data" is problematic. It's commonly used both in plural and in
singular form. The manual uses it as plural, which means you use "data are"
rather than "data is". It's unfortunate that no matter which form we use, it
will look incorrect to some people. But we can at least be internally
consistent.
(Paul: I think that the O'Reilly proofread might have caught one or two of these; could you please pick up on these but don't change them back straight away until the book is finished? Thanks; Arjen).
Write "press Enter", not "hit Return" or "hit Enter".
When reproducing program output, reproduce it exactly, even if it contains
typos. Don't "fix" it. (If the output is produced by a MySQL program, then
fix the source for the program to write the output correctly without the
typo, then update the manual to match.)
Use "okay" rather than "ok" or "Ok" or "OK" in sentences. Exceptions:
* When describing instructions for a GUI with buttons that say "OK", then use "OK". That is, use the label that the GUI uses.
* When showing the output from a program, show the output exactly; don't change "ok" to "okay", etc.
Write "Open Source" (inside @code{}), not "open source".
To put something in quotes, do it ``like this,'' not "like this"
or 'like this.' In the latter two cases, the quotes will come
out looking rotten in printed formats.
Exception: quotes in code examples should be written using whatever
contention the program language requires.
Table types should be written using @code{}; write @code{MyISAM}, not
MyISAM.
When possible, use table names that are singular, not plural.
For example, use "item" rather than "items", or "person" rather than
"people". Sometimes you can add "_list" (as in "item_list") to make it
more clear that the name refers to a collection of items.
Some commonly occurring misspelling:
Correct Incorrect
---------------------------
publicly publically
statically staticly
dynamically dynamicly
automatically automaticly
There is no hyphen after "ly" words. Write statically linked, not
statically-linked.
To refer to ASCII codes, use ASCII n, not ASCII(n), unless you're
referring to the ASCII() function, which case you use @code{ASCII()}.
ASCII 13 indicates ASCII character code 13
@code{ASCII(13)} indicates a function call
backup is a noun or adjective (as in "a backup file"), back up is a verb
(as in "to back up a database")
rollback is a noun or adjective (as in "a rollback operation"), roll back
is a verb (as in "roll back a transaction")
core dump is a noun or a verb (as in "a core dump file" or "a program
core dumps when it fails"). In the latter case, however, it's better say
say "a program dumps core when it fails").
Write character set names in @code{}, e.g., @code{latin1}, @code{win1251}.
To prevent problems with various output formats, there should be no link
titles in a @uref{}. So @uref{url} is allowed, @uref{url,blabla} is not.
Use this format:
@uref{url} (WWW)
Not this format:
@uref{url, WWW}
Similarly for FTP sites.
URLs ending in a domain name or directory should have a "/" at the end.
(For example, the URLs for all mirror sites should be written that way.)
Privilege names are written using @strong and lowercase, as in "the
@strong{process} privilege". Column names in the grant tables are
written using @code and the lettercase found in the table definition,
as in "the @code{Process_priv} column".
Write "e-mail", not "email". Exceptions are the @email{} construct, and
the Email attribute name in X509 certificate strings.
Write thread-safe, transaction-safe, replication-safe, not thread safe,
transaction safe, replication safe.
Write wildcard, not wild card or wild-card.
Use "indexes", not "indices": Adding indexes to a table will improve the
performance of SELECT statements.
Exception: when returning to array elements, use "indices": The elements
of the array may be accessed using numeric indices, where the index
values ranges from 0 to n.
Write "heavy-load production systems" (used as an adjective),
but "...used under heavy load" (used on its own).
Write PostScript, not Postscript.
When writing a list like "A, B, and C", include a comma before the last and.
Write case-sensitive and case-insensitive (hyphenated).
Write runtime, not run time.
Write backward-compatible, not backward compatible or backwards compatible.
Write application-related, not application related.
Write filesystem, not file system.
Write file-size, not file size.
Write datafile, not data file.
Write power-start, not power start.
Write percent, not per cent.
Write "toward", "and onward", not "towards", "onwards".
Write third-party, not third party.
Write turnkey, not turn-key.
Write "the Net" (capitalised) if referring to the Internet in that way.
Write long-awaited, not long awaited.
Write natural-language, not natural language.
Write low-volume <something> (when used as an adjective).
Write platform-dependent, not platform dependent.
Write something like "mentioned previously" instead of "above", and "later in this section" instead of "below" when making such relative references in your text.
Write "... shown here", not "... shown below".
Write "following some", not "something [shown] below".
Write high-priority <something> (when used as an adjective), not high priority.
Write "whether", not "whether or not".
Write hand-held, not hand held.
Write rewriting, not re-writing.
Write re-issue(ing), not reissue(ing).
Write command-line, not command line.
Write server-side, not server side.
Write "<blabla> only", not "only <blabla>".
Write floating-point, not floating point.
Write heavy-duty, not heavy duty.
Write online, not on-line.
Write user-defined, not user defined.
Write multi-user, not multi user.
Write multi-thread(ed), not multithread(ed).
Write memory-based, not memory based.
Write long-time <something> (when used as an adjective), not long time.
Write 32-bit, not 32 bit or 32 bits. (Same goes for 64-bit, of course! ;-)
Write "different from [what] ...", not "different than ...".
Write "@-e.g., " instead of " e.g. " in the middle of a sentence. (The @- will be turned into a dash, or &mdash; for DocBook output.)
Following "e.g." by a comma, not a space or a colon.
Write "@-" if you need to put a dash in a text, no surrounding spaces.
Similar story for "for example" as for "e.g."
Write CPU, not cpu (it's an acronym, not a word! ;-)
Write "... uses ... CPU time", not "... uses ... CPU" (unless you're referring the processor itself.)
If a (comment) is at the end of a sentence, start the comment with lowercase and put the . after the closing ), such as (like this).
If a comment is separate, start with uppercase and put the . inside the closing ). (Like this.)
Write "something cannot do something", not "something can not something".
Write "otherwise, ..." (with the comma) at the start of a sentence.
Paul, could you please check "honoring"... is this proper British English? Thanks, Arjen.
Write "byte-swapping", not "byte swapping".
Write "Note:", not "NOTE:". And then continue with lowercase, it is not the start of a new sentence.
Write "single-CPU" and "multiple-CPU", not "single CPU" and "multiple CPU".
Paul, I think we should also decide whether to write Version or version, and in what situation. I am not changing much now because there's lots of funny instances and I don't want to risk getting it wrong. Thanks, Arjen.
After a semicolon, don't use uppercase. It is NOT the start of a new sentence!
It's "unstable", not "instable". ;-)
It's "full-text", not "fulltext".
Logical NOT/OR/AND are operators, not functions, so they take operands, not arguments.
It's NetWare, not Netware (as per Novell's trademark guidelines).
It's deprecated, not depricated.
...@@ -542,3 +542,14 @@ select * from mysql.db; ...@@ -542,3 +542,14 @@ select * from mysql.db;
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
Variable_name Value Variable_name Value
Qcache_queries_in_cache 0 Qcache_queries_in_cache 0
create table t1(id int auto_increment primary key);
insert into t1 values (NULL), (NULL), (NULL);
select * from t1 where id=2;
id
2
alter table t1 rename to t2;
select * from t1 where id=2;
Table 'test.t1' doesn't exist
drop table t2;
select * from t1 where id=2;
Table 'test.t1' doesn't exist
...@@ -383,3 +383,17 @@ disable_result_log; ...@@ -383,3 +383,17 @@ disable_result_log;
select * from mysql.db; select * from mysql.db;
enable_result_log; enable_result_log;
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
#
# simple rename test
#
create table t1(id int auto_increment primary key);
insert into t1 values (NULL), (NULL), (NULL);
select * from t1 where id=2;
alter table t1 rename to t2;
-- error 1146
select * from t1 where id=2;
drop table t2;
-- error 1146
select * from t1 where id=2;
...@@ -64,7 +64,7 @@ do ...@@ -64,7 +64,7 @@ do
done done
for i in extra/comp_err extra/replace extra/perror extra/resolveip \ for i in extra/comp_err extra/replace extra/perror extra/resolveip \
extra/my_print_defaults extra/resolve_stack_dump \ extra/my_print_defaults extra/mysql_waitpid extra/resolve_stack_dump \
isam/isamchk isam/pack_isam myisam/myisamchk \ isam/isamchk isam/pack_isam myisam/myisamchk \
myisam/myisampack sql/mysqld client/mysqlbinlog \ myisam/myisampack sql/mysqld client/mysqlbinlog \
client/mysql sql/mysqld client/mysqlshow client/mysqlcheck \ client/mysql sql/mysqld client/mysqlshow client/mysqlcheck \
......
...@@ -48,7 +48,7 @@ require "$pwd/server-cfg" || die "Can't read Configuration file: $!\n"; ...@@ -48,7 +48,7 @@ require "$pwd/server-cfg" || die "Can't read Configuration file: $!\n";
$opt_server="mysql"; $opt_host="localhost"; $opt_database="test"; $opt_server="mysql"; $opt_host="localhost"; $opt_database="test";
$opt_dir="limits"; $opt_dir="limits";
$opt_user=$opt_password="";$opt_verbose=""; $opt_user=$opt_password="";$opt_verbose=1;
$opt_debug=$opt_help=$opt_Information=$opt_restart=$opt_force=$opt_quick=0; $opt_debug=$opt_help=$opt_Information=$opt_restart=$opt_force=$opt_quick=0;
$opt_log_all_queries=$opt_fix_limit_file=$opt_batch_mode=$opt_version=0; $opt_log_all_queries=$opt_fix_limit_file=$opt_batch_mode=$opt_version=0;
$opt_db_start_cmd=""; # the db server start command $opt_db_start_cmd=""; # the db server start command
...@@ -855,10 +855,6 @@ try_and_report("Automatic row id", "automatic_rowid", ...@@ -855,10 +855,6 @@ try_and_report("Automatic row id", "automatic_rowid",
["NOW","now","now()",0,2], # Any value is acceptable ["NOW","now","now()",0,2], # Any value is acceptable
["CURDATE","curdate","curdate()",0,2], ["CURDATE","curdate","curdate()",0,2],
["CURTIME","curtime","curtime()",0,2], ["CURTIME","curtime","curtime()",0,2],
["HOUR","hour","hour('12:13:14')",12,0],
["ANSI HOUR","hour_time","hour(TIME '12:13:14')",12,0],
["MINUTE","minute","minute('12:13:14')",13,0],
["SECOND","second","second('12:13:14')",14,0],
["TIMESTAMPADD","timestampadd", ["TIMESTAMPADD","timestampadd",
"timestampadd(SQL_TSI_SECOND,1,'1997-01-01 00:00:00')", "timestampadd(SQL_TSI_SECOND,1,'1997-01-01 00:00:00')",
"1997-01-01 00:00:01",1], "1997-01-01 00:00:01",1],
...@@ -943,7 +939,6 @@ try_and_report("Automatic row id", "automatic_rowid", ...@@ -943,7 +939,6 @@ try_and_report("Automatic row id", "automatic_rowid",
["ROOT","root","root(4)",2,0], # informix ["ROOT","root","root(4)",2,0], # informix
["ROUND(1 arg)","round1","round(5.63)","6",0], ["ROUND(1 arg)","round1","round(5.63)","6",0],
["RPAD","rpad","rpad('hi',4,'??')",'hi??',3], ["RPAD","rpad","rpad('hi',4,'??')",'hi??',3],
["SEC_TO_TIME","sec_to_time","sec_to_time(5001)","01:23:21",1],
["SINH","sinh","sinh(1)","1.17520119",0], # oracle hyperbolic sine of n ["SINH","sinh","sinh(1)","1.17520119",0], # oracle hyperbolic sine of n
["STR","str","str(123.45,5,1)",123.5,3], ["STR","str","str(123.45,5,1)",123.5,3],
["STRCMP","strcmp","strcmp('abc','adc')",-1,0], ["STRCMP","strcmp","strcmp('abc','adc')",-1,0],
...@@ -957,7 +952,6 @@ try_and_report("Automatic row id", "automatic_rowid", ...@@ -957,7 +952,6 @@ try_and_report("Automatic row id", "automatic_rowid",
["TAIL","tail","tail('ABCDEFG',3)","EFG",0], ["TAIL","tail","tail('ABCDEFG',3)","EFG",0],
["TANH","tanh","tanh(1)","0.462117157",0], ["TANH","tanh","tanh(1)","0.462117157",0],
# oracle hyperbolic tangent of n # oracle hyperbolic tangent of n
["TIME_TO_SEC","time_to_sec","time_to_sec('01:23:21')","5001",0],
["TRANSLATE","translate","translate('abc','bc','de')",'ade',3], ["TRANSLATE","translate","translate('abc','bc','de')",'ade',3],
["TRIM; Many char extension", ["TRIM; Many char extension",
"trim_many_char","trim(':!' FROM ':abc!')","abc",3], "trim_many_char","trim(':!' FROM ':abc!')","abc",3],
...@@ -992,21 +986,10 @@ try_and_report("Automatic row id", "automatic_rowid", ...@@ -992,21 +986,10 @@ try_and_report("Automatic row id", "automatic_rowid",
["FLOAT",'float',"float(6666.66,4)",6667,0], ["FLOAT",'float',"float(6666.66,4)",6667,0],
["LENGTH",'length',"length(1)",2,0], ["LENGTH",'length',"length(1)",2,0],
["INDEX",'index',"index('abcdefg','cd',1,1)",3,0], ["INDEX",'index',"index('abcdefg','cd',1,1)",3,0],
["ADDTIME",'addtime',"ADDTIME('00200212','00000300')",'00200215',0],
["SUBTIME",'subtime',"SUBTIME('00200215','00000300')",'00200212',0],
["TIMEDIFF",'timediff',"TIMEDIFF('00200215','00200212')",'00000003',0],
["MAKETIME",'maketime',"MAKETIME(20,02,12)",'00200212',0],
["HOUR with sapdb internal time as arg",
'hour_sapdb',"HOUR('00200212')",20,0],
["MINUTE with sapdb internal time as arg",
'minute_sapdb',"MINUTE('00200212')",2,0],
["SECOND with sapdb internal time as arg",
'second_sapdb',"SECOND('00200212')",12,0],
["MICROSECOND",'microsecond', ["MICROSECOND",'microsecond',
"MICROSECOND('19630816200212111111')",'111111',0], "MICROSECOND('19630816200212111111')",'111111',0],
["TIMESTAMP",'timestamp', ["TIMESTAMP",'timestamp',
"timestamp('19630816','00200212')",'19630816200212000000',0], "timestamp('19630816','00200212')",'19630816200212000000',0],
["TIME",'time',"time('00200212')",'00200212',0],
["VALUE",'value',"value(NULL,'WALRUS')",'WALRUS',0], ["VALUE",'value',"value(NULL,'WALRUS')",'WALRUS',0],
["DECODE",'decode',"DECODE('S-103','T72',1,'S-103',2,'Leopard',3)",2,0], ["DECODE",'decode',"DECODE('S-103','T72',1,'S-103',2,'Leopard',3)",2,0],
["NUM",'num',"NUM('2123')",2123,0], ["NUM",'num',"NUM('2123')",2123,0],
...@@ -1500,6 +1483,137 @@ if ($limits{'type_sql_date'} eq 'yes') ...@@ -1500,6 +1483,137 @@ if ($limits{'type_sql_date'} eq 'yes')
} }
if ($limits{'type_sql_time'} eq 'yes')
{ #
# Checking the format of date in result.
safe_query("drop table crash_me_t $drop_attr");
assert("create table crash_me_t (a time)");
# find the example of time
my $timeexample;
if ($limits{'func_sql_current_time'} eq 'yes') {
$timeexample='CURRENT_TIME';
}
elsif ($limits{'func_odbc_curtime'} eq 'yes') {
$timeexample='curtime()';
}
elsif ($limits{'func_sql_localtime'} eq 'yes') {
$timeexample='localtime';
}
elsif ($limits{'func_odbc_now'} eq 'yes') {
$timeexample='now()';
} else {
#try to guess
$timeexample="'02:55:12'";
} ;
my $key = 'time_format_inresult';
my $prompt = "Time format in result";
if (! safe_query_l('time_format_inresult',
"insert into crash_me_t values($timeexample) "))
{
die "Cannot insert time ($timeexample):".$last_error;
};
my $sth= $dbh->prepare("select a from crash_me_t");
add_log('time_format_inresult',"< select a from crash_me_t");
$sth->execute;
$_= $sth->fetchrow_array;
add_log('time_format_inresult',"> $_");
safe_query_l($key,"delete from crash_me_t");
if (/\d{2}:\d{2}:\d{2}/){ save_config_data($key,"iso",$prompt);}
elsif (/\d{2}\.\d{2}\.\d{2}/){ save_config_data($key,"euro",$prompt);}
elsif (/\d{2}:\d{2}\s+(AM|PM)/i){ save_config_data($key,"usa",$prompt);}
elsif (/\d{8}$/){ save_config_data($key,"HHHHMMSS",$prompt);}
elsif (/\d{4}$/){ save_config_data($key,"HHMMSS",$prompt);}
else { save_config_data($key,"unknown",$prompt);};
$sth->finish;
check_and_report("Supports HH:MM:SS (ISO) time format","time_format_ISO",
[ "insert into crash_me_t(a) values ('20:08:16')"],
"select a from crash_me_t",
["delete from crash_me_t"],
make_time_r(20,8,16),1);
check_and_report("Supports HH.MM.SS (EUR) time format","time_format_EUR",
[ "insert into crash_me_t(a) values ('20.08.16')"],
"select a from crash_me_t",
["delete from crash_me_t"],
make_time_r(20,8,16),1);
check_and_report("Supports HHHHmmSS time format",
"time_format_HHHHMMSS",
[ "insert into crash_me_t(a) values ('00200816')"],
"select a from crash_me_t",
["delete from crash_me_t"],
make_time_r(20,8,16),1);
check_and_report("Supports HHmmSS time format",
"time_format_HHHHMMSS",
[ "insert into crash_me_t(a) values ('200816')"],
"select a from crash_me_t",
["delete from crash_me_t"],
make_time_r(20,8,16),1);
check_and_report("Supports HH:MM:SS (AM|PM) time format",
"time_format_USA",
[ "insert into crash_me_t(a) values ('08:08:16 PM')"],
"select a from crash_me_t",
["delete from crash_me_t"],
make_time_r(20,8,16),1);
my $insert_query ='insert into crash_me_t values('.
make_time(20,8,16).')';
safe_query($insert_query);
foreach $fn ( (
["HOUR","hour","hour('".make_time(12,13,14)."')",12,0],
["ANSI HOUR","hour_time","hour(TIME '".make_time(12,13,14)."')",12,0],
["MINUTE","minute","minute('".make_time(12,13,14)."')",13,0],
["SECOND","second","second('".make_time(12,13,14)."')",14,0]
))
{
$prompt='Function '.$fn->[0];
$key='func_odbc_'.$fn->[1];
add_log($key,"< ".$insert_query);
check_and_report($prompt,$key,
[],"select ".$fn->[2]." $end_query",[],
$fn->[3],$fn->[4]
);
};
# safe_query(['delete from crash_me_t',
# 'insert into crash_me_t values('.make_time(20,8,16).')']);
foreach $fn ((
["TIME_TO_SEC","time_to_sec","time_to_sec('".
make_time(1,23,21)."')","5001",0],
["SEC_TO_TIME","sec_to_time","sec_to_time(5001)",
make_time_r(01,23,21),1],
["ADDTIME",'addtime',"ADDTIME('".make_time(20,2,12).
"','".make_time(0,0,3)."')",make_time_r(20,2,15),0],
["SUBTIME",'subtime',"SUBTIME('".make_time(20,2,15)
."','".make_time(0,0,3)."')",make_time_r(20,2,12),0],
["TIMEDIFF",'timediff',"TIMEDIFF('".make_time(20,2,15)."','".
make_time(20,2,12)."')",make_time_r(0,0,3),0],
["MAKETIME",'maketime',"MAKETIME(20,02,12)",make_time_r(20,2,12),0],
["TIME",'time',"time('".make_time(20,2,12)."')",make_time_r(20,2,12),0]
))
{
$prompt='Function '.$fn->[0];
$key='func_extra_'.$fn->[1];
my $qry="select ".$fn->[2]." $end_query";
my $result=$fn->[3];
check_and_report($prompt,$key,
[],$qry,[],
$result,$fn->[4]
);
}
safe_query("drop table crash_me_t $drop_attr");
}
# NOT id BETWEEN a and b # NOT id BETWEEN a and b
if ($limits{'func_where_not_between'} eq 'yes') if ($limits{'func_where_not_between'} eq 'yes')
......
...@@ -170,6 +170,7 @@ sub new ...@@ -170,6 +170,7 @@ sub new
$limits{'unique_index'} = 1; # Unique index works or not $limits{'unique_index'} = 1; # Unique index works or not
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
# Some fixes that depends on the environment # Some fixes that depends on the environment
if (defined($main::opt_create_options) && if (defined($main::opt_create_options) &&
...@@ -216,6 +217,13 @@ sub version ...@@ -216,6 +217,13 @@ sub version
$version="MySQL $row[0]"; $version="MySQL $row[0]";
} }
$sth->finish; $sth->finish;
$sth = $dbh->prepare("show status like 'ssl_version'") or die $DBI::errstr;
if ($sth->execute && (@row = $sth->fetchrow_array))
{
$version .= "/$row[1]";
}
$sth->finish;
$dbh->disconnect; $dbh->disconnect;
$version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/); $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version; return $version;
...@@ -413,6 +421,7 @@ sub new ...@@ -413,6 +421,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -614,6 +623,7 @@ sub new ...@@ -614,6 +623,7 @@ sub new
$limits{'unique_index'} = 1; # Unique index works or not $limits{'unique_index'} = 1; # Unique index works or not
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -891,6 +901,7 @@ sub new ...@@ -891,6 +901,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -1121,6 +1132,7 @@ sub new ...@@ -1121,6 +1132,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -1392,6 +1404,7 @@ sub new ...@@ -1392,6 +1404,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
...@@ -1636,6 +1649,7 @@ sub new ...@@ -1636,6 +1649,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -1850,6 +1864,7 @@ sub new ...@@ -1850,6 +1864,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -2034,6 +2049,7 @@ sub new ...@@ -2034,6 +2049,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -2229,6 +2245,7 @@ sub new ...@@ -2229,6 +2245,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -2460,6 +2477,7 @@ sub new ...@@ -2460,6 +2477,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
...@@ -2663,6 +2681,7 @@ sub new ...@@ -2663,6 +2681,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -2817,7 +2836,7 @@ sub new ...@@ -2817,7 +2836,7 @@ sub new
$limits{'subqueries'} = 1; # Supports sub-queries. $limits{'subqueries'} = 1; # Supports sub-queries.
$limits{'left_outer_join'} = 1; # Supports left outer joins $limits{'left_outer_join'} = 1; # Supports left outer joins
$limits{'table_wildcard'} = 1; # Has SELECT table_name.* $limits{'table_wildcard'} = 1; # Has SELECT table_name.*
$limits{'having_with_alias'} = 1; # Can use aliases in HAVING $limits{'having_with_alias'} = 0; # Can use aliases in HAVING
$limits{'having_with_group'} = 1; # Can use group functions in HAVING $limits{'having_with_group'} = 1; # Can use group functions in HAVING
$limits{'like_with_column'} = 1; # Can use column1 LIKE column2 $limits{'like_with_column'} = 1; # Can use column1 LIKE column2
$limits{'order_by_position'} = 1; # Can use 'ORDER BY 1' $limits{'order_by_position'} = 1; # Can use 'ORDER BY 1'
...@@ -2826,6 +2845,7 @@ sub new ...@@ -2826,6 +2845,7 @@ sub new
$limits{'alter_add_multi_col'}= 0; # Have ALTER TABLE t add a int,add b int; $limits{'alter_add_multi_col'}= 0; # Have ALTER TABLE t add a int,add b int;
$limits{'alter_table_dropcol'}= 1; # Have ALTER TABLE DROP column $limits{'alter_table_dropcol'}= 1; # Have ALTER TABLE DROP column
$limits{'insert_multi_value'} = 0; # Does not have INSERT ... values (1,2),(3,4) $limits{'insert_multi_value'} = 0; # Does not have INSERT ... values (1,2),(3,4)
$limits{'multi_distinct'} = 0; # Does not allow select count(distinct a),count(distinct b)..
$limits{'group_func_extra_std'} = 0; # Does not have group function std(). $limits{'group_func_extra_std'} = 0; # Does not have group function std().
...@@ -2840,8 +2860,9 @@ sub new ...@@ -2840,8 +2860,9 @@ sub new
$limits{'unique_index'} = 1; # Unique index works or not $limits{'unique_index'} = 1; # Unique index works or not
$limits{'insert_select'} = 1; $limits{'insert_select'} = 1;
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 0;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -2899,6 +2920,7 @@ sub create ...@@ -2899,6 +2920,7 @@ sub create
{ {
# $field =~ s/ decimal/ double(10,2)/i; # $field =~ s/ decimal/ double(10,2)/i;
# $field =~ s/ big_decimal/ double(10,2)/i; # $field =~ s/ big_decimal/ double(10,2)/i;
$field =~ s/ double/ double precision/i;
$field =~ s/ tinyint\(.*\)/ smallint/i; $field =~ s/ tinyint\(.*\)/ smallint/i;
$field =~ s/ smallint\(.*\)/ smallint/i; $field =~ s/ smallint\(.*\)/ smallint/i;
$field =~ s/ mediumint/ integer/i; $field =~ s/ mediumint/ integer/i;
...@@ -3040,6 +3062,7 @@ sub new ...@@ -3040,6 +3062,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works $limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 1; $limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1; $limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -3242,6 +3265,7 @@ sub new ...@@ -3242,6 +3265,7 @@ sub new
$limits{'group_func_sql_min_str'} = 0; $limits{'group_func_sql_min_str'} = 0;
# If you do select f1,f2,f3...f200 from table, Frontbase dies. # If you do select f1,f2,f3...f200 from table, Frontbase dies.
$limits{'working_all_fields'} = 0; $limits{'working_all_fields'} = 0;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
} }
...@@ -3446,6 +3470,7 @@ sub new ...@@ -3446,6 +3470,7 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works * $limits{'working_blobs'} = 1; # If big varchar/blobs works *
$limits{'order_by_unused'} = 1; # $limits{'order_by_unused'} = 1; #
$limits{'working_all_fields'} = 1; # $limits{'working_all_fields'} = 1; #
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self; return $self;
......
...@@ -112,7 +112,7 @@ do_many($dbh,$server->create("bench1", ...@@ -112,7 +112,7 @@ do_many($dbh,$server->create("bench1",
"id3 int NOT NULL", "id3 int NOT NULL",
"dummy1 char(30)"], "dummy1 char(30)"],
["primary key (id,id2)", ["primary key (id,id2)",
"index index_id3 (id3)"])); "index ix_id3 (id3)"]));
if ($opt_lock_tables) if ($opt_lock_tables)
{ {
...@@ -1289,9 +1289,9 @@ if (($opt_fast || $opt_fast_insert) && $server->{'limits'}->{'insert_multi_value ...@@ -1289,9 +1289,9 @@ if (($opt_fast || $opt_fast_insert) && $server->{'limits'}->{'insert_multi_value
{ {
$id= $i & 127; $id= $i & 127;
$rand=$random[$i]; $rand=$random[$i];
$tmp="($id,$id,$rand," . ($i & 32766) . ",'ABCDEF$rand',0,"; $tmp="($id,$id,$rand," . ($i & 32766) . ",'ABCDEF$rand',0,$rand,$rand.0,";
for ($j=6; $j <= $fields ; $j++) for ($j=8; $j <= $fields ; $j++)
{ {
$tmp.= ($types[$j] == 0) ? "$rand," : "'$rand',"; $tmp.= ($types[$j] == 0) ? "$rand," : "'$rand',";
} }
...@@ -1315,9 +1315,9 @@ else ...@@ -1315,9 +1315,9 @@ else
$id= $i & 127; $id= $i & 127;
$rand=$random[$i]; $rand=$random[$i];
$query="insert into bench1 values ($id,$id,$rand," . ($i & 32767) . $query="insert into bench1 values ($id,$id,$rand," . ($i & 32767) .
",'ABCDEF$rand',0,"; ",'ABCDEF$rand',0,$rand,$rand.0,";
for ($j=6; $j <= $fields ; $j++) for ($j=8; $j <= $fields ; $j++)
{ {
$query.= ($types[$j] == 0) ? "$rand," : "'$rand',"; $query.= ($types[$j] == 0) ? "$rand," : "'$rand',";
} }
......
...@@ -355,19 +355,22 @@ if ($limits->{'group_distinct_functions'}) ...@@ -355,19 +355,22 @@ if ($limits->{'group_distinct_functions'})
print " for count_distinct ($count:$rows): " . print " for count_distinct ($count:$rows): " .
timestr(timediff($end_time, $loop_time),"all") . "\n"; timestr(timediff($end_time, $loop_time),"all") . "\n";
$loop_time=new Benchmark; # Workaround mimer's behavior
$rows=$estimated=$count=0; if (limits->{'multi_distinct'} == 1 ) {
for ($i=0 ; $i < $opt_medium_loop_count ; $i++) $loop_time=new Benchmark;
{ $rows=$estimated=$count=0;
$count++; for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
$rows+=fetch_all_rows($dbh,"select count(distinct grp),count(distinct rev_idn) from bench1"); {
$end_time=new Benchmark; $count++;
last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1, $rows+=fetch_all_rows($dbh,"select count(distinct grp),count(distinct rev_idn) from bench1");
$end_time=new Benchmark;
last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1,
$opt_medium_loop_count)); $opt_medium_loop_count));
} }
print_time($estimated); print_time($estimated);
print " for count_distinct_2 ($count:$rows): " . print " for count_distinct_2 ($count:$rows): " .
timestr(timediff($end_time, $loop_time),"all") . "\n"; timestr(timediff($end_time, $loop_time),"all") . "\n";
}
$loop_time=new Benchmark; $loop_time=new Benchmark;
$rows=$estimated=$count=0; $rows=$estimated=$count=0;
......
...@@ -1432,6 +1432,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -1432,6 +1432,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
} }
send_ok(&thd->net); send_ok(&thd->net);
} }
table_list->table=0; // For query cache
query_cache_invalidate3(thd, table_list, 0);
DBUG_RETURN(error); DBUG_RETURN(error);
} }
......
...@@ -12,7 +12,7 @@ Summary(pt_BR): MySQL: Um servidor SQL r ...@@ -12,7 +12,7 @@ Summary(pt_BR): MySQL: Um servidor SQL r
Group(pt_BR): Aplicaes/Banco_de_Dados Group(pt_BR): Aplicaes/Banco_de_Dados
Version: @MYSQL_NO_DASH_VERSION@ Version: @MYSQL_NO_DASH_VERSION@
Release: %{release} Release: %{release}
Copyright: GPL / LGPL Copyright: GPL
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz
Icon: mysql.gif Icon: mysql.gif
URL: http://www.mysql.com/ URL: http://www.mysql.com/
...@@ -45,6 +45,34 @@ The MySQL web site (http://www.mysql.com/) provides the latest ...@@ -45,6 +45,34 @@ The MySQL web site (http://www.mysql.com/) provides the latest
news and information about the MySQL software. Also please see the news and information about the MySQL software. Also please see the
documentation and the manual for more information. documentation and the manual for more information.
%package server
Release: %{release}
Summary: MySQL: a very fast and reliable SQL database server
Group: Applications/Databases
Summary(pt_BR): MySQL: Um servidor SQL rpido e confivel.
Group(pt_BR): Aplicaes/Banco_de_Dados
Requires: fileutils sh-utils
Provides: msqlormysql mysql-server mysql MySQL
Obsoletes: MySQL mysql mysql-server
%description server
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
MySQL AB.
The MySQL software has Dual Licensing, which means you can use the MySQL
software free of charge under the GNU General Public License
(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
licenses from MySQL AB if you do not wish to be bound by the terms of
the GPL. See the chapter "Licensing and Support" in the manual for
further info.
The MySQL web site (http://www.mysql.com/) provides the latest
news and information about the MySQL software. Also please see the
documentation and the manual for more information.
This package includes the MySQL server binary (statically linked, This package includes the MySQL server binary (statically linked,
compiled with InnoDB support) as well as related utilities to run compiled with InnoDB support) as well as related utilities to run
and administrate a MySQL server. and administrate a MySQL server.
...@@ -62,7 +90,7 @@ Obsoletes: mysql-client ...@@ -62,7 +90,7 @@ Obsoletes: mysql-client
Provides: mysql-client Provides: mysql-client
%description client %description client
This package contains the standard MySQL clients. This package contains the standard MySQL clients and administration tools.
%{see_base} %{see_base}
...@@ -386,7 +414,7 @@ fi ...@@ -386,7 +414,7 @@ fi
%clean %clean
[ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR; [ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR;
%files %files server
%defattr(755 root, root) %defattr(755 root, root)
%doc %attr(644, root, root) COPYING COPYING.LIB README %doc %attr(644, root, root) COPYING COPYING.LIB README
...@@ -440,6 +468,7 @@ fi ...@@ -440,6 +468,7 @@ fi
%attr(755, root, root) /usr/bin/msql2mysql %attr(755, root, root) /usr/bin/msql2mysql
%attr(755, root, root) /usr/bin/mysql %attr(755, root, root) /usr/bin/mysql
%attr(755, root, root) /usr/bin/mysql_find_rows %attr(755, root, root) /usr/bin/mysql_find_rows
%attr(755, root, root) /usr/bin/mysql_waitpid
%attr(755, root, root) /usr/bin/mysqlaccess %attr(755, root, root) /usr/bin/mysqlaccess
%attr(755, root, root) /usr/bin/mysqladmin %attr(755, root, root) /usr/bin/mysqladmin
%attr(755, root, root) /usr/bin/mysqlbinlog %attr(755, root, root) /usr/bin/mysqlbinlog
...@@ -502,6 +531,12 @@ fi ...@@ -502,6 +531,12 @@ fi
%changelog %changelog
* Fri Jan 24 2003 Lenz Grimmer <lenz@mysql.com>
- renamed package "MySQL" to "MySQL-server"
- fixed Copyright tag
- added mysql_waitpid to client subpackage (required for mysql-test-run)
* Wed Nov 27 2002 Lenz Grimmer <lenz@mysql.com> * Wed Nov 27 2002 Lenz Grimmer <lenz@mysql.com>
- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of - moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment