Commit 3fb79dac authored by unknown's avatar unknown

Merge pgalbraith@bk-internal.mysql.com:/home/bk/mysql-5.0

into krsna.patg.net:/home/patg/mysql-5.0

parents bc430174 29f460f2
#!/usr/bin/perl
#
# By Matt Wagner <matt@mysql.com> 2005
#
# This script generates HP Depot packages for MySQL Server.
# It basically repackages a binary tarball as a depot.
#
# Usage: ./Do-hpux-depot <untarred-binary-tarball>
#
$fullname = shift @ARGV;
$fullname or die "No package name was specified";
-d $fullname or die "That directory is not present!";
$fullname =~ s,/+$,,; # Remove ending slash if any
chomp($pwd= `pwd`);
%title= (
"mysql-standard" => "MySQL Community Edition - Standard (GPL)",
"mysql-debug" => "MySQL Community Edition - Debug (GPL)",
"mysql-max" => "MySQL Community Edition - Experimental (GPL)",
"mysql-pro" => "MySQL Pro (Commercial)",
"mysql-classic" => "MySQL Classic (Commercial)",
"mysql-cluster" => "MySQL Cluster (Commercial)",
);
%architecture= (
"hpux11.23" => "HP-UX_B.11.23",
"hpux11.11" => "HP-UX_B.11.11",
"hpux11.00" => "HP-UX_B.11.00",
);
%os_release= (
"hpux11.23" => "?.11.2?",
"hpux11.11" => "?.11.1?",
"hpux11.00" => "?.11.0?",
);
%machine_type= (
"ia64" => "ia64*",
"hppa2.0w" => "9000/*",
);
$fullname =~ m/^(mysql-\w+)-([\d\.]+)-hp-(hpux11\.\d\d)-(hppa2\.0w|(ia64))-?(64bit)?$/;
# print "title: $1\n";
# print "version: $2\n";
# print "os: $3\n";
# print "cpu: $4\n";
# print "64: $6\n";
$cpu64= ($6 ne "") ? "_64" : "";
open (PSF,">${fullname}.psf") or die "Unable to write PSF file ($!)\n";
print PSF <<EOF;
product
tag $1
vendor_tag "MySQL_AB"
title "$title{$1}"
description "MySQL Database Server and Clients"
revision $2
architecture $architecture{$3}$cpu64
machine_type $machine_type{$4}
os_name HP-UX
os_release $os_release{$3}
directory /usr/local
fileset
tag all
revision $2
directory $fullname=/usr/local/$fullname
file_permissions -u 222 -g bin -o bin
file *
end
end
EOF
close(PSF);
system("/usr/sbin/swpackage -v -d \"|gzip -c > $fullname.depot.gz\" -x target_type=tape -s ${pwd}/${fullname}.psf");
...@@ -360,6 +360,10 @@ sub main () { ...@@ -360,6 +360,10 @@ sub main () {
if ( $opt_start_and_exit ) if ( $opt_start_and_exit )
{ {
if ( ndbcluster_start() )
{
mtr_error("Can't start ndbcluster");
}
if ( mysqld_start('master',0,[],[]) ) if ( mysqld_start('master',0,[],[]) )
{ {
mtr_report("Servers started, exiting"); mtr_report("Servers started, exiting");
...@@ -1055,7 +1059,7 @@ sub ndbcluster_start () { ...@@ -1055,7 +1059,7 @@ sub ndbcluster_start () {
"--data-dir=$glob_mysql_test_dir/var"], "--data-dir=$glob_mysql_test_dir/var"],
"", "/dev/null", "", "") ) "", "/dev/null", "", "") )
{ {
mtr_error("Error ndbcluster_install"); mtr_error("Error ndbcluster_start");
return 1; return 1;
} }
......
...@@ -1718,9 +1718,6 @@ Innodb_rows_deleted 2070 ...@@ -1718,9 +1718,6 @@ Innodb_rows_deleted 2070
show status like "Innodb_rows_inserted"; show status like "Innodb_rows_inserted";
Variable_name Value Variable_name Value
Innodb_rows_inserted 31708 Innodb_rows_inserted 31708
show status like "Innodb_rows_read";
Variable_name Value
Innodb_rows_read 80162
show status like "Innodb_rows_updated"; show status like "Innodb_rows_updated";
Variable_name Value Variable_name Value
Innodb_rows_updated 29530 Innodb_rows_updated 29530
......
...@@ -2674,7 +2674,6 @@ Warning 1265 Data truncated for column 'c4' at row 1 ...@@ -2674,7 +2674,6 @@ Warning 1265 Data truncated for column 'c4' at row 1
Warning 1265 Data truncated for column 'c5' at row 1 Warning 1265 Data truncated for column 'c5' at row 1
Warning 1265 Data truncated for column 'c6' at row 1 Warning 1265 Data truncated for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ; execute my_select ;
c1 1 c1 1
...@@ -2725,7 +2724,6 @@ Warning 1265 Data truncated for column 'c4' at row 1 ...@@ -2725,7 +2724,6 @@ Warning 1265 Data truncated for column 'c4' at row 1
Warning 1265 Data truncated for column 'c5' at row 1 Warning 1265 Data truncated for column 'c5' at row 1
Warning 1265 Data truncated for column 'c6' at row 1 Warning 1265 Data truncated for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ; execute my_select ;
c1 -1 c1 -1
......
This diff is collapsed.
...@@ -2401,3 +2401,25 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -2401,3 +2401,25 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 1 SIMPLE t1 ALL NULL NULL NULL NULL 5
1 SIMPLE t2 ref a a 23 test.t1.a 2 1 SIMPLE t2 ref a a 23 test.t1.a 2
DROP TABLE t1, t2; DROP TABLE t1, t2;
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
INSERT INTO t1 VALUES ('Paris');
SELECT * FROM t1 WHERE city='London';
city
London
SELECT * FROM t1 WHERE city='london';
city
London
EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
SELECT * FROM t1 WHERE city='London' AND city='london';
city
London
EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
city
London
DROP TABLE t1;
...@@ -1221,7 +1221,6 @@ show status like "Innodb_buffer_pool_pages_total"; ...@@ -1221,7 +1221,6 @@ show status like "Innodb_buffer_pool_pages_total";
show status like "Innodb_page_size"; show status like "Innodb_page_size";
show status like "Innodb_rows_deleted"; show status like "Innodb_rows_deleted";
show status like "Innodb_rows_inserted"; show status like "Innodb_rows_inserted";
show status like "Innodb_rows_read";
show status like "Innodb_rows_updated"; show status like "Innodb_rows_updated";
# Test for row locks InnoDB status variables. # Test for row locks InnoDB status variables.
......
...@@ -1985,3 +1985,22 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; ...@@ -1985,3 +1985,22 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
DROP TABLE t1, t2; DROP TABLE t1, t2;
#
# Test case for bug 7098: substitution of a constant for a string field
#
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
INSERT INTO t1 VALUES ('Paris');
SELECT * FROM t1 WHERE city='London';
SELECT * FROM t1 WHERE city='london';
EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london';
SELECT * FROM t1 WHERE city='London' AND city='london';
EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
DROP TABLE t1;
...@@ -531,6 +531,12 @@ extern "C" { ...@@ -531,6 +531,12 @@ extern "C" {
int ndb_mgm_set_connectstring(NdbMgmHandle handle, int ndb_mgm_set_connectstring(NdbMgmHandle handle,
const char *connect_string); const char *connect_string);
int ndb_mgm_set_configuration_nodeid(NdbMgmHandle handle, int nodeid);
int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle);
int ndb_mgm_get_connected_port(NdbMgmHandle handle);
const char *ndb_mgm_get_connected_host(NdbMgmHandle handle);
const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz);
/** /**
* Gets the connectstring used for a connection * Gets the connectstring used for a connection
* *
......
...@@ -55,6 +55,8 @@ public: ...@@ -55,6 +55,8 @@ public:
*/ */
Uint32 allocNodeId(int no_retries, int retry_delay_in_seconds); Uint32 allocNodeId(int no_retries, int retry_delay_in_seconds);
int setNodeId(Uint32 nodeid);
/** /**
* Get config using socket * Get config using socket
*/ */
......
...@@ -316,6 +316,12 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32 ...@@ -316,6 +316,12 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32
return true; return true;
} }
int
ConfigRetriever::setNodeId(Uint32 nodeid)
{
return ndb_mgm_set_configuration_nodeid(m_handle, nodeid);
}
Uint32 Uint32
ConfigRetriever::allocNodeId(int no_retries, int retry_delay_in_seconds) ConfigRetriever::allocNodeId(int no_retries, int retry_delay_in_seconds)
{ {
......
...@@ -141,6 +141,8 @@ Configuration::init(int argc, char** argv) ...@@ -141,6 +141,8 @@ Configuration::init(int argc, char** argv)
else else
_programName = strdup(""); _programName = strdup("");
globalData.ownId= 0;
return true; return true;
} }
...@@ -215,6 +217,13 @@ Configuration::fetch_configuration(){ ...@@ -215,6 +217,13 @@ Configuration::fetch_configuration(){
ConfigRetriever &cr= *m_config_retriever; ConfigRetriever &cr= *m_config_retriever;
/**
* if we have a nodeid set (e.g in a restart situation)
* reuse it
*/
if (globalData.ownId)
cr.setNodeId(globalData.ownId);
globalData.ownId = cr.allocNodeId(2 /*retry*/,3 /*delay*/); globalData.ownId = cr.allocNodeId(2 /*retry*/,3 /*delay*/);
if(globalData.ownId == 0){ if(globalData.ownId == 0){
......
...@@ -1727,6 +1727,15 @@ ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *cfg) ...@@ -1727,6 +1727,15 @@ ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *cfg)
} }
} }
extern "C"
int
ndb_mgm_set_configuration_nodeid(NdbMgmHandle handle, int nodeid)
{
CHECK_HANDLE(handle, -1);
handle->cfg._ownNodeId= nodeid;
return 0;
}
extern "C" extern "C"
int int
ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle) ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle)
......
...@@ -1069,16 +1069,19 @@ print_nodes(ndb_mgm_cluster_state *state, ndb_mgm_configuration_iterator *it, ...@@ -1069,16 +1069,19 @@ print_nodes(ndb_mgm_cluster_state *state, ndb_mgm_configuration_iterator *it,
} }
ndbout << ")" << endl; ndbout << ")" << endl;
} else { } else {
if(ndb_mgm_find(it, CFG_NODE_ID, node_id) != 0){ ndb_mgm_first(it);
if(ndb_mgm_find(it, CFG_NODE_ID, node_id) == 0){
const char *config_hostname= 0;
ndb_mgm_get_string_parameter(it, CFG_NODE_HOST, &config_hostname);
if (config_hostname == 0 || config_hostname[0] == 0)
config_hostname= "any host";
ndbout_c(" (not connected, accepting connect from %s)",
config_hostname);
}
else
{
ndbout_c("Unable to find node with id: %d", node_id); ndbout_c("Unable to find node with id: %d", node_id);
return;
} }
const char *config_hostname= 0;
ndb_mgm_get_string_parameter(it, CFG_NODE_HOST, &config_hostname);
if (config_hostname == 0 || config_hostname[0] == 0)
config_hostname= "any host";
ndbout << " (not connected, accepting connect from "
<< config_hostname << ")" << endl;
} }
} }
} }
......
...@@ -985,7 +985,7 @@ public: ...@@ -985,7 +985,7 @@ public:
Item *new_item() Item *new_item()
{ {
return new Item_string(name, str_value.ptr(), return new Item_string(name, str_value.ptr(),
str_value.length(), &my_charset_bin); str_value.length(), collation.collation);
} }
Item *safe_charset_converter(CHARSET_INFO *tocs); Item *safe_charset_converter(CHARSET_INFO *tocs);
String *const_string() { return &str_value; } String *const_string() { return &str_value; }
......
...@@ -921,7 +921,7 @@ void TEST_filesort(SORT_FIELD *sortorder,uint s_length); ...@@ -921,7 +921,7 @@ void TEST_filesort(SORT_FIELD *sortorder,uint s_length);
void print_plan(JOIN* join, double read_time, double record_count, void print_plan(JOIN* join, double read_time, double record_count,
uint idx, const char *info); uint idx, const char *info);
#endif #endif
void mysql_print_status(THD *thd); void mysql_print_status();
/* key.cc */ /* key.cc */
int find_ref_key(TABLE *form,Field *field, uint *offset); int find_ref_key(TABLE *form,Field *field, uint *offset);
void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length); void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length);
......
...@@ -2143,7 +2143,7 @@ extern "C" void *signal_hand(void *arg __attribute__((unused))) ...@@ -2143,7 +2143,7 @@ extern "C" void *signal_hand(void *arg __attribute__((unused)))
case SIGHUP: case SIGHUP:
if (!abort_loop) if (!abort_loop)
{ {
mysql_print_status((THD*) 0); // Print some debug info mysql_print_status(); // Print some debug info
reload_acl_and_cache((THD*) 0, reload_acl_and_cache((THD*) 0,
(REFRESH_LOG | REFRESH_TABLES | REFRESH_FAST | (REFRESH_LOG | REFRESH_TABLES | REFRESH_FAST |
REFRESH_GRANT | REFRESH_GRANT |
......
...@@ -1992,7 +1992,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1992,7 +1992,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
statistic_increment(thd->status_var.com_other, &LOCK_status); statistic_increment(thd->status_var.com_other, &LOCK_status);
if (check_global_access(thd, SUPER_ACL)) if (check_global_access(thd, SUPER_ACL))
break; /* purecov: inspected */ break; /* purecov: inspected */
mysql_print_status(thd); mysql_print_status();
mysql_log.write(thd,command,NullS); mysql_log.write(thd,command,NullS);
send_eof(thd); send_eof(thd);
break; break;
......
...@@ -436,29 +436,24 @@ reads: %10lu\n\n", ...@@ -436,29 +436,24 @@ reads: %10lu\n\n",
} }
void mysql_print_status(THD *thd) void mysql_print_status()
{ {
char current_dir[FN_REFLEN]; char current_dir[FN_REFLEN];
STATUS_VAR tmp;
calc_sum_of_all_status(&tmp);
printf("\nStatus information:\n\n"); printf("\nStatus information:\n\n");
my_getwd(current_dir, sizeof(current_dir),MYF(0)); my_getwd(current_dir, sizeof(current_dir),MYF(0));
printf("Current dir: %s\n", current_dir); printf("Current dir: %s\n", current_dir);
printf("Running threads: %d Stack size: %ld\n", thread_count, printf("Running threads: %d Stack size: %ld\n", thread_count,
(long) thread_stack); (long) thread_stack);
if (thd)
thd->proc_info="locks";
thr_print_locks(); // Write some debug info thr_print_locks(); // Write some debug info
#ifndef DBUG_OFF #ifndef DBUG_OFF
if (thd)
thd->proc_info="table cache";
print_cached_tables(); print_cached_tables();
#endif #endif
/* Print key cache status */ /* Print key cache status */
if (thd)
thd->proc_info="key cache";
puts("\nKey caches:"); puts("\nKey caches:");
process_key_caches(print_key_cache_status); process_key_caches(print_key_cache_status);
if (thd)
thd->proc_info="status";
pthread_mutex_lock(&LOCK_status); pthread_mutex_lock(&LOCK_status);
printf("\nhandler status:\n\ printf("\nhandler status:\n\
read_key: %10lu\n\ read_key: %10lu\n\
...@@ -468,20 +463,20 @@ read_first: %10lu\n\ ...@@ -468,20 +463,20 @@ read_first: %10lu\n\
write: %10lu\n\ write: %10lu\n\
delete %10lu\n\ delete %10lu\n\
update: %10lu\n", update: %10lu\n",
thd->status_var.ha_read_key_count, tmp.ha_read_key_count,
thd->status_var.ha_read_next_count, tmp.ha_read_next_count,
thd->status_var.ha_read_rnd_count, tmp.ha_read_rnd_count,
thd->status_var.ha_read_first_count, tmp.ha_read_first_count,
thd->status_var.ha_write_count, tmp.ha_write_count,
thd->status_var.ha_delete_count, tmp.ha_delete_count,
thd->status_var.ha_update_count); tmp.ha_update_count);
pthread_mutex_unlock(&LOCK_status); pthread_mutex_unlock(&LOCK_status);
printf("\nTable status:\n\ printf("\nTable status:\n\
Opened tables: %10lu\n\ Opened tables: %10lu\n\
Open tables: %10lu\n\ Open tables: %10lu\n\
Open files: %10lu\n\ Open files: %10lu\n\
Open streams: %10lu\n", Open streams: %10lu\n",
thd->status_var.opened_tables, tmp.opened_tables,
(ulong) cached_tables(), (ulong) cached_tables(),
(ulong) my_file_opened, (ulong) my_file_opened,
(ulong) my_stream_opened); (ulong) my_stream_opened);
...@@ -499,8 +494,6 @@ Next alarm time: %lu\n", ...@@ -499,8 +494,6 @@ Next alarm time: %lu\n",
#endif #endif
display_table_locks(); display_table_locks();
fflush(stdout); fflush(stdout);
if (thd)
thd->proc_info="malloc";
my_checkmalloc(); my_checkmalloc();
TERMINATE(stdout); // Write malloc information TERMINATE(stdout); // Write malloc information
...@@ -531,6 +524,4 @@ Estimated memory (with thread stack): %ld\n", ...@@ -531,6 +524,4 @@ Estimated memory (with thread stack): %ld\n",
(long) (thread_count * thread_stack + info.hblkhd + info.arena)); (long) (thread_count * thread_stack + info.hblkhd + info.arena));
#endif #endif
puts(""); puts("");
if (thd)
thd->proc_info=0;
} }
...@@ -39,17 +39,20 @@ ...@@ -39,17 +39,20 @@
# If you want to affect other MySQL variables, you should make your changes # If you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files. # in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
# If you change base dir, you must also change datadir
basedir= basedir=
datadir=
# The following variables are only set for letting mysql.server find things. # The following variables are only set for letting mysql.server find things.
# Set some defaults # Set some defaults
datadir=@localstatedir@
pid_file= pid_file=
if test -z "$basedir" if test -z "$basedir"
then then
basedir=@prefix@ basedir=@prefix@
bindir=@bindir@ bindir=@bindir@
datadir=@localstatedir@
else else
bindir="$basedir/bin" bindir="$basedir/bin"
fi fi
......
...@@ -277,7 +277,6 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ ...@@ -277,7 +277,6 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--includedir=%{_includedir} \ --includedir=%{_includedir} \
--mandir=%{_mandir} \ --mandir=%{_mandir} \
--enable-thread-safe-client \ --enable-thread-safe-client \
--with-comment=\"Official MySQL RPM\" \
--with-readline ; --with-readline ;
# Add this for more debugging support # Add this for more debugging support
# --with-debug # --with-debug
...@@ -335,6 +334,7 @@ BuildMySQL "--enable-shared \ ...@@ -335,6 +334,7 @@ BuildMySQL "--enable-shared \
--with-example-storage-engine \ --with-example-storage-engine \
--with-federated-storage-engine \ --with-federated-storage-engine \
--with-embedded-server \ --with-embedded-server \
--with-comment=\"MySQL Community Edition - Max (GPL)\" \
--with-server-suffix='-Max'" --with-server-suffix='-Max'"
# Save everything for debug # Save everything for debug
...@@ -381,6 +381,7 @@ BuildMySQL "--disable-shared \ ...@@ -381,6 +381,7 @@ BuildMySQL "--disable-shared \
--with-client-ldflags='-all-static' \ --with-client-ldflags='-all-static' \
$USE_OTHER_LIBC_DIR \ $USE_OTHER_LIBC_DIR \
%endif %endif
--with-comment=\"MySQL Community Edition - Standard (GPL)\" \
--with-server-suffix='%{server_suffix}' \ --with-server-suffix='%{server_suffix}' \
--without-embedded-server \ --without-embedded-server \
--without-berkeley-db \ --without-berkeley-db \
...@@ -689,7 +690,12 @@ fi ...@@ -689,7 +690,12 @@ fi
# itself - note that they must be ordered by date (important when # itself - note that they must be ordered by date (important when
# merging BK trees) # merging BK trees)
%changelog %changelog
* Monday Feb 7 2005 Tomas Ulin <tomas@mysql.com> * Mon Feb 14 2005 Lenz Grimmer <lenz@mysql.com>
* Fixed the compilation comments and moved them into the separate build sections
for Max and Standard
* Mon Feb 7 2005 Tomas Ulin <tomas@mysql.com>
- enabled the "Ndbcluster" storage engine for the max binary - enabled the "Ndbcluster" storage engine for the max binary
- added extra make install in ndb subdir after Max build to get ndb binaries - added extra make install in ndb subdir after Max build to get ndb binaries
......
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