Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
9239beaf
Commit
9239beaf
authored
Mar 02, 2006
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-5.1
into mysql.com:/home/mydev/mysql-5.1-bug11527
parents
9ce2aec5
64461db1
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
81 additions
and
19 deletions
+81
-19
mysql-test/r/ndb_partition_range.result
mysql-test/r/ndb_partition_range.result
+3
-3
mysql-test/r/xml.result
mysql-test/r/xml.result
+12
-0
mysql-test/t/ndb_partition_range.test
mysql-test/t/ndb_partition_range.test
+3
-3
mysql-test/t/xml.test
mysql-test/t/xml.test
+6
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+5
-2
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.cc
+20
-10
sql/ha_ndbcluster_binlog.h
sql/ha_ndbcluster_binlog.h
+3
-1
sql/item_xmlfunc.cc
sql/item_xmlfunc.cc
+29
-0
No files found.
mysql-test/r/ndb_partition_range.result
View file @
9239beaf
...
@@ -246,17 +246,17 @@ PARTITION BY RANGE(f1)
...
@@ -246,17 +246,17 @@ PARTITION BY RANGE(f1)
PARTITION part2 VALUES LESS THAN (1000));
PARTITION part2 VALUES LESS THAN (1000));
INSERT INTO t1 VALUES(1, '---1---');
INSERT INTO t1 VALUES(1, '---1---');
INSERT INTO t1 VALUES(2, '---2---');
INSERT INTO t1 VALUES(2, '---2---');
select * from t1;
select * from t1
order by f1
;
f1 f2
f1 f2
1 ---1---
1 ---1---
2 ---2---
2 ---2---
UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 2;
UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 2;
select * from t1;
select * from t1
order by f1
;
f1 f2
f1 f2
1 ---1---
1 ---1---
6 ---2---
6 ---2---
UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 1;
UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 1;
select * from t1;
select * from t1
order by f1
;
f1 f2
f1 f2
5 ---1---
5 ---1---
6 ---2---
6 ---2---
...
...
mysql-test/r/xml.result
View file @
9239beaf
...
@@ -65,6 +65,9 @@ c1
...
@@ -65,6 +65,9 @@ c1
SELECT extractValue(@xml,'/a/child::*');
SELECT extractValue(@xml,'/a/child::*');
extractValue(@xml,'/a/child::*')
extractValue(@xml,'/a/child::*')
b1 b2
b1 b2
SELECT extractValue(@xml,'/a/self::*');
extractValue(@xml,'/a/self::*')
a1 a2
SELECT extractValue(@xml,'/a/descendant::*');
SELECT extractValue(@xml,'/a/descendant::*');
extractValue(@xml,'/a/descendant::*')
extractValue(@xml,'/a/descendant::*')
b1 c1 b2
b1 c1 b2
...
@@ -546,6 +549,15 @@ select extractvalue('<a>A</a>','/<a>');
...
@@ -546,6 +549,15 @@ select extractvalue('<a>A</a>','/<a>');
ERROR HY000: XPATH syntax error: '>'
ERROR HY000: XPATH syntax error: '>'
select extractvalue('<a><b>b</b><b!>b!</b!></a>','//b!');
select extractvalue('<a><b>b</b><b!>b!</b!></a>','//b!');
ERROR HY000: XPATH syntax error: '!'
ERROR HY000: XPATH syntax error: '!'
select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant::*');
extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant::*')
B C
select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/self::*');
extractvalue('<a>A<b>B<c>C</c></b></a>','/a/self::*')
A
select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant-or-self::*');
extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant-or-self::*')
A B C
select extractvalue('<A_B>A</A_B>','/A_B');
select extractvalue('<A_B>A</A_B>','/A_B');
extractvalue('<A_B>A</A_B>','/A_B')
extractvalue('<A_B>A</A_B>','/A_B')
A
A
mysql-test/t/ndb_partition_range.test
View file @
9239beaf
...
@@ -252,9 +252,9 @@ PARTITION BY RANGE(f1)
...
@@ -252,9 +252,9 @@ PARTITION BY RANGE(f1)
PARTITION
part2
VALUES
LESS
THAN
(
1000
));
PARTITION
part2
VALUES
LESS
THAN
(
1000
));
INSERT
INTO
t1
VALUES
(
1
,
'---1---'
);
INSERT
INTO
t1
VALUES
(
1
,
'---1---'
);
INSERT
INTO
t1
VALUES
(
2
,
'---2---'
);
INSERT
INTO
t1
VALUES
(
2
,
'---2---'
);
select
*
from
t1
;
select
*
from
t1
order
by
f1
;
UPDATE
t1
SET
f1
=
f1
+
4
WHERE
f1
=
2
;
UPDATE
t1
SET
f1
=
f1
+
4
WHERE
f1
=
2
;
select
*
from
t1
;
select
*
from
t1
order
by
f1
;
UPDATE
t1
SET
f1
=
f1
+
4
WHERE
f1
=
1
;
UPDATE
t1
SET
f1
=
f1
+
4
WHERE
f1
=
1
;
select
*
from
t1
;
select
*
from
t1
order
by
f1
;
drop
table
t1
;
drop
table
t1
;
mysql-test/t/xml.test
View file @
9239beaf
...
@@ -23,6 +23,7 @@ SELECT extractValue(@xml,'/*/*');
...
@@ -23,6 +23,7 @@ SELECT extractValue(@xml,'/*/*');
SELECT
extractValue
(
@
xml
,
'/*/*/*'
);
SELECT
extractValue
(
@
xml
,
'/*/*/*'
);
SELECT
extractValue
(
@
xml
,
'/a/child::*'
);
SELECT
extractValue
(
@
xml
,
'/a/child::*'
);
SELECT
extractValue
(
@
xml
,
'/a/self::*'
);
SELECT
extractValue
(
@
xml
,
'/a/descendant::*'
);
SELECT
extractValue
(
@
xml
,
'/a/descendant::*'
);
SELECT
extractValue
(
@
xml
,
'/a/descendant-or-self::*'
);
SELECT
extractValue
(
@
xml
,
'/a/descendant-or-self::*'
);
SELECT
extractValue
(
@
xml
,
'/a/attribute::*'
);
SELECT
extractValue
(
@
xml
,
'/a/attribute::*'
);
...
@@ -245,6 +246,11 @@ select extractvalue('<a>A</a>','/<a>');
...
@@ -245,6 +246,11 @@ select extractvalue('<a>A</a>','/<a>');
select
extractvalue
(
'<a><b>b</b><b!>b!</b!></a>'
,
'//b!'
);
select
extractvalue
(
'<a><b>b</b><b!>b!</b!></a>'
,
'//b!'
);
#
#
# Bug #16315 XML: extractvalue() handles self badly
#
select
extractvalue
(
'<a>A<b>B<c>C</c></b></a>'
,
'/a/descendant::*'
);
select
extractvalue
(
'<a>A<b>B<c>C</c></b></a>'
,
'/a/self::*'
);
select
extractvalue
(
'<a>A<b>B<c>C</c></b></a>'
,
'/a/descendant-or-self::*'
);
# Bug #16320 XML: extractvalue() won't accept names containing underscores
# Bug #16320 XML: extractvalue() won't accept names containing underscores
#
#
select
extractvalue
(
'<A_B>A</A_B>'
,
'/A_B'
);
select
extractvalue
(
'<A_B>A</A_B>'
,
'/A_B'
);
sql/ha_ndbcluster.cc
View file @
9239beaf
...
@@ -4728,13 +4728,14 @@ int ha_ndbcluster::final_drop_index(TABLE *table_arg)
...
@@ -4728,13 +4728,14 @@ int ha_ndbcluster::final_drop_index(TABLE *table_arg)
int
ha_ndbcluster
::
rename_table
(
const
char
*
from
,
const
char
*
to
)
int
ha_ndbcluster
::
rename_table
(
const
char
*
from
,
const
char
*
to
)
{
{
NDBDICT
*
dict
;
NDBDICT
*
dict
;
char
old_dbname
[
FN_HEADLEN
];
char
new_tabname
[
FN_HEADLEN
];
char
new_tabname
[
FN_HEADLEN
];
const
NDBTAB
*
orig_tab
;
const
NDBTAB
*
orig_tab
;
int
result
;
int
result
;
DBUG_ENTER
(
"ha_ndbcluster::rename_table"
);
DBUG_ENTER
(
"ha_ndbcluster::rename_table"
);
DBUG_PRINT
(
"info"
,
(
"Renaming %s to %s"
,
from
,
to
));
DBUG_PRINT
(
"info"
,
(
"Renaming %s to %s"
,
from
,
to
));
set_dbname
(
from
);
set_dbname
(
from
,
old_dbname
);
set_tabname
(
from
);
set_tabname
(
from
);
set_tabname
(
to
,
new_tabname
);
set_tabname
(
to
,
new_tabname
);
...
@@ -4742,6 +4743,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
...
@@ -4742,6 +4743,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
DBUG_RETURN
(
my_errno
=
HA_ERR_NO_CONNECTION
);
DBUG_RETURN
(
my_errno
=
HA_ERR_NO_CONNECTION
);
Ndb
*
ndb
=
get_ndb
();
Ndb
*
ndb
=
get_ndb
();
ndb
->
setDatabaseName
(
old_dbname
);
dict
=
ndb
->
getDictionary
();
dict
=
ndb
->
getDictionary
();
if
(
!
(
orig_tab
=
dict
->
getTable
(
m_tabname
)))
if
(
!
(
orig_tab
=
dict
->
getTable
(
m_tabname
)))
ERR_RETURN
(
dict
->
getNdbError
());
ERR_RETURN
(
dict
->
getNdbError
());
...
@@ -4833,7 +4835,8 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
...
@@ -4833,7 +4835,8 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
current_thd
->
query
,
current_thd
->
query_length
,
current_thd
->
query
,
current_thd
->
query_length
,
m_dbname
,
new_tabname
,
m_dbname
,
new_tabname
,
0
,
0
,
0
,
0
,
SOT_RENAME_TABLE
);
SOT_RENAME_TABLE
,
old_dbname
,
m_tabname
);
}
}
if
(
share
)
if
(
share
)
free_share
(
&
share
);
free_share
(
&
share
);
...
...
sql/ha_ndbcluster_binlog.cc
View file @
9239beaf
...
@@ -885,7 +885,8 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
...
@@ -885,7 +885,8 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
const
char
*
db
,
const
char
*
table_name
,
const
char
*
db
,
const
char
*
table_name
,
uint32
ndb_table_id
,
uint32
ndb_table_id
,
uint32
ndb_table_version
,
uint32
ndb_table_version
,
enum
SCHEMA_OP_TYPE
type
)
enum
SCHEMA_OP_TYPE
type
,
const
char
*
old_db
,
const
char
*
old_table_name
)
{
{
DBUG_ENTER
(
"ndbcluster_log_schema_op"
);
DBUG_ENTER
(
"ndbcluster_log_schema_op"
);
Thd_ndb
*
thd_ndb
=
get_thd_ndb
(
thd
);
Thd_ndb
*
thd_ndb
=
get_thd_ndb
(
thd
);
...
@@ -919,10 +920,19 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
...
@@ -919,10 +920,19 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
query
=
tmp_buf2
;
query
=
tmp_buf2
;
query_length
=
(
uint
)
(
strxmov
(
tmp_buf2
,
"drop table `"
,
query_length
=
(
uint
)
(
strxmov
(
tmp_buf2
,
"drop table `"
,
table_name
,
"`"
,
NullS
)
-
tmp_buf2
);
table_name
,
"`"
,
NullS
)
-
tmp_buf2
);
// fall through
if
(
!
share
)
case
SOT_CREATE_TABLE
:
get_a_share
=
1
;
// fall through
break
;
case
SOT_RENAME_TABLE
:
case
SOT_RENAME_TABLE
:
/* redo the rename table query as is may contain several tables */
query
=
tmp_buf2
;
query_length
=
(
uint
)
(
strxmov
(
tmp_buf2
,
"rename table `"
,
old_db
,
"."
,
old_table_name
,
"` to `"
,
db
,
"."
,
table_name
,
"`"
,
NullS
)
-
tmp_buf2
);
if
(
!
share
)
get_a_share
=
1
;
break
;
case
SOT_CREATE_TABLE
:
// fall through
// fall through
case
SOT_ALTER_TABLE
:
case
SOT_ALTER_TABLE
:
if
(
!
share
)
if
(
!
share
)
...
@@ -983,8 +993,8 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
...
@@ -983,8 +993,8 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
}
}
Ndb
*
ndb
=
thd_ndb
->
ndb
;
Ndb
*
ndb
=
thd_ndb
->
ndb
;
char
old
_db
[
FN_REFLEN
];
char
save
_db
[
FN_REFLEN
];
strcpy
(
old
_db
,
ndb
->
getDatabaseName
());
strcpy
(
save
_db
,
ndb
->
getDatabaseName
());
char
tmp_buf
[
SCHEMA_QUERY_SIZE
];
char
tmp_buf
[
SCHEMA_QUERY_SIZE
];
NDBDICT
*
dict
=
ndb
->
getDictionary
();
NDBDICT
*
dict
=
ndb
->
getDictionary
();
...
@@ -1091,7 +1101,7 @@ end:
...
@@ -1091,7 +1101,7 @@ end:
if
(
trans
)
if
(
trans
)
ndb
->
closeTransaction
(
trans
);
ndb
->
closeTransaction
(
trans
);
ndb
->
setDatabaseName
(
old
_db
);
ndb
->
setDatabaseName
(
save
_db
);
/*
/*
Wait for other mysqld's to acknowledge the table operation
Wait for other mysqld's to acknowledge the table operation
...
@@ -1169,8 +1179,8 @@ ndbcluster_update_slock(THD *thd,
...
@@ -1169,8 +1179,8 @@ ndbcluster_update_slock(THD *thd,
const
NdbError
*
ndb_error
=
0
;
const
NdbError
*
ndb_error
=
0
;
uint32
node_id
=
g_ndb_cluster_connection
->
node_id
();
uint32
node_id
=
g_ndb_cluster_connection
->
node_id
();
Ndb
*
ndb
=
check_ndb_in_thd
(
thd
);
Ndb
*
ndb
=
check_ndb_in_thd
(
thd
);
char
old_db
[
128
];
char
save_db
[
FN_HEADLEN
];
strcpy
(
old
_db
,
ndb
->
getDatabaseName
());
strcpy
(
save
_db
,
ndb
->
getDatabaseName
());
char
tmp_buf
[
SCHEMA_QUERY_SIZE
];
char
tmp_buf
[
SCHEMA_QUERY_SIZE
];
NDBDICT
*
dict
=
ndb
->
getDictionary
();
NDBDICT
*
dict
=
ndb
->
getDictionary
();
...
@@ -1292,7 +1302,7 @@ end:
...
@@ -1292,7 +1302,7 @@ end:
db
,
table_name
);
db
,
table_name
);
if
(
trans
)
if
(
trans
)
ndb
->
closeTransaction
(
trans
);
ndb
->
closeTransaction
(
trans
);
ndb
->
setDatabaseName
(
old
_db
);
ndb
->
setDatabaseName
(
save
_db
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
...
...
sql/ha_ndbcluster_binlog.h
View file @
9239beaf
...
@@ -95,7 +95,9 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
...
@@ -95,7 +95,9 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
const
char
*
db
,
const
char
*
table_name
,
const
char
*
db
,
const
char
*
table_name
,
uint32
ndb_table_id
,
uint32
ndb_table_id
,
uint32
ndb_table_version
,
uint32
ndb_table_version
,
enum
SCHEMA_OP_TYPE
type
);
enum
SCHEMA_OP_TYPE
type
,
const
char
*
old_db
=
0
,
const
char
*
old_table_name
=
0
);
int
ndbcluster_handle_drop_table
(
Ndb
*
ndb
,
const
char
*
event_name
,
int
ndbcluster_handle_drop_table
(
Ndb
*
ndb
,
const
char
*
event_name
,
NDB_SHARE
*
share
);
NDB_SHARE
*
share
);
void
ndb_rep_event_name
(
String
*
event_name
,
void
ndb_rep_event_name
(
String
*
event_name
,
...
...
sql/item_xmlfunc.cc
View file @
9239beaf
...
@@ -252,6 +252,18 @@ public:
...
@@ -252,6 +252,18 @@ public:
};
};
/* Returns self */
class
Item_nodeset_func_selfbyname
:
public
Item_nodeset_func_axisbyname
{
public:
Item_nodeset_func_selfbyname
(
Item
*
a
,
const
char
*
n_arg
,
uint
l_arg
,
String
*
pxml
)
:
Item_nodeset_func_axisbyname
(
a
,
n_arg
,
l_arg
,
pxml
)
{}
const
char
*
func_name
()
const
{
return
"xpath_selfbyname"
;
}
String
*
val_nodeset
(
String
*
nodeset
);
};
/* Returns children */
/* Returns children */
class
Item_nodeset_func_childbyname
:
public
Item_nodeset_func_axisbyname
class
Item_nodeset_func_childbyname
:
public
Item_nodeset_func_axisbyname
{
{
...
@@ -572,6 +584,20 @@ String * Item_nodeset_func_union::val_nodeset(String *nodeset)
...
@@ -572,6 +584,20 @@ String * Item_nodeset_func_union::val_nodeset(String *nodeset)
}
}
String
*
Item_nodeset_func_selfbyname
::
val_nodeset
(
String
*
nodeset
)
{
prepare
(
nodeset
);
for
(
MY_XPATH_FLT
*
flt
=
fltbeg
;
flt
<
fltend
;
flt
++
)
{
uint
pos
=
0
;
MY_XML_NODE
*
self
=
&
nodebeg
[
flt
->
num
];
if
(
validname
(
self
))
((
XPathFilter
*
)
nodeset
)
->
append_element
(
flt
->
num
,
pos
++
);
}
return
nodeset
;
}
String
*
Item_nodeset_func_childbyname
::
val_nodeset
(
String
*
nodeset
)
String
*
Item_nodeset_func_childbyname
::
val_nodeset
(
String
*
nodeset
)
{
{
prepare
(
nodeset
);
prepare
(
nodeset
);
...
@@ -945,6 +971,9 @@ static Item* nametestfunc(MY_XPATH *xpath,
...
@@ -945,6 +971,9 @@ static Item* nametestfunc(MY_XPATH *xpath,
case
MY_XPATH_AXIS_ATTRIBUTE
:
case
MY_XPATH_AXIS_ATTRIBUTE
:
res
=
new
Item_nodeset_func_attributebyname
(
arg
,
beg
,
len
,
xpath
->
pxml
);
res
=
new
Item_nodeset_func_attributebyname
(
arg
,
beg
,
len
,
xpath
->
pxml
);
break
;
break
;
case
MY_XPATH_AXIS_SELF
:
res
=
new
Item_nodeset_func_selfbyname
(
arg
,
beg
,
len
,
xpath
->
pxml
);
break
;
default:
default:
res
=
new
Item_nodeset_func_childbyname
(
arg
,
beg
,
len
,
xpath
->
pxml
);
res
=
new
Item_nodeset_func_childbyname
(
arg
,
beg
,
len
,
xpath
->
pxml
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment