Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1

into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-clean
This commit is contained in:
tomas@poseidon.ndb.mysql.com 2004-12-10 13:06:50 +01:00
commit 8c387cac37
51 changed files with 300 additions and 226 deletions

View file

@ -10,7 +10,7 @@ use Sys::Hostname;
$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env="";
$opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_suffix="";
$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_embedded_test=$opt_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0;
GetOptions(
@ -57,6 +57,8 @@ GetOptions(
"version-suffix=s",
"with-archive",
"with-cluster",
"with-csv",
"with-example",
"with-debug",
"with-low-memory",
"with-other-libc=s",
@ -279,6 +281,8 @@ if ($opt_stage <= 1)
$opt_embedded_test= 0 if ($opt_without_embedded);
$opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive);
$opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
$opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv);
$opt_config_options.= " --with-example-storage-engine" if ($opt_with_example);
# Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB)
@ -637,11 +641,17 @@ If user is empty then no mail is sent.
Set name suffix (e.g. 'com' or '-max') for a distribution
--with archive
Enable the Archive storage Engine
Enable the Archive storage engine
--with cluster
Compile and test with NDB Cluster enabled
--with-csv
Enable the CSV storage engine
--with-example
Enable the Example storage engine
--with-debug
Build binaries with debug information (implies "--no-strip")

View file

@ -1825,8 +1825,6 @@ static void dumpTable(uint numFields, char *table)
err:
if (query != query_buf)
my_free(query, MYF(MY_ALLOW_ZERO_PTR));
if (order_by)
my_free(order_by, MYF(0));
safe_exit(error);
return;
} /* dumpTable */
@ -1978,6 +1976,8 @@ static int dump_all_tables_in_db(char *database)
numrows = getTableStructure(table, database);
if (!dFlag && numrows > 0)
dumpTable(numrows,table);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
}
if (opt_xml)
{
@ -2027,6 +2027,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
numrows = getTableStructure(*table_names, db);
if (!dFlag && numrows > 0)
dumpTable(numrows, *table_names);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
}
if (opt_xml)
{

View file

@ -291,6 +291,7 @@ enum ha_base_keytype {
#define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */
#define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */
#define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */
#define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */
/* Other constants */

View file

@ -2364,6 +2364,8 @@ dict_scan_id(
ulint len = 0;
const char* s;
char* d;
ulint id_len;
byte* b;
*id = NULL;
@ -2425,6 +2427,28 @@ dict_scan_id(
*id = s;
}
if (heap) {
/* EMS MySQL Manager sometimes adds characters 0xA0 (in
latin1, a 'non-breakable space') to the end of a table name.
But isspace(0xA0) is not true, which confuses our foreign key
parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
and 0xA0 are at the end of the string.
TODO: we should lex the string using thd->charset_info, and
my_isspace(). Only after that, convert id names to UTF-8. */
b = (byte*)(*id);
id_len = strlen(b);
if (id_len >= 3 && b[id_len - 1] == 0xA0
&& b[id_len - 2] == 0xC2) {
/* Strip the 2 last bytes */
b[id_len - 2] = '\0';
}
}
return(ptr);
}
@ -2479,7 +2503,7 @@ dict_scan_col(
}
/*************************************************************************
Scans the referenced table name from an SQL string. */
Scans a table name from an SQL string. */
static
const char*
dict_scan_table_name(
@ -2490,7 +2514,7 @@ dict_scan_table_name(
const char* name, /* in: foreign key table name */
ibool* success,/* out: TRUE if ok name found */
mem_heap_t* heap, /* in: heap where to allocate the id */
const char** ref_name)/* out,own: the referenced table name;
const char** ref_name)/* out,own: the table name;
NULL if no name was scannable */
{
const char* database_name = NULL;

View file

@ -124,8 +124,8 @@ int mi_write(MI_INFO *info, byte *record)
{
if (local_lock_tree)
rw_unlock(&share->key_root_lock[i]);
DBUG_PRINT("error",("Got error: %d on write",my_errno));
goto err;
DBUG_PRINT("error",("Got error: %d on write",my_errno));
goto err;
}
}
if (local_lock_tree)
@ -159,7 +159,8 @@ int mi_write(MI_INFO *info, byte *record)
err:
save_errno=my_errno;
if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL)
if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL ||
my_errno == HA_ERR_NULL_IN_SPATIAL)
{
if (info->bulk_insert)
{

View file

@ -710,7 +710,8 @@ err1:
int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length)
{
return (rtree_insert_level(info, keynr, key, key_length, -1) == -1) ? -1 : 0;
return (!key_length ||
(rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? -1 : 0;
}

View file

@ -50,6 +50,11 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
dlen = _mi_calc_blob_length(keyseg->bit_start, pos);
memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*));
if (!dptr)
{
my_errno= HA_ERR_NULL_IN_SPATIAL;
return 0;
}
sp_mbr_from_wkb(dptr + 4, dlen - 4, SPDIMS, mbr); /* SRID */
for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++)

View file

@ -2375,3 +2375,14 @@ DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci;
insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c');
select a, a regexp '[a]' from t1 order by binary a;
a a regexp '[a]'
A 1
B 0
C 0
a 1
b 0
c 0
drop table t1;

View file

@ -685,3 +685,9 @@ drop table t1;
select left(1234, 3) + 0;
left(1234, 3) + 0
123
create table t1 (a int not null primary key, b varchar(40), c datetime);
insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now());
select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12;
total reg
10 2004-12-10
drop table t1;

View file

@ -798,3 +798,9 @@ INSERT INTO t1 (name, kind, line) VALUES
ALTER TABLE t1 ENABLE KEYS;
INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)'));
drop table t1;
CREATE TABLE t1 (st varchar(100));
INSERT INTO t1 VALUES ("Fake string");
CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
ERROR HY000: Unknown error
drop table t1, t2;

View file

@ -1,4 +1,4 @@
drop table if exists t1;
drop table if exists t1, t2;
create table t1 (ts timestamp);
set time_zone='+00:00';
select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp());
@ -256,18 +256,50 @@ delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
grant usage on mysqltest.* to mysqltest_1@localhost;
create table t1 (a int, b datetime);
create table t2 (c int, d datetime);
grant all privileges on test.* to mysqltest_1@localhost;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'localhost'
set time_zone= '+00:00';
set time_zone= 'Europe/Moscow';
select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC');
convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC')
2004-10-21 15:00:00
select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
convert_tz(b, 'Europe/Moscow', 'UTC')
update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC')
where t1.a = t2.c and t2.d = (select max(d) from t2);
select * from mysql.time_zone_name;
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name;
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
flush privileges;
grant all privileges on test.t1 to mysqltest_1@localhost;
grant all privileges on test.t2 to mysqltest_1@localhost;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.`t2` TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.`t1` TO 'mysqltest_1'@'localhost'
set time_zone= '+00:00';
set time_zone= 'Europe/Moscow';
select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC');
convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC')
2004-12-01 09:00:00
select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
convert_tz(b, 'Europe/Moscow', 'UTC')
update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC')
where t1.a = t2.c and t2.d = (select max(d) from t2);
select * from mysql.time_zone_name;
ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name;
ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
flush privileges;
drop table t1, t2;

View file

@ -444,3 +444,11 @@ DROP TABLE t1;
SET @test_character_set= 'utf8';
SET @test_collation= 'utf8_swedish_ci';
-- source include/ctype_common.inc
#
# Bug 7111 server crashes when regexp is used
#
create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci;
insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c');
select a, a regexp '[a]' from t1 order by binary a;
drop table t1;

View file

@ -421,3 +421,11 @@ drop table t1;
#
select left(1234, 3) + 0;
#
# Bug #7101: bug with LEFT() when used as a field in GROUP BY aggregation
#
create table t1 (a int not null primary key, b varchar(40), c datetime);
insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now());
select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12;
drop table t1;

View file

@ -165,3 +165,10 @@ INSERT INTO t1 (name, kind, line) VALUES
ALTER TABLE t1 ENABLE KEYS;
INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)'));
drop table t1;
CREATE TABLE t1 (st varchar(100));
INSERT INTO t1 VALUES ("Fake string");
CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
--error 1105
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
drop table t1, t2;

View file

