Commit 25929faf authored by monty@donna.mysql.com's avatar monty@donna.mysql.com

Merge work:/home/bk/mysql into donna.mysql.com:/home/my/bk/mysql

parents 980e9113 306640e2
......@@ -4,7 +4,7 @@ make -k clean
/bin/rm -f config.cache mysql-*.tar.gz
aclocal; autoheader; aclocal; automake; autoconf
CC=ccc CFLAGS="-fast -O3 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mcpu=ev6 -Wa,-mev6" CXXLDFLAGS='/usr/lib/compaq/libots-2.2.7/libots.so /usr/lib/compaq/cpml-5.0.0/libcpml_ev6.a' ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex
CC=ccc CFLAGS="-fast -O3 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mcpu=ev6 -Wa,-mev6" CXXLDFLAGS='/usr/lib/compaq/libots-2.2.7/libots.so /usr/lib/compaq/cpml-5.0.0/libcpml_ev6.a' ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-thread-safe-client
make
if [ $? = 0 ]
then
......
Mail by sasha, should be rewritten as a HOWTO sometimes
-----------
I have set up a repository with BitKeeper on work. There are still some things
about it that I would like to learn, but I have gotten far enough with it to
replace CVS functionality were are currently using, so let's just go ahead and
get started on it. Please follow the instructions below (make sure to save the
message for future reference):
a) http://www.bitmover.com/download
user: beta
password: get bitkeeper
get the version appropriate for your platform - download it to a temp
directory, chmod +x and then run it. You will have to tell it which directory
to install, for consistency, let's use /usr/local/bin
b) we will take advantage of bk capablity of working with master/slave
repositories. The master will be on work.mysql.com, the slaves will be our
individual machines. The master repository has already been set up on work, so
you will need just to set up a slave repository on your machine:
mkdir bk
cd bk
bk clone yourusername@work:/home/bk/mysql mysql
cd mysql
bk -r edit
Now you have the entire source tree in the current directory. Let's compile it:
BUILD/compile-pentium-debug
After you edit a file, you need to check it in using bk citool or bk ci
filename. Note that ci is different than commit - you ci a file, but you commit
a change set. This is a very nice concept - instead of thinking of each
individual file as CVS does, bk groups the changes you are making and allows you
to document what you actually did between the commits as a whole, rather than
just commenting on every file. When you commit, bk will ask you to comment on
the change set.
Commit is done just to your local repository. To make your changes global, you
will need to run bk push. Be careful with that - it is a good idea to run bk
push -l -n first too see what you are just about to push to the master
repository.
When somebody does a push, you will be getting a email ( I will set this up to
day). You will then need to execute bk pull to update your sources. If there are
any conflicts, bk will force you to resolve them by asking you questions on what
to do with each conflict.
To learn more about bk, use bk helptool - I will be doing this a lot in the next
couple of days :-) If you find bugs or have questions/feature
suggestions/comments for developers, feel free to e-mail dev@bitmover.com .
Their developers, and especially the president of the company Larry McCoy really
like MySQL and are very anxious to help us. Make sure it is obvious that you
work for MySQL, of course. And, of course, do not bug them with little things
that you can figure out on your own or with my help - they were nice to offer us
support, but we should not abuse it.
If you are working on 3.23 MySQL source, please make sure to convert to bk ASAP
before you do any further developement - otherwise, things will get
exponentially worse as the code mass increases. I will work on mysql-4.0 next
and try to set it up so that when we update 3.23 source tree, the update makes
it to mysql-4.0.
This diff is collapsed.
......@@ -26,7 +26,7 @@ SUBDIRS = include @docs_dirs@ @readline_dir@ @sql_client_dirs@ \
@bench_dirs@ support-files
# Relink after clean
CLEANFILES = linked_client_sources linked_server_sources
CLEANFILES = linked_client_sources linked_server_sources linked_libmysql_sources linked_libmysql_r_sources
# This is just so that the linking is done early.
config.h: linked_client_sources linked_server_sources
......@@ -36,9 +36,11 @@ linked_client_sources: @linked_client_targets@
linked_libmysql_sources:
cd libmysql; $(MAKE) link_sources
echo timestamp > linked_libmysql_sources
linked_libmysql_r_sources: linked_libmysql_sources
cd libmysql_r; $(MAKE) link_sources
echo timestamp > linked_libmysql_r_sources
#avoid recursive make calls in sql directory
linked_server_sources:
......
......@@ -402,7 +402,7 @@ CHANGEABLE_VAR changeable_vars[] = {
static void usage(int version)
{
printf("%s Ver 10.10 Distrib %s, for %s (%s)\n",
printf("%s Ver 10.11 Distrib %s, for %s (%s)\n",
my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
if (version)
return;
......@@ -435,9 +435,10 @@ static void usage(int version)
-g, --no-named-commands\n\
Named commands are disabled. Use \\* form only, or\n\
use named commands only in the beginning of a line\n\
ending with a semicolon (;)\n\
Since version 10.9 the client now starts with this\n\
option ENABLED by default! Disable with '-G'\n\
ending with a semicolon (;) Since version 10.9 the\n\
client now starts with this option ENABLED by\n\
default! Disable with '-G'. Long format commands\n\
still work from the first line.\n\
-i, --ignore-space Ignore space after function names.\n\
-h, --host=... Connect to host.\n\
-H, --html Produce HTML output.\n\
......@@ -690,12 +691,12 @@ static int read_lines(bool execute_commands)
if (!in_string && (line[0] == '#' ||
(line[0] == '-' && line[1] == '-') ||
line[0] == 0))
continue; // Skipp comment lines
continue; // Skip comment lines
/* Check if line is a mysql command line */
/* (We want to allow help, print and clear anywhere at line start */
if (execute_commands && !no_named_cmds && !in_string &&
(com=find_command(line,0)))
if (execute_commands && (!no_named_cmds || glob_buffer.is_empty())
&& !in_string && (com=find_command(line,0)))
{
if ((*com->func)(&glob_buffer,line) > 0)
break;
......
......@@ -43,7 +43,7 @@ libmyisam_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
mi_rsamepos.c mi_panic.c mi_close.c mi_create.c\
mi_range.c mi_dbug.c mi_checksum.c mi_log.c \
mi_changed.c mi_static.c mi_delete_all.c \
mi_delete_table.c mi_rename.c mi_check.c mi_debug.c \
mi_delete_table.c mi_rename.c mi_check.c \
ft_parser.c ft_search.c ft_stopwords.c ft_static.c \
ft_update.c sort.c
CLEANFILES = test?.MY? FT?.MY? isam.log mi_test_all
......
......@@ -16,8 +16,7 @@
/* Descript, check and repair of ISAM tables */
#include "myisamdef.h"
#include "fulltext.h"
#include <m_ctype.h>
#include <stdarg.h>
#include <getopt.h>
......
......@@ -147,3 +147,26 @@ void _mi_print_key(FILE *stream, register MI_KEYSEG *keyseg,
VOID(fputs("\"\n",stream));
return;
} /* print_key */
#ifdef EXTRA_DEBUG
my_bool check_table_is_closed(const char *name, const char *where)
{
char filename[FN_REFLEN];
LIST *pos;
(void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32);
for (pos=myisam_open_list ; pos ; pos=pos->next)
{
MI_INFO *info=(MI_INFO*) pos->data;
MYISAM_SHARE *share=info->s;
if (!strcmp(share->filename,filename))
{
fprintf(stderr,"Warning: Table: %s is open on %s\n", name,where);
return 1;
}
}
return 0;
}
#endif /* EXTRA_DEBUG */
......@@ -28,7 +28,7 @@
int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key,
uint key_len, enum ha_rkey_function search_flag)
{
uchar *key_buff;
byte *key_buff;
uint pack_key_length;
MYRG_TABLE *table;
MI_INFO *mi;
......@@ -45,7 +45,7 @@ int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key,
if (table == info->open_tables)
{
err=mi_rkey(mi,buf,inx,key,key_len,search_flag);
key_buff=mi->lastkey+mi->s->base.max_key_length;
key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length;
pack_key_length=mi->last_rkey_length;
}
else
......
......@@ -24,7 +24,7 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
{
MYRG_TABLE *table;
MI_INFO *mi;
uchar *key_buff;
byte *key_buff;
uint pack_key_length;
int err;
......@@ -50,7 +50,7 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
if (table < info->end_table)
{
mi=info->last_used_table->table;
key_buff=mi->lastkey+mi->s->base.max_key_length;
key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length;
pack_key_length=mi->last_rkey_length;
for (; table < info->end_table ; table++)
{
......
......@@ -24,7 +24,7 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
{
MYRG_TABLE *table;
MI_INFO *mi;
uchar *key_buff;
byte *key_buff;
uint pack_key_length;
int err;
......@@ -50,12 +50,13 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
if (table < info->end_table)
{
mi=info->last_used_table->table;
key_buff=mi->lastkey+mi->s->base.max_key_length;
key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length;
pack_key_length=mi->last_rkey_length;
for (; table < info->end_table ; table++)
{
mi=table->table;
err=_mi_rkey(mi,NULL,inx,key_buff,pack_key_length,HA_READ_KEY_OR_PREV,FALSE);
err=_mi_rkey(mi,NULL,inx,key_buff,pack_key_length,
HA_READ_KEY_OR_PREV,FALSE);
info->last_used_table=table;
if (err == HA_ERR_KEY_NOT_FOUND)
......
......@@ -232,7 +232,7 @@ static int mc_sock_connect(my_socket s, const struct sockaddr *name,
return connect(s, (struct sockaddr*) name, namelen);
#else
int flags, res, s_err;
socklen_t s_err_size = sizeof(uint);
size_socket s_err_size = sizeof(uint);
fd_set sfds;
struct timeval tv;
......
......@@ -2460,11 +2460,15 @@ static void usage(void)
--log-isam[=file] Log all isam changes to file\n\
--log-long-format Log some extra information to update log\n\
--low-priority-updates INSERT/DELETE/UPDATE has lower priority than selects\n\
--log-slow-queries=[file]\n\
Log slow queries to this log file\n\
--pid-file=path Pid file used by safe_mysqld\n\
-P, --port=... Port number to use for connection\n\
-n, --new Use very new possible 'unsafe' functions\n\
-o, --old-protocol Use the old (3.20) protocol\n\
--one-thread Only use one thread (for debugging under Linux)\n\
--one-thread Only use one thread (for debugging under Linux)\n");
/* We have to break the string here because of VC++ limits */
puts("\
-O, --set-variable var=option\n\
Give a variable an value. --help lists variables\n\
-Sg, --skip-grant-tables\n\
......
......@@ -1137,16 +1137,21 @@ mysql_execute_command(void)
goto error;
for (table=tables ; table ; table=table->next->next)
{
if (check_access(thd, ALTER_ACL, table->db, &table->grant.privilege) ||
if (check_access(thd, ALTER_ACL | DROP_ACL, table->db,
&table->grant.privilege) ||
check_access(thd, INSERT_ACL | CREATE_ACL, table->next->db,
&table->next->grant.privilege))
goto error;
if (grant_option)
{
if (check_grant(thd,ALTER_ACL,table) ||
TABLE_LIST old_list,new_list;
old_list=table[0];
new_list=table->next[0];
old_list.next=new_list.next=0;
if (check_grant(thd,ALTER_ACL,&old_list) ||
(!test_all_bits(table->next->grant.privilege,
INSERT_ACL | CREATE_ACL) &&
check_grant(thd,INSERT_ACL | CREATE_ACL, table->next)))
check_grant(thd,INSERT_ACL | CREATE_ACL, &new_list)))
goto error;
}
}
......
......@@ -40,9 +40,9 @@ $columns_cols="Host, Db, User, Table_name, Column_name, Column_priv";
# clear grant tables
#
$dbh = DBI->connect("DBI:mysql:mysql:$opt_host;mysql_read_default_group=perl",
$dbh = DBI->connect("DBI:mysql:mysql:$opt_host",
$opt_root_user,$opt_password,
{ PrintError => 0}) || die "Can't connect to mysql server: $DBI::errstr\n";
{ PrintError => 0}) || die "Can't connect to mysql server with user '$opt_root_user': $DBI::errstr\n";
safe_query("delete from user where user='$opt_user' or user='${opt_user}2'");
safe_query("delete from db where user='$opt_user'");
......@@ -171,8 +171,7 @@ user_query("create table $opt_database.test2 (a int not null)");
user_query("alter table $opt_database.test2 add b int");
user_query("create index dummy on $opt_database.test2 (a)");
user_query("drop table $opt_database.test2");
user_query("show tables");
user_query("show tables from grant_test");
# These should fail
user_query("insert into mysql.user (host,user) values ('error','$opt_user',0)",1);
......@@ -242,7 +241,22 @@ user_query("grant select on $opt_database.test2 to $user with grant option",1);
safe_query("grant drop on $opt_database.test2 to $user with grant option");
user_query("grant drop on $opt_database.test2 to $user with grant option");
user_query("grant select on $opt_database.test2 to $user with grant option",1);
user_query("drop table $opt_database.test2");
# check rename privileges
user_query("rename table $opt_database.test2 to $opt_database.test3",1);
safe_query("grant CREATE,DROP on $opt_database.test3 to $user");
user_query("rename table $opt_database.test2 to $opt_database.test3",1);
user_query("create table $opt_database.test3 (a int)");
safe_query("grant INSERT on $opt_database.test3 to $user");
user_query("drop table $opt_database.test3");
user_query("rename table $opt_database.test2 to $opt_database.test3");
user_query("rename table $opt_database.test3 to $opt_database.test2",1);
safe_query("grant ALTER on $opt_database.test3 to $user");
user_query("rename table $opt_database.test3 to $opt_database.test2");
safe_query("revoke DROP on $opt_database.test2 from $user");
user_query("rename table $opt_database.test2 to $opt_database.test3");
user_query("drop table if exists $opt_database.test2,$opt_database.test3",1);
safe_query("drop table if exists $opt_database.test2,$opt_database.test3");
# Check that the user doesn't have some user privileges
user_query("create database $opt_database",1);
......@@ -253,9 +267,9 @@ safe_query("flush privileges");
safe_query("select $tables_cols from mysql.tables_priv");
safe_query("revoke ALL PRIVILEGES on $opt_database.test from $user");
safe_query("revoke ALL PRIVILEGES on $opt_database.test2 from $user");
safe_query("revoke ALL PRIVILEGES on $opt_database.test3 from $user");
safe_query("revoke GRANT OPTION on $opt_database.test2 from $user");
safe_query("select $tables_cols from mysql.tables_priv");
user_query("select count(a) from test",1);
#
......@@ -435,7 +449,8 @@ sub print_info
my $tmp;
print <<EOF;
This test will clear your table and column grant table and recreate the
$opt_database database ! All privileges for $user will be destroyed !
$opt_database database !
All privileges for $user will be destroyed !
Don\'t run this test if you have done any GRANT commands that you want to keep!
EOF
......
......@@ -119,7 +119,7 @@ Error in execute: Access denied for user: 'grant_user@localhost' to database 'gr
drop table grant_test.test
Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
grant ALL PRIVILEGES on grant_test.* to grant_user2@localhost
Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
grant ALL PRIVILEGES on grant_test.* to grant_user@localhost WITH GRANT OPTION
Connecting grant_user
insert into grant_test.test values (5,0)
......@@ -145,7 +145,9 @@ create table grant_test.test2 (a int not null)
alter table grant_test.test2 add b int
create index dummy on grant_test.test2 (a)
drop table grant_test.test2
show tables
show tables from grant_test
test
insert into mysql.user (host,user) values ('error','grant_user',0)
Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost
......@@ -239,7 +241,24 @@ grant drop on grant_test.test2 to grant_user@localhost with grant option
grant drop on grant_test.test2 to grant_user@localhost with grant option
grant select on grant_test.test2 to grant_user@localhost with grant option
Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
drop table grant_test.test2
rename table grant_test.test2 to grant_test.test3
Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test3'
grant CREATE,DROP on grant_test.test3 to grant_user@localhost
rename table grant_test.test2 to grant_test.test3
Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test3'
create table grant_test.test3 (a int)
grant INSERT on grant_test.test3 to grant_user@localhost
drop table grant_test.test3
rename table grant_test.test2 to grant_test.test3
rename table grant_test.test3 to grant_test.test2
Error in execute: alter command denied to user: 'grant_user@localhost' for table 'test3'
grant ALTER on grant_test.test3 to grant_user@localhost
rename table grant_test.test3 to grant_test.test2
revoke DROP on grant_test.test2 from grant_user@localhost
rename table grant_test.test2 to grant_test.test3
drop table if exists grant_test.test2,grant_test.test3
Error in execute: drop command denied to user: 'grant_user@localhost' for table 'test2'
drop table if exists grant_test.test2,grant_test.test3
create database grant_test
Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
drop database grant_test
......@@ -248,15 +267,15 @@ flush tables
Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
flush privileges
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 grant_user@localhost Update,Delete,Create,Drop,Grant,Index,Alter Insert
localhost grant_test grant_user test2 root@localhost Update,Delete,Create,Grant,Index,Alter Insert
localhost grant_test grant_user test root@localhost Select,Insert,Update,Delete
localhost grant_test grant_user test3 root@localhost Insert,Create,Drop,Alter
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
revoke ALL PRIVILEGES on grant_test.test2 from grant_user@localhost
revoke ALL PRIVILEGES on grant_test.test3 from grant_user@localhost
revoke GRANT OPTION on grant_test.test2 from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
select count(a) from test
Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
delete from grant_test.test where a=2
......@@ -284,13 +303,10 @@ select a,A from test
7 7
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
localhost grant_test grant_user test root@localhost Delete Select,Update
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
revoke GRANT OPTION on grant_test.test from grant_user@localhost
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
grant select(a) on grant_test.test to grant_user@localhost
......@@ -328,7 +344,6 @@ Error in execute: select command denied to user: 'grant_user@localhost' for colu
update test set b=3 where b > 0
Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
localhost grant_test grant_user test root@localhost Select,Insert,Update
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
......@@ -337,7 +352,6 @@ localhost grant_test grant_user test a Select
revoke select(a), update (b) on grant_test.test from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
localhost grant_test grant_user test root@localhost Insert
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
......@@ -355,7 +369,6 @@ insert into test (b) values (9)
update test set b=6 where b > 0
flush privileges
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
localhost grant_test grant_user test root@localhost Select,Insert,Update
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
......@@ -402,7 +415,6 @@ select * from mysql.db where user = 'grant_user'
localhost grant_test grant_user N Y N N N N N N N N
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
localhost grant_test grant_user test root@localhost Select,Insert,Update
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
......@@ -418,8 +430,6 @@ select * from mysql.db where user = 'grant_user'
localhost grant_test grant_user N Y N N N N N N N N
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
localhost grant_test grant_user test2 root@localhost Grant,Index,Alter
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
delete from user where user='grant_user'
flush privileges
......
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