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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e09f50d7
Commit
e09f50d7
authored
Feb 04, 2005
by
mysqldev@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0
into mysql.com:/home/mysqldev/tulin/mysql-5.0
parents
bb37aab7
abf7837f
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
145 additions
and
10 deletions
+145
-10
mysql-test/r/limit.result
mysql-test/r/limit.result
+9
-0
mysql-test/r/ndb_basic.result
mysql-test/r/ndb_basic.result
+34
-0
mysql-test/t/limit.test
mysql-test/t/limit.test
+10
-0
mysql-test/t/ndb_basic.test
mysql-test/t/ndb_basic.test
+38
-0
ndb/include/ndbapi/NdbDictionary.hpp
ndb/include/ndbapi/NdbDictionary.hpp
+3
-3
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+1
-1
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+1
-1
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+44
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+5
-4
No files found.
mysql-test/r/limit.result
View file @
e09f50d7
...
@@ -67,3 +67,12 @@ SELECT * FROM t1;
...
@@ -67,3 +67,12 @@ SELECT * FROM t1;
id id2
id id2
3 0
3 0
DROP TABLE t1;
DROP TABLE t1;
create table t1 (a integer);
insert into t1 values (1);
select 1 as a from t1 union all select 1 from dual limit 1;
a
1
(select 1 as a from t1) union all (select 1 from dual) limit 1;
a
1
drop table t1;
mysql-test/r/ndb_basic.result
View file @
e09f50d7
...
@@ -573,3 +573,37 @@ select * from t1 where a12345678901234567890123456789a1234567890=2;
...
@@ -573,3 +573,37 @@ select * from t1 where a12345678901234567890123456789a1234567890=2;
a1234567890123456789012345678901234567890 a12345678901234567890123456789a1234567890
a1234567890123456789012345678901234567890 a12345678901234567890123456789a1234567890
5 2
5 2
drop table t1;
drop table t1;
create table t1
(a bigint, b bigint, c bigint, d bigint,
primary key (a,b,c,d))
engine=ndb
max_rows=200000000;
Warnings:
Warning 1105 Ndb might have problems storing the max amount of rows specified
insert into t1 values
(1,2,3,4),(2,3,4,5),(3,4,5,6),
(3,2,3,4),(1,3,4,5),(2,4,5,6),
(1,2,3,5),(2,3,4,8),(3,4,5,9),
(3,2,3,5),(1,3,4,8),(2,4,5,9),
(1,2,3,6),(2,3,4,6),(3,4,5,7),
(3,2,3,6),(1,3,4,6),(2,4,5,7),
(1,2,3,7),(2,3,4,7),(3,4,5,8),
(3,2,3,7),(1,3,4,7),(2,4,5,8),
(1,3,3,4),(2,4,4,5),(3,5,5,6),
(3,3,3,4),(1,4,4,5),(2,5,5,6),
(1,3,3,5),(2,4,4,8),(3,5,5,9),
(3,3,3,5),(1,4,4,8),(2,5,5,9),
(1,3,3,6),(2,4,4,6),(3,5,5,7),
(3,3,3,6),(1,4,4,6),(2,5,5,7),
(1,3,3,7),(2,4,4,7),(3,5,5,8),
(3,3,3,7),(1,4,4,7),(2,5,5,8);
select count(*) from t1;
count(*)
48
drop table t1;
create table t1
(a bigint, b bigint, c bigint, d bigint,
primary key (a))
engine=ndb
max_rows=1;
drop table t1;
mysql-test/t/limit.test
View file @
e09f50d7
...
@@ -49,3 +49,13 @@ SELECT * FROM t1;
...
@@ -49,3 +49,13 @@ SELECT * FROM t1;
DELETE
FROM
t1
WHERE
id2
=
0
ORDER
BY
id
desc
LIMIT
1
;
DELETE
FROM
t1
WHERE
id2
=
0
ORDER
BY
id
desc
LIMIT
1
;
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug#8023 - limit on UNION with from DUAL, causes syntax error
#
create
table
t1
(
a
integer
);
insert
into
t1
values
(
1
);
# both queries must return one row
select
1
as
a
from
t1
union
all
select
1
from
dual
limit
1
;
(
select
1
as
a
from
t1
)
union
all
(
select
1
from
dual
)
limit
1
;
drop
table
t1
;
mysql-test/t/ndb_basic.test
View file @
e09f50d7
...
@@ -539,3 +539,41 @@ insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
...
@@ -539,3 +539,41 @@ insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
explain
select
*
from
t1
where
a12345678901234567890123456789a1234567890
=
2
;
explain
select
*
from
t1
where
a12345678901234567890123456789a1234567890
=
2
;
select
*
from
t1
where
a12345678901234567890123456789a1234567890
=
2
;
select
*
from
t1
where
a12345678901234567890123456789a1234567890
=
2
;
drop
table
t1
;
drop
table
t1
;
#
# test fragment creation
#
# first a table with _many_ fragments per node group
# then a table with just one fragment per node group
#
create
table
t1
(
a
bigint
,
b
bigint
,
c
bigint
,
d
bigint
,
primary
key
(
a
,
b
,
c
,
d
))
engine
=
ndb
max_rows
=
200000000
;
insert
into
t1
values
(
1
,
2
,
3
,
4
),(
2
,
3
,
4
,
5
),(
3
,
4
,
5
,
6
),
(
3
,
2
,
3
,
4
),(
1
,
3
,
4
,
5
),(
2
,
4
,
5
,
6
),
(
1
,
2
,
3
,
5
),(
2
,
3
,
4
,
8
),(
3
,
4
,
5
,
9
),
(
3
,
2
,
3
,
5
),(
1
,
3
,
4
,
8
),(
2
,
4
,
5
,
9
),
(
1
,
2
,
3
,
6
),(
2
,
3
,
4
,
6
),(
3
,
4
,
5
,
7
),
(
3
,
2
,
3
,
6
),(
1
,
3
,
4
,
6
),(
2
,
4
,
5
,
7
),
(
1
,
2
,
3
,
7
),(
2
,
3
,
4
,
7
),(
3
,
4
,
5
,
8
),
(
3
,
2
,
3
,
7
),(
1
,
3
,
4
,
7
),(
2
,
4
,
5
,
8
),
(
1
,
3
,
3
,
4
),(
2
,
4
,
4
,
5
),(
3
,
5
,
5
,
6
),
(
3
,
3
,
3
,
4
),(
1
,
4
,
4
,
5
),(
2
,
5
,
5
,
6
),
(
1
,
3
,
3
,
5
),(
2
,
4
,
4
,
8
),(
3
,
5
,
5
,
9
),
(
3
,
3
,
3
,
5
),(
1
,
4
,
4
,
8
),(
2
,
5
,
5
,
9
),
(
1
,
3
,
3
,
6
),(
2
,
4
,
4
,
6
),(
3
,
5
,
5
,
7
),
(
3
,
3
,
3
,
6
),(
1
,
4
,
4
,
6
),(
2
,
5
,
5
,
7
),
(
1
,
3
,
3
,
7
),(
2
,
4
,
4
,
7
),(
3
,
5
,
5
,
8
),
(
3
,
3
,
3
,
7
),(
1
,
4
,
4
,
7
),(
2
,
5
,
5
,
8
);
select
count
(
*
)
from
t1
;
drop
table
t1
;
create
table
t1
(
a
bigint
,
b
bigint
,
c
bigint
,
d
bigint
,
primary
key
(
a
))
engine
=
ndb
max_rows
=
1
;
drop
table
t1
;
ndb/include/ndbapi/NdbDictionary.hpp
View file @
e09f50d7
...
@@ -140,9 +140,9 @@ public:
...
@@ -140,9 +140,9 @@ public:
enum
FragmentType
{
enum
FragmentType
{
FragUndefined
=
0
,
///< Fragmentation type undefined or default
FragUndefined
=
0
,
///< Fragmentation type undefined or default
FragSingle
=
1
,
///< Only one fragment
FragSingle
=
1
,
///< Only one fragment
FragAllSmall
=
2
,
///< One fragment per node
group
FragAllSmall
=
2
,
///< One fragment per node
, default
FragAllMedium
=
3
,
///<
Default value. Two fragments per node group.
FragAllMedium
=
3
,
///<
two fragments per node
FragAllLarge
=
4
///<
Eight fragments per node group
.
FragAllLarge
=
4
///<
Four fragments per node
.
};
};
};
};
...
...
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
View file @
e09f50d7
...
@@ -6178,7 +6178,7 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal){
...
@@ -6178,7 +6178,7 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal){
break
;
break
;
case
DictTabInfo
:
:
AllNodesMediumTable
:
case
DictTabInfo
:
:
AllNodesMediumTable
:
jam
();
jam
();
noOfFragments
=
csystemnodes
;
noOfFragments
=
2
*
csystemnodes
;
break
;
break
;
case
DictTabInfo
:
:
AllNodesLargeTable
:
case
DictTabInfo
:
:
AllNodesLargeTable
:
jam
();
jam
();
...
...
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
e09f50d7
...
@@ -295,7 +295,7 @@ void
...
@@ -295,7 +295,7 @@ void
NdbTableImpl
::
init
(){
NdbTableImpl
::
init
(){
clearNewProperties
();
clearNewProperties
();
m_frm
.
clear
();
m_frm
.
clear
();
m_fragmentType
=
NdbDictionary
::
Object
::
FragAll
Medium
;
m_fragmentType
=
NdbDictionary
::
Object
::
FragAll
Small
;
m_logging
=
true
;
m_logging
=
true
;
m_kvalue
=
6
;
m_kvalue
=
6
;
m_minLoadFactor
=
78
;
m_minLoadFactor
=
78
;
...
...
sql/ha_ndbcluster.cc
View file @
e09f50d7
...
@@ -3650,6 +3650,47 @@ static int create_ndb_column(NDBCOL &col,
...
@@ -3650,6 +3650,47 @@ static int create_ndb_column(NDBCOL &col,
Create a table in NDB Cluster
Create a table in NDB Cluster
*/
*/
static
void
ndb_set_fragmentation
(
NDBTAB
&
tab
,
TABLE
*
form
,
uint
pk_length
)
{
if
(
form
->
max_rows
==
0
)
/* default setting, don't set fragmentation */
return
;
/**
* get the number of fragments right
*/
uint
no_fragments
;
{
#if MYSQL_VERSION_ID >= 50000
uint
acc_row_size
=
25
+
2
;
#else
uint
acc_row_size
=
pk_length
*
4
;
/* add acc overhead */
if
(
pk_length
<=
8
)
acc_row_size
+=
25
+
2
;
/* main page will set the limit */
else
acc_row_size
+=
4
+
4
;
/* overflow page will set the limit */
#endif
ulonglong
acc_fragment_size
=
512
*
1024
*
1024
;
ulonglong
max_rows
=
form
->
max_rows
;
no_fragments
=
(
max_rows
*
acc_row_size
)
/
acc_fragment_size
+
1
;
}
{
uint
no_nodes
=
g_ndb_cluster_connection
->
no_db_nodes
();
NDBTAB
::
FragmentType
ftype
;
if
(
no_fragments
>
2
*
no_nodes
)
{
ftype
=
NDBTAB
::
FragAllLarge
;
if
(
no_fragments
>
4
*
no_nodes
)
push_warning
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_UNKNOWN_ERROR
,
"Ndb might have problems storing the max amount of rows specified"
);
}
else
if
(
no_fragments
>
no_nodes
)
ftype
=
NDBTAB
::
FragAllMedium
;
else
ftype
=
NDBTAB
::
FragAllSmall
;
tab
.
setFragmentType
(
ftype
);
}
}
int
ha_ndbcluster
::
create
(
const
char
*
name
,
int
ha_ndbcluster
::
create
(
const
char
*
name
,
TABLE
*
form
,
TABLE
*
form
,
HA_CREATE_INFO
*
info
)
HA_CREATE_INFO
*
info
)
...
@@ -3752,6 +3793,8 @@ int ha_ndbcluster::create(const char *name,
...
@@ -3752,6 +3793,8 @@ int ha_ndbcluster::create(const char *name,
}
}
}
}
ndb_set_fragmentation
(
tab
,
form
,
pk_length
);
if
((
my_errno
=
check_ndb_connection
()))
if
((
my_errno
=
check_ndb_connection
()))
DBUG_RETURN
(
my_errno
);
DBUG_RETURN
(
my_errno
);
...
...
sql/sql_yacc.yy
View file @
e09f50d7
...
@@ -3895,10 +3895,11 @@ select_into:
...
@@ -3895,10 +3895,11 @@ select_into:
select_from:
select_from:
FROM join_table_list where_clause group_clause having_clause
FROM join_table_list where_clause group_clause having_clause
opt_order_clause opt_limit_clause procedure_clause
opt_order_clause opt_limit_clause procedure_clause
| FROM DUAL_SYM /* oracle compatibility: oracle always requires FROM
| FROM DUAL_SYM opt_limit_clause
clause, and DUAL is system table without fields.
/* oracle compatibility: oracle always requires FROM clause,
Is "SELECT 1 FROM DUAL" any better than
and DUAL is system table without fields.
"SELECT 1" ? Hmmm :) */
Is "SELECT 1 FROM DUAL" any better than "SELECT 1" ?
Hmmm :) */
;
;
select_options:
select_options:
...
...
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