@ -9,6 +9,7 @@ use test;
# create system tables as in mysql-3.20
--disable_warnings
CREATE TABLE db (
Host char(60) binary DEFAULT '' NOT NULL,
Db char(32) binary DEFAULT '' NOT NULL,
@ -23,10 +24,12 @@ CREATE TABLE db (
KEY User (User)
)
type=ISAM;
--enable-warnings
INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
--disable_warnings
CREATE TABLE host (
Host char(60) binary DEFAULT '' NOT NULL,
Db char(32) binary DEFAULT '' NOT NULL,
@ -39,7 +42,9 @@ CREATE TABLE host (
PRIMARY KEY Host (Host,Db)
)
type=ISAM;
--enable-warnings
--disable_warnings
CREATE TABLE user (
Host char(60) binary DEFAULT '' NOT NULL,
User char(16) binary DEFAULT '' NOT NULL,
@ -56,6 +61,7 @@ CREATE TABLE user (
PRIMARY KEY Host (Host,User)
)
type=ISAM;
--enable-warnings
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');

View file

@ -2,7 +2,7 @@
# Preparing playground
--disable_warnings
drop table if exists t1;
drop table if exists t1, t2;
--enable_warnings
@ -205,25 +205,64 @@ drop table t1;
# even for unprivileged users.
#
# Let us prepare playground
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
create table t1 (a int, b datetime);
create table t2 (c int, d datetime);
grant usage on mysqltest.* to mysqltest_1@localhost;
grant all privileges on test.* to mysqltest_1@localhost;
connect (tzuser, localhost, mysqltest_1,,);
connection tzuser;
show grants for current_user();
set time_zone= '+00:00';
set time_zone= 'Europe/Moscow';
select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC');
select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
# Let us also check whenever multi-update works ok
update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC')
where t1.a = t2.c and t2.d = (select max(d) from t2);
# But still these two statements should not work:
--error 1044
select * from mysql.time_zone_name;
--error 1044
select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name;
#
# Test for bug #6765 "Implicit access to time zone description tables
# requires privileges for them if some table or column level grants
# present"
#
connection default;
# Let use some table-level grants instead of db-level
# to make life more interesting
delete from mysql.db where user like 'mysqltest\_%';
flush privileges;
grant all privileges on test.t1 to mysqltest_1@localhost;
grant all privileges on test.t2 to mysqltest_1@localhost;
# The test itself is almost the same as previous one
connect (tzuser2, localhost, mysqltest_1,,);
connection tzuser2;
show grants for current_user();
set time_zone= '+00:00';
set time_zone= 'Europe/Moscow';
select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC');
select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC')
where t1.a = t2.c and t2.d = (select max(d) from t2);
# Again these two statements should not work (but with different errors):
--error 1142
select * from mysql.time_zone_name;
--error 1142
select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name;
# Clean-up
connection default;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
flush privileges;
drop table t1, t2;

View file

@ -1272,10 +1272,6 @@ Backup::createAttributeMask(TablePtr tabPtr,
jam();
AttributePtr attr;
table.attributes.getPtr(attr, i);
if(attr.p->data.key != 0){
jam();
continue;
}
mask.set(i);
}
}
@ -2961,12 +2957,9 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len)
tabPtr.p->schemaVersion = tmpTab.TableVersion;
tabPtr.p->noOfAttributes = tmpTab.NoOfAttributes;
tabPtr.p->noOfKeys = tmpTab.NoOfKeyAttr;
tabPtr.p->noOfNull = 0;
tabPtr.p->noOfVariable = 0; // Computed while iterating over attribs
tabPtr.p->sz_FixedKeys = 0; // Computed while iterating over attribs
tabPtr.p->sz_FixedAttributes = 0; // Computed while iterating over attribs
tabPtr.p->variableKeyId = RNIL; // Computed while iterating over attribs
tabPtr.p->triggerIds[0] = ILLEGAL_TRIGGER_ID;
tabPtr.p->triggerIds[1] = ILLEGAL_TRIGGER_ID;
tabPtr.p->triggerIds[2] = ILLEGAL_TRIGGER_ID;
@ -3001,7 +2994,6 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len)
attrPtr.p->data.nullable = tmp.AttributeNullableFlag;
attrPtr.p->data.fixed = (tmp.AttributeArraySize != 0);
attrPtr.p->data.key = tmp.AttributeKeyFlag;
attrPtr.p->data.sz32 = sz32;
/**
@ -3009,50 +3001,26 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len)
* 1) Fixed
* 2) Nullable
* 3) Variable
* 4) Fixed key
* 5) Variable key
*/
if(attrPtr.p->data.key == false) {
if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == false) {
jam();
if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == false) {
jam();
attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes;
tabPtr.p->sz_FixedAttributes += sz32;
}//if
if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == true) {
jam();
attrPtr.p->data.offset = 0;
attrPtr.p->data.offsetNull = tabPtr.p->noOfNull;
tabPtr.p->noOfNull++;
tabPtr.p->noOfVariable++;
}//if
if(attrPtr.p->data.fixed == false) {
jam();
tabPtr.p->noOfVariable++;
ndbrequire(0);
}//if
} else if(attrPtr.p->data.key == true) {
attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes;
tabPtr.p->sz_FixedAttributes += sz32;
}//if
if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == true) {
jam();
ndbrequire(attrPtr.p->data.nullable == false);
attrPtr.p->data.offset = 0;
if(attrPtr.p->data.fixed == true) { // Fixed key
jam();
tabPtr.p->sz_FixedKeys += sz32;
}//if
if(attrPtr.p->data.fixed == false) { // Variable key
jam();
attrPtr.p->data.offset = 0;
tabPtr.p->noOfVariable++;
ndbrequire(tabPtr.p->variableKeyId == RNIL); // Only one variable key
tabPtr.p->variableKeyId = attrPtr.i;
ndbrequire(0);
}//if
attrPtr.p->data.offsetNull = tabPtr.p->noOfNull;
tabPtr.p->noOfNull++;
tabPtr.p->noOfVariable++;
}//if
if(attrPtr.p->data.fixed == false) {
jam();
tabPtr.p->noOfVariable++;
ndbrequire(0);
}//if
it.next(); // Move Past EndOfAttribute
@ -3362,7 +3330,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
Table & table = * tabPtr.p;
ScanFragReq * req = (ScanFragReq *)signal->getDataPtrSend();
const Uint32 parallelism = 16;
const Uint32 attrLen = 5 + table.noOfAttributes - table.noOfKeys;
const Uint32 attrLen = 5 + table.noOfAttributes;
req->senderData = filePtr.i;
req->resultRef = reference();
@ -3373,7 +3341,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
req->tableId = table.tableId;
ScanFragReq::setLockMode(req->requestInfo, 0);
ScanFragReq::setHoldLockFlag(req->requestInfo, 0);
ScanFragReq::setKeyinfoFlag(req->requestInfo, 1);
ScanFragReq::setKeyinfoFlag(req->requestInfo, 0);
ScanFragReq::setAttrLen(req->requestInfo,attrLen);
req->transId1 = 0;
req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8);
@ -3388,7 +3356,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
signal->theData[2] = (BACKUP << 20) + (getOwnNodeId() << 8);
// Return all
signal->theData[3] = table.noOfAttributes - table.noOfKeys;
signal->theData[3] = table.noOfAttributes;
signal->theData[4] = 0;
signal->theData[5] = 0;
signal->theData[6] = 0;
@ -3400,10 +3368,6 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
jam();
AttributePtr attr;
table.attributes.getPtr(attr, i);
if(attr.p->data.key != 0) {
jam();
continue;
}//if
AttributeHeader::init(&signal->theData[dataPos], i, 0);
dataPos++;
@ -3513,64 +3477,19 @@ Backup::execTRANSID_AI(Signal* signal)
}
}
void
Backup::execKEYINFO20(Signal* signal)
{
jamEntry();
const Uint32 filePtrI = signal->theData[0];
const Uint32 keyLen = signal->theData[1];
//const Uint32 scanInfo = signal->theData[2];
//const Uint32 transId1 = signal->theData[3];
//const Uint32 transId2 = signal->theData[4];
const Uint32 dataLen = signal->length() - 5;
BackupFilePtr filePtr;
c_backupFilePool.getPtr(filePtr, filePtrI);
OperationRecord & op = filePtr.p->operation;
/**
* Unpack data
*/
ndbrequire(keyLen == dataLen);
const Uint32 * src = &signal->theData[5];
const Uint32 klFixed = op.getFixedKeySize();
ndbrequire(keyLen >= klFixed);
Uint32 * dst = op.newKey();
memcpy(dst, src, klFixed << 2);
const Uint32 szLeft = (keyLen - klFixed);
if(szLeft > 0) {
jam();
src += klFixed;
dst = op.newVariableKey(szLeft);
memcpy(dst, src, (szLeft << 2));
ndbrequire(0);
}//if
if(op.finished()){
jam();
op.newRecord(op.dst);
}
}
void
Backup::OperationRecord::init(const TablePtr & ptr)
{
tablePtr = ptr.i;
noOfAttributes = (ptr.p->noOfAttributes - ptr.p->noOfKeys) + 1;
variableKeyId = ptr.p->variableKeyId;
noOfAttributes = ptr.p->noOfAttributes;
sz_Bitmask = (ptr.p->noOfNull + 31) >> 5;
sz_FixedKeys = ptr.p->sz_FixedKeys;
sz_FixedAttribs = ptr.p->sz_FixedAttributes;
if(ptr.p->noOfVariable == 0) {
jam();
maxRecordSize = 1 + sz_Bitmask + sz_FixedKeys + sz_FixedAttribs;
maxRecordSize = 1 + sz_Bitmask + sz_FixedAttribs;
} else {
jam();
maxRecordSize =

View file

@ -76,7 +76,6 @@ protected:
*/
void execSCAN_HBREP(Signal* signal);
void execTRANSID_AI(Signal* signal);
void execKEYINFO20(Signal* signal);
void execSCAN_FRAGREF(Signal* signal);
void execSCAN_FRAGCONF(Signal* signal);
@ -172,8 +171,8 @@ public:
struct Data {
Uint8 nullable;
Uint8 fixed;
Uint8 key;
Uint8 unused;
Uint8 unused;
Uint8 unused2;
Uint32 sz32; // No of 32 bit words
Uint32 offset; // Relative DataFixedAttributes/DataFixedKeys
Uint32 offsetNull; // In NullBitmask
@ -199,12 +198,9 @@ public:
Uint32 frag_mask;
Uint32 tableType;
Uint32 noOfNull;
Uint32 noOfKeys;
Uint32 noOfAttributes;
Uint32 noOfVariable;
Uint32 sz_FixedKeys;
Uint32 sz_FixedAttributes;
Uint32 variableKeyId;
Uint32 triggerIds[3];
bool triggerAllocated[3];
@ -224,7 +220,6 @@ public:
* Once per table
*/
void init(const TablePtr & ptr);
inline Uint32 getFixedKeySize() const { return sz_FixedKeys; }
/**
* Once per fragment
@ -247,23 +242,19 @@ public:
/**
* Per attribute
*/
Uint32 * newKey();
void nullAttribute(Uint32 nullOffset);
Uint32 * newNullable(Uint32 attrId, Uint32 sz);
Uint32 * newAttrib(Uint32 offset, Uint32 sz);
Uint32 * newVariable(Uint32 id, Uint32 sz);
Uint32 * newVariableKey(Uint32 sz);
private:
Uint32* base;
Uint32* dst_Length;
Uint32* dst_Bitmask;
Uint32* dst_FixedKeys;
Uint32* dst_FixedAttribs;
BackupFormat::DataFile::VariableData* dst_VariableData;
Uint32 noOfAttributes; // No of Attributes
Uint32 variableKeyId; // Id of variable key
Uint32 attrLeft; // No of attributes left
Uint32 opNoDone;
@ -289,7 +280,6 @@ public:
* sizes of part
*/
Uint32 sz_Bitmask;
Uint32 sz_FixedKeys;
Uint32 sz_FixedAttribs;
public:
@ -629,7 +619,6 @@ Backup::OperationRecord::newRecord(Uint32 * p){
base = p;
dst_Length = p; p += 1;
dst_Bitmask = p; p += sz_Bitmask;
dst_FixedKeys = p; p += sz_FixedKeys;
dst_FixedAttribs = p; p += sz_FixedAttribs;
dst_VariableData = (BackupFormat::DataFile::VariableData*)p;
BitmaskImpl::clear(sz_Bitmask, dst_Bitmask);
@ -646,14 +635,6 @@ Backup::OperationRecord::newAttrib(Uint32 offset, Uint32 sz){
return dst;
}
inline
Uint32 *
Backup::OperationRecord::newKey(){
attrLeft --;
attrSzLeft = 0;
return dst_FixedKeys;
}
inline
void
Backup::OperationRecord::nullAttribute(Uint32 offsetNull){
@ -692,21 +673,6 @@ Backup::OperationRecord::newVariable(Uint32 id, Uint32 sz){
return dst;
}
inline
Uint32 *
Backup::OperationRecord::newVariableKey(Uint32 sz){
attrLeft--;
attrSzLeft = 0;
attrSzTotal += sz;
dst = &dst_VariableData->Data[0];
dst_VariableData->Sz = htonl(sz);
dst_VariableData->Id = htonl(variableKeyId);
dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz);
return dst;
}
inline
bool
Backup::OperationRecord::finished(){
@ -714,7 +680,7 @@ Backup::OperationRecord::finished(){
return false;
}
opLen += attrSzTotal + sz_FixedKeys;
opLen += attrSzTotal;
opNoDone++;
scanStop = dst = (Uint32 *)dst_VariableData;

View file

@ -127,7 +127,6 @@ Backup::Backup(const Configuration & conf) :
addRecSignal(GSN_SCAN_HBREP, &Backup::execSCAN_HBREP);
addRecSignal(GSN_TRANSID_AI, &Backup::execTRANSID_AI);
addRecSignal(GSN_KEYINFO20, &Backup::execKEYINFO20);
addRecSignal(GSN_SCAN_FRAGREF, &Backup::execSCAN_FRAGREF);
addRecSignal(GSN_SCAN_FRAGCONF, &Backup::execSCAN_FRAGCONF);

View file

@ -24,10 +24,12 @@
Ndb_local_table_info *
Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz)
{
void *data= malloc(sizeof(NdbTableImpl)+sz-1);
if (sz % 8 != 0) // round to Uint64
sz += 8 - sz % 8;
void *data= malloc(sizeof(NdbTableImpl)+sz-8);
if (data == 0)
return 0;
memset(data,0,sizeof(NdbTableImpl)+sz-1);
memset(data,0,sizeof(NdbTableImpl)+sz-8);
new (data) Ndb_local_table_info(table_impl);
return (Ndb_local_table_info *) data;
}

View file

@ -32,7 +32,7 @@ public:
static Ndb_local_table_info *create(NdbTableImpl *table_impl, Uint32 sz=0);
static void destroy(Ndb_local_table_info *);
NdbTableImpl *m_table_impl;
char m_local_data[1];
Uint64 m_local_data[1];
private:
Ndb_local_table_info(NdbTableImpl *table_impl);
~Ndb_local_table_info();

View file

@ -192,14 +192,15 @@ RestoreMetaData::readGCPEntry() {
return true;
}
TableS::TableS(NdbTableImpl* tableImpl)
TableS::TableS(Uint32 version, NdbTableImpl* tableImpl)
: m_dictTable(tableImpl)
{
m_dictTable = tableImpl;
m_noOfNullable = m_nullBitmaskSize = 0;
m_auto_val_id= ~(Uint32)0;
m_max_auto_val= 0;
backupVersion = version;
for (int i = 0; i < tableImpl->getNoOfColumns(); i++)
createAttr(tableImpl->getColumn(i));
}
@ -226,11 +227,10 @@ RestoreMetaData::parseTableDescriptor(const Uint32 * data, Uint32 len)
debug << "parseTableInfo " << tableImpl->getName() << " done" << endl;
TableS * table = new TableS(tableImpl);
TableS * table = new TableS(m_fileHeader.NdbVersion, tableImpl);
if(table == NULL) {
return false;
}
table->setBackupVersion(m_fileHeader.NdbVersion);
debug << "Parsed table id " << table->getTableId() << endl;
debug << "Parsed table #attr " << table->getNoOfAttributes() << endl;
@ -699,12 +699,12 @@ void TableS::createAttr(NdbDictionary::Column *column)
if (d->m_column->getAutoIncrement())
m_auto_val_id= d->attrId;
if(d->m_column->getPrimaryKey() /* && not variable */)
if(d->m_column->getPrimaryKey() && backupVersion <= MAKE_VERSION(4,1,7))
{
m_fixedKeys.push_back(d);
return;
}
if(!d->m_column->getNullable())
{
m_fixedAttribs.push_back(d);

View file

@ -140,7 +140,7 @@ class TableS {
public:
class NdbDictionary::Table* m_dictTable;
TableS (class NdbTableImpl* dictTable);
TableS (Uint32 version, class NdbTableImpl* dictTable);
~TableS();
Uint32 getTableId() const {

View file

@ -258,11 +258,18 @@ main(int argc, char** argv)
ndbout << "Failed to read " << metaData.getFilename() << endl << endl;
return -1;
}
const BackupFormat::FileHeader & tmp = metaData.getFileHeader();
const Uint32 version = tmp.NdbVersion;
ndbout << "Ndb version in backup files: "
<< getVersionString(version, 0) << endl;
/**
* check wheater we can restore the backup (right version).
*/
int res = metaData.loadContent();
if (res == 0)
{
ndbout_c("Restore: Failed to load content");

View file

@ -860,11 +860,28 @@ othercase(charset,ch)
CHARSET_INFO *charset;
int ch;
{
/*
In MySQL some multi-byte character sets
have 'ctype' array but don't have 'to_lower'
and 'to_upper' arrays. In this case we handle
only basic latin letters a..z and A..Z.
If 'to_lower' and 'to_upper' arrays are empty in a character set,
then my_isalpha(cs, ch) should never return TRUE for characters
other than basic latin letters. Otherwise it should be
considered as a mistake in character set definition.
*/
assert(my_isalpha(charset,ch));
if (my_isupper(charset,ch))
return(my_tolower(charset,ch));
{
return(charset->to_lower ? my_tolower(charset,ch) :
ch - 'A' + 'a');
}
else if (my_islower(charset,ch))
return(my_toupper(charset,ch));
{
return(charset->to_upper ? my_toupper(charset,ch) :
ch - 'a' + 'A');
}
else /* peculiar, but could happen */
return(ch);
}

View file

@ -14,6 +14,7 @@ port=""
socket=""
database="mysql"
bindir=""
print_defaults_bindir="."
file=mysql_fix_privilege_tables.sql
@ -57,7 +58,9 @@ parse_arguments() {
--port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
--socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
--database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;;
--bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` ;;
--bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"`
print_defaults_bindir=$bindir
;;
*)
if test -n "$pick_args"
then
@ -73,7 +76,8 @@ parse_arguments() {
# Get first arguments from the my.cfg file, groups [mysqld] and
# [mysql_install_db], and then merge with the command line arguments
for dir in ./bin @bindir@ @bindir@ extra $bindir/../bin $bindir/../extra
print_defaults=my_print_defaults
for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra
do
if test -x $dir/my_print_defaults
then

View file

@ -1083,6 +1083,9 @@ void handler::print_error(int error, myf errflag)
textno=ER_DUP_KEY;
break;
}
case HA_ERR_NULL_IN_SPATIAL:
textno= ER_UNKNOWN_ERROR;
DBUG_VOID_RETURN;
case HA_ERR_FOUND_DUPP_UNIQUE:
textno=ER_DUP_UNIQUE;
break;
@ -1196,7 +1199,8 @@ uint handler::get_dup_key(int error)
{
DBUG_ENTER("handler::get_dup_key");
table->file->errkey = (uint) -1;
if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE)
if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE ||
error == HA_ERR_NULL_IN_SPATIAL)
info(HA_STATUS_ERRKEY | HA_STATUS_NO_LOCK);
DBUG_RETURN(table->file->errkey);
}

View file

@ -24,7 +24,6 @@
#include "mysql_priv.h"
#ifdef HAVE_SPATIAL
#include "sql_acl.h"
#include <m_ctype.h>
void Item_geometry_func::fix_length_and_dec()

View file

@ -25,7 +25,6 @@
#endif
#include "mysql_priv.h"
#include "sql_acl.h"
#include <m_ctype.h>
#ifdef HAVE_OPENSSL
#include <openssl/des.h>
@ -955,8 +954,9 @@ String *Item_func_left::val_str(String *str)
if (res->length() <= (uint) length ||
res->length() <= (char_pos= res->charpos(length)))
return res;
str_value.set(*res, 0, char_pos);
return &str_value;
tmp_value.set(*res, 0, char_pos);
return &tmp_value;
}

View file

@ -162,6 +162,7 @@ public:
class Item_func_left :public Item_str_func
{
String tmp_value;
public:
Item_func_left(Item *a,Item *b) :Item_str_func(a,b) {}
String *val_str(String *);

View file

@ -23,7 +23,6 @@
#endif
#include "mysql_priv.h"
#include "sql_acl.h"
#include "sql_repl.h"
#include "ha_innodb.h" // necessary to cut the binlog when crash recovery

View file

@ -350,7 +350,6 @@ inline THD *_current_thd(void)
#include "sql_udf.h"
class user_var_entry;
#include "item.h"
#include "tztime.h"
typedef Comp_creator* (*chooser_compare_func_creator)(bool invert);
/* sql_parse.cc */
void free_items(Item *item);
@ -371,6 +370,8 @@ int create_table_precheck(THD *thd, TABLE_LIST *tables,
TABLE_LIST *create_table);
Item *negate_expression(THD *thd, Item *expr);
#include "sql_class.h"
#include "sql_acl.h"
#include "tztime.h"
#include "opt_range.h"
#ifdef HAVE_QUERY_CACHE

View file

@ -17,7 +17,6 @@
#include "mysql_priv.h"
#include <m_ctype.h>
#include <my_dir.h>
#include "sql_acl.h"
#include "slave.h"
#include "sql_repl.h"
#include "repl_failsafe.h"

View file

@ -20,7 +20,6 @@
#include "repl_failsafe.h"
#include "sql_repl.h"
#include "slave.h"
#include "sql_acl.h"
#include "log_event.h"
#include <mysql.h>

View file

@ -55,7 +55,6 @@
#include "mysql_priv.h"
#include <mysql.h>
#include "slave.h"
#include "sql_acl.h"
#include <my_getopt.h>
#include <thr_alarm.h>
#include <myisam.h>
@ -359,22 +358,18 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks",
sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment",
&srv_auto_extend_increment);
#endif
#ifdef HAVE_NDBCLUSTER_DB
// ndb thread specific variable settings
/* ndb thread specific variable settings */
sys_var_thd_ulong
sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz",
&SV::ndb_autoincrement_prefetch_sz);
sys_var_thd_bool
sys_ndb_force_send("ndb_force_send",
&SV::ndb_force_send);
sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send);
sys_var_thd_bool
sys_ndb_use_exact_count("ndb_use_exact_count",
&SV::ndb_use_exact_count);
sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count);
sys_var_thd_bool
sys_ndb_use_transactions("ndb_use_transactions",
&SV::ndb_use_transactions);
// ndb server global variable settings
// none
sys_ndb_use_transactions("ndb_use_transactions", &SV::ndb_use_transactions);
#endif
/* Time/date/datetime formats */

View file

@ -26,7 +26,6 @@
*/
#include "mysql_priv.h"
#include "sql_acl.h"
#include "hash_filo.h"
#ifdef HAVE_REPLICATION
#include "sql_repl.h" //for tables_ok()

View file

@ -18,7 +18,6 @@
/* Basic functions needed by many modules */
#include "mysql_priv.h"
#include "sql_acl.h"
#include "sql_select.h"
#include <m_ctype.h>
#include <my_dir.h>

View file

@ -300,7 +300,6 @@ TODO list:
#include <m_ctype.h>
#include <my_dir.h>
#include <hash.h>
#include "sql_acl.h"
#include "ha_myisammrg.h"
#ifndef MASTER
#include "../srclib/myisammrg/myrg_def.h"

View file

@ -27,7 +27,6 @@
#endif
#include "mysql_priv.h"
#include "sql_acl.h"
#include <m_ctype.h>
#include <sys/stat.h>
#include <thr_alarm.h>

View file

@ -19,7 +19,6 @@
#include "mysql_priv.h"
#include <mysys_err.h>
#include "sql_acl.h"
#include <my_dir.h>
#include <m_ctype.h>
#ifdef __WIN__
@ -390,7 +389,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
// do not create database if another thread is holding read lock
/* do not create database if another thread is holding read lock */
if (wait_if_global_read_lock(thd, 0, 1))
{
error= -1;
@ -514,7 +513,7 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
// do not alter database if another thread is holding read lock
/* do not alter database if another thread is holding read lock */
if ((error=wait_if_global_read_lock(thd,0,1)))
goto exit2;
@ -542,9 +541,11 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
Query_log_event qinfo(thd, thd->query, thd->query_length, 0,
/* suppress_use */ TRUE);
// Write should use the database being created as the "current
// database" and not the threads current database, which is the
// default.
/*
Write should use the database being created as the "current
database" and not the threads current database, which is the
default.
*/
qinfo.db = db;
qinfo.db_len = strlen(db);
@ -577,7 +578,6 @@ exit2:
-1 Error generated
*/
int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{
long deleted=0;
@ -589,7 +589,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
// do not drop database if another thread is holding read lock
/* do not drop database if another thread is holding read lock */
if (wait_if_global_read_lock(thd, 0, 1))
{
error= -1;
@ -657,10 +657,11 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{
Query_log_event qinfo(thd, query, query_length, 0,
/* suppress_use */ TRUE);
// Write should use the database being created as the "current
// database" and not the threads current database, which is the
// default.
/*
Write should use the database being created as the "current
database" and not the threads current database, which is the
default.
*/
qinfo.db = db;
qinfo.db_len = strlen(db);
@ -774,7 +775,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
found_other_files++;
continue;
}
// just for safety we use files_charset_info
/* just for safety we use files_charset_info */
if (db && !my_strcasecmp(files_charset_info,
extension, reg_ext))
{
@ -909,7 +910,7 @@ bool mysql_change_db(THD *thd, const char *name)
if (!dbname || !(db_length= strlen(dbname)))
{
x_free(dbname); /* purecov: inspected */
send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */
send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */
DBUG_RETURN(1); /* purecov: inspected */
}
if (check_db_name(dbname))

View file

@ -23,7 +23,6 @@
#include "mysql_priv.h"
#include "sql_select.h"
#include "sql_acl.h"
static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *s,
TABLE_LIST *t);

View file

@ -18,7 +18,6 @@
/* Execute DO statement */
#include "mysql_priv.h"
#include "sql_acl.h"
int mysql_do(THD *thd, List<Item> &values)
{

View file

@ -18,7 +18,6 @@
/* Insert of records */
#include "mysql_priv.h"
#include "sql_acl.h"
static int check_null_fields(THD *thd,TABLE *entry);
#ifndef EMBEDDED_LIBRARY

View file

@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysql_priv.h"
#include "sql_acl.h"
#include "sql_repl.h"
#include "repl_failsafe.h"
#include <m_ctype.h>
@ -3591,7 +3590,7 @@ error:
/*
Check grants for commands which work only with one table and all other
tables belong to subselects.
tables belonging to subselects or implicitly opened tables.
SYNOPSIS
check_one_table_access()
@ -3613,7 +3612,7 @@ int check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables)
if (grant_option && check_grant(thd, privilege, tables, 0, 1, 0))
return 1;
/* Check rights on tables of subselect (if exists) */
/* Check rights on tables of subselects and implictly opened tables */
TABLE_LIST *subselects_tables;
if ((subselects_tables= tables->next))
{
@ -5202,7 +5201,10 @@ int multi_update_precheck(THD *thd, TABLE_LIST *tables)
DBUG_PRINT("info",("Checking sub query list"));
for (table= tables; table; table= table->next)
{
if (table->table_in_update_from_clause)
if (my_tz_check_n_skip_implicit_tables(&table,
lex->time_zone_tables_used))
continue;
else if (table->table_in_update_from_clause)
{
/*
If we check table by local TABLE_LIST copy then we should copy

View file

@ -68,7 +68,6 @@ Long data handling:
***********************************************************************/
#include "mysql_priv.h"
#include "sql_acl.h"
#include "sql_select.h" // for JOIN
#include <m_ctype.h> // for isspace()
#ifdef EMBEDDED_LIBRARY

View file

@ -18,7 +18,6 @@
#ifdef HAVE_REPLICATION
#include "sql_repl.h"
#include "sql_acl.h"
#include "log_event.h"
#include <my_dir.h>

View file

@ -19,7 +19,6 @@
#include "mysql_priv.h"
#include "sql_select.h" // For select_describe
#include "sql_acl.h"
#include "repl_failsafe.h"
#include <my_dir.h>

View file

@ -21,7 +21,6 @@
*/
#include "mysql_priv.h"
#include "sql_acl.h"
#include "sql_select.h"
static bool safe_update_on_fly(JOIN_TAB *join_tab, List<Item> *fields);

View file

@ -32,7 +32,6 @@
#define Select Lex->current_select
#include "mysql_priv.h"
#include "slave.h"
#include "sql_acl.h"
#include "lex_symbol.h"
#include "item_create.h"
#include <myisam.h>

View file

@ -66,8 +66,8 @@ extern void my_tz_free();
/*
Check if we have pointer to the beggining of list of implictly used
time zone tables and fast-forward to its end.
Check if we have pointer to the begining of list of implicitly used time
zone tables, set SELECT_ACL for them and fast-forward to its end.
SYNOPSIS
my_tz_check_n_skip_implicit_tables()
@ -87,6 +87,8 @@ inline bool my_tz_check_n_skip_implicit_tables(TABLE_LIST **table,
{
if (*table == tz_tables)
{
for (int i= 0; i < 4; i++)
(*table)[i].grant.privilege= SELECT_ACL;
(*table)+= 3;
return TRUE;
}

View file

@ -615,10 +615,12 @@ my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return 1;
}
bzero(initid->ptr,sizeof(longlong));
// Fool MySQL to think that this function is a constant
// This will ensure that MySQL only evalutes the function
// when the rows are sent to the client and not before any ORDER BY
// clauses
/*
Fool MySQL to think that this function is a constant
This will ensure that MySQL only evalutes the function
when the rows are sent to the client and not before any ORDER BY
clauses
*/
initid->const_item=1;
return 0;
}
@ -635,9 +637,10 @@ longlong sequence(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
ulonglong val=0;
if (args->arg_count)
val= *((longlong*) args->args[0]);
return ++ *((longlong*) initid->ptr) + val;
return ++*((longlong*) initid->ptr) + val;
}
/****************************************************************************
** Some functions that handles IP and hostname conversions
** The orignal function was from Zeev Suraski.