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
3f6aad90
Commit
3f6aad90
authored
May 18, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Resolve merge from 4.1
parents
e7c62822
af557076
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
593 additions
and
59 deletions
+593
-59
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
client/mysqldump.c
client/mysqldump.c
+71
-46
cmd-line-utils/libedit/makelist.sh
cmd-line-utils/libedit/makelist.sh
+2
-2
cmd-line-utils/libedit/readline.c
cmd-line-utils/libedit/readline.c
+1
-1
cmd-line-utils/libedit/search.c
cmd-line-utils/libedit/search.c
+1
-0
configure.in
configure.in
+1
-0
myisam/mi_check.c
myisam/mi_check.c
+35
-1
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+1
-1
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+14
-0
mysql-test/r/olap.result
mysql-test/r/olap.result
+33
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+24
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+15
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+339
-0
mysql-test/t/olap.test
mysql-test/t/olap.test
+24
-0
mysql-test/t/range.test
mysql-test/t/range.test
+0
-2
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+23
-0
ndb/src/common/util/version.c
ndb/src/common/util/version.c
+2
-0
ndb/src/ndbapi/ndberror.c
ndb/src/ndbapi/ndberror.c
+2
-2
sql/item.cc
sql/item.cc
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+3
-3
No files found.
BitKeeper/etc/logging_ok
View file @
3f6aad90
...
...
@@ -282,6 +282,7 @@ tonu@x3.internalnet
tsmith@build.mysql.com
tulin@build.mysql.com
tulin@dl145b.mysql.com
tulin@dl145c.mysql.com
tulin@mysql.com
ulli@morbus.(none)
venu@hundin.mysql.fi
...
...
client/mysqldump.c
View file @
3f6aad90
This diff is collapsed.
Click to expand it.
cmd-line-utils/libedit/makelist.sh
View file @
3f6aad90
...
...
@@ -87,7 +87,7 @@ case $FLAG in
cat
$FILES
|
$AWK
'
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
printf("#include \"
sys
.h\"\n#include \"el.h\"\n");
printf("#include \"
config
.h\"\n#include \"el.h\"\n");
printf("private const struct el_bindings_t el_func_help[] = {\n");
low = "abcdefghijklmnopqrstuvwxyz_";
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
...
...
@@ -170,7 +170,7 @@ case $FLAG in
cat
$FILES
|
$AWK
'/el_action_t/ { print $3 }'
|
sort
|
$AWK
'
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
printf("#include \"
sys
.h\"\n#include \"el.h\"\n");
printf("#include \"
config
.h\"\n#include \"el.h\"\n");
printf("private const el_func_t el_func[] = {");
maxlen = 80;
needn = 1;
...
...
cmd-line-utils/libedit/readline.c
View file @
3f6aad90
...
...
@@ -70,10 +70,10 @@ extern char *alloca ();
#include <fcntl.h>
#include <vis.h>
#include "readline/readline.h"
#include "el.h"
#include "fcns.h"
/* for EL_NUM_FCNS */
#include "histedit.h"
#include "readline/readline.h"
/* for rl_complete() */
#define TAB '\r'
...
...
cmd-line-utils/libedit/search.c
View file @
3f6aad90
...
...
@@ -37,6 +37,7 @@
/*
* search.c: History and character search functions
*/
#include <sys/types.h>
#include <stdlib.h>
#if defined(REGEX)
#include <regex.h>
...
...
configure.in
View file @
3f6aad90
...
...
@@ -1812,6 +1812,7 @@ fi
fi
AC_CHECK_TYPES
([
sigset_t, off_t],
[]
,
[]
,
[
#include <sys/types.h>])
AC_CHECK_TYPES
([
size_t],
[]
,
[]
,
[
#include <stdio.h>])
AC_CHECK_TYPES
([
u_int32_t]
)
MYSQL_PTHREAD_YIELD
...
...
myisam/mi_check.c
View file @
3f6aad90
...
...
@@ -3244,6 +3244,9 @@ static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a)
cmp
=
ha_key_cmp
(
sort_param
->
seg
,
sort_info
->
key_block
->
lastkey
,
(
uchar
*
)
a
,
USE_WHOLE_KEY
,
SEARCH_FIND
|
SEARCH_UPDATE
,
&
diff_pos
);
ha_key_cmp
(
sort_param
->
seg
,
sort_info
->
key_block
->
lastkey
,
(
uchar
*
)
a
,
USE_WHOLE_KEY
,
SEARCH_FIND
|
SEARCH_NULL_ARE_NOT_EQUAL
,
&
diff_pos
);
sort_param
->
unique
[
diff_pos
-
1
]
++
;
}
else
...
...
@@ -3956,7 +3959,38 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
return
;
}
/* calculate unique keys for each part key */
/*
Update statistics for each part of an index
SYNOPSIS
update_key_parts()
keyinfo Index information (only key->keysegs used)
rec_per_key_part OUT Store statistics here
unique IN Array of #distinct values collected over index
run.
records Number of records in the table
NOTES
Unique is an array:
unique[0]= (#different values of {keypart1}) - 1
unique[1]= (#different values of {keypart2,keypart1} tuple) - unique[0] - 1
...
Here we assume that NULL != NULL (see SEARCH_NULL_ARE_NOT_EQUAL). The
'unique' array is collected in one sequential scan through the entire
index. This is done in two places: in chk_index() and in sort_key_write().
Output is an array:
rec_per_key_part[k] =
= E(#records in the table such that keypart_1=c_1 AND ... AND
keypart_k=c_k for arbitrary constants c_1 ... c_k)
= {assuming that values have uniform distribution and index contains all
tuples from the domain (or that {c_1, ..., c_k} tuple is choosen from
index tuples}
= #tuples-in-the-index / #distinct-tuples-in-the-index.
*/
void
update_key_parts
(
MI_KEYDEF
*
keyinfo
,
ulong
*
rec_per_key_part
,
ulonglong
*
unique
,
ulonglong
records
)
...
...
mysql-test/mysql-test-run.sh
View file @
3f6aad90
...
...
@@ -710,7 +710,7 @@ MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=
MYSQL_SHOW
=
"
$MYSQL_SHOW
-uroot --socket=
$MASTER_MYSOCK
--password=
$DBPASSWD
$EXTRA_MYSQLSHOW_OPT
"
MYSQL_BINLOG
=
"
$MYSQL_BINLOG
--no-defaults --local-load=
$MYSQL_TMP_DIR
--character-sets-dir=
$CHARSETSDIR
$EXTRA_MYSQLBINLOG_OPT
"
MYSQL_FIX_SYSTEM_TABLES
=
"
$MYSQL_FIX_SYSTEM_TABLES
--no-defaults --host=localhost --port=
$MASTER_MYPORT
--socket=
$MASTER_MYSOCK
--user=root --password=
$DBPASSWD
--basedir=
$BASEDIR
--bindir=
$CLIENT_BINDIR
--verbose"
MYSQL
=
"
$MYSQL
--host=localhost --port=
$MASTER_MYPORT
--socket=
$MASTER_MYSOCK
--user=root --password=
$DBPASSWD
"
MYSQL
=
"
$MYSQL
--
no-defaults --
host=localhost --port=
$MASTER_MYPORT
--socket=
$MASTER_MYSOCK
--user=root --password=
$DBPASSWD
"
export
MYSQL MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES
export
CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR
export
NDB_TOOLS_DIR
...
...
mysql-test/r/myisam.result
View file @
3f6aad90
...
...
@@ -1260,3 +1260,17 @@ Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
set global concurrent_insert=@save_concurrent_insert;
create table t1 (a int, key(a));
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 8 NULL NULL YES BTREE
alter table t1 disable keys;
alter table t1 enable keys;
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 8 NULL NULL YES BTREE
drop table t1;
mysql-test/r/olap.result
View file @
3f6aad90
...
...
@@ -456,3 +456,36 @@ a m
NULL 3
DROP TABLE t1;
set div_precision_increment= @sav_dpi;
CREATE TABLE t1 (a int(11));
INSERT INTO t1 VALUES (1),(2);
SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d
GROUP BY a;
a SUM(a) SUM(a)+1
1 1 2
2 2 3
SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d
GROUP BY a WITH ROLLUP;
a SUM(a) SUM(a)+1
1 1 2
2 2 3
NULL 3 4
SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d
GROUP BY a;
a SUM(a) SUM(a)+1
1 1 2
2 2 3
SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d
GROUP BY a WITH ROLLUP;
a SUM(a) SUM(a)+1
1 1 2
2 2 3
NULL 3 4
SELECT a, SUM(a), SUM(a)+1, CONCAT(SUM(a),'x'), SUM(a)+SUM(a), SUM(a)
FROM (SELECT 1 a, 2 b UNION SELECT 2,3 UNION SELECT 5,6 ) d
GROUP BY a WITH ROLLUP;
a SUM(a) SUM(a)+1 CONCAT(SUM(a),'x') SUM(a)+SUM(a) SUM(a)
1 1 2 1x 2 1
2 2 3 2x 4 2
5 5 6 5x 10 5
NULL 8 9 8x 16 8
DROP TABLE t1;
mysql-test/r/subselect.result
View file @
3f6aad90
...
...
@@ -2781,3 +2781,27 @@ c1 c2
2 NULL
3 NULL
DROP TABLE t1,t2,t3;
drop table t1
#;
CREATE TABLE `t1` (
`itemid` bigint(20) unsigned NOT NULL auto_increment,
`sessionid` bigint(20) unsigned default NULL,
`time` int(10) unsigned NOT NULL default '0',
`type` set('A','D','E','F','G','I','L','N','U') collate latin1_general_ci NOT
NULL default '',
`data` text collate latin1_general_ci NOT NULL,
PRIMARY KEY (`itemid`)
) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
INSERT INTO `t1` VALUES (1, 1, 1, 'D', '');
CREATE TABLE `t2` (
`sessionid` bigint(20) unsigned NOT NULL auto_increment,
`pid` int(10) unsigned NOT NULL default '0',
`date` int(10) unsigned NOT NULL default '0',
`ip` varchar(15) collate latin1_general_ci NOT NULL default '',
PRIMARY KEY (`sessionid`)
) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
INSERT INTO `t2` VALUES (1, 1, 1, '10.10.10.1');
SELECT s.ip, count( e.itemid ) FROM `t1` e JOIN t2 s ON s.sessionid = e.sessionid WHERE e.sessionid = ( SELECT sessionid FROM t2 ORDER BY sessionid DESC LIMIT 1 ) GROUP BY s.ip HAVING count( e.itemid ) >0 LIMIT 0 , 30;
ip count( e.itemid )
10.10.10.1 1
drop tables t1,t2;
mysql-test/t/myisam.test
View file @
3f6aad90
...
...
@@ -660,3 +660,18 @@ select a from t1;
check
table
t1
;
drop
table
t1
;
set
global
concurrent_insert
=@
save_concurrent_insert
;
# BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce
# different statistics on the same table with NULL values.
create
table
t1
(
a
int
,
key
(
a
));
insert
into
t1
values
(
1
),(
2
),(
3
),(
4
),(
NULL
),(
NULL
),(
NULL
),(
NULL
);
analyze
table
t1
;
show
keys
from
t1
;
alter
table
t1
disable
keys
;
alter
table
t1
enable
keys
;
show
keys
from
t1
;
drop
table
t1
;
mysql-test/t/mysqldump.test
View file @
3f6aad90
This diff is collapsed.
Click to expand it.
mysql-test/t/olap.test
View file @
3f6aad90
...
...
@@ -196,3 +196,27 @@ SELECT * FROM ( SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP ) t2;
DROP
TABLE
t1
;
set
div_precision_increment
=
@
sav_dpi
;
#
# Tests for bug #7914: ROLLUP over expressions on temporary table
#
CREATE
TABLE
t1
(
a
int
(
11
));
INSERT
INTO
t1
VALUES
(
1
),(
2
);
SELECT
a
,
SUM
(
a
),
SUM
(
a
)
+
1
FROM
(
SELECT
a
FROM
t1
UNION
select
2
)
d
GROUP
BY
a
;
SELECT
a
,
SUM
(
a
),
SUM
(
a
)
+
1
FROM
(
SELECT
a
FROM
t1
UNION
select
2
)
d
GROUP
BY
a
WITH
ROLLUP
;
SELECT
a
,
SUM
(
a
),
SUM
(
a
)
+
1
FROM
(
SELECT
1
a
UNION
select
2
)
d
GROUP
BY
a
;
SELECT
a
,
SUM
(
a
),
SUM
(
a
)
+
1
FROM
(
SELECT
1
a
UNION
select
2
)
d
GROUP
BY
a
WITH
ROLLUP
;
SELECT
a
,
SUM
(
a
),
SUM
(
a
)
+
1
,
CONCAT
(
SUM
(
a
),
'x'
),
SUM
(
a
)
+
SUM
(
a
),
SUM
(
a
)
FROM
(
SELECT
1
a
,
2
b
UNION
SELECT
2
,
3
UNION
SELECT
5
,
6
)
d
GROUP
BY
a
WITH
ROLLUP
;
DROP
TABLE
t1
;
mysql-test/t/range.test
View file @
3f6aad90
--
source
include
/
have_innodb
.
inc
#
# Problem with range optimizer
#
...
...
mysql-test/t/subselect.test
View file @
3f6aad90
...
...
@@ -1799,3 +1799,26 @@ SELECT c1,c2 FROM t1 LEFT JOIN t2 ON c1 = c2
DROP
TABLE
t1
,
t2
,
t3
;
#
# Item_int_with_ref check (BUG#10020)
#
CREATE
TABLE
`t1`
(
`itemid`
bigint
(
20
)
unsigned
NOT
NULL
auto_increment
,
`sessionid`
bigint
(
20
)
unsigned
default
NULL
,
`time`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`type`
set
(
'A'
,
'D'
,
'E'
,
'F'
,
'G'
,
'I'
,
'L'
,
'N'
,
'U'
)
collate
latin1_general_ci
NOT
NULL
default
''
,
`data`
text
collate
latin1_general_ci
NOT
NULL
,
PRIMARY
KEY
(
`itemid`
)
)
DEFAULT
CHARSET
=
latin1
COLLATE
=
latin1_general_ci
;
INSERT
INTO
`t1`
VALUES
(
1
,
1
,
1
,
'D'
,
''
);
CREATE
TABLE
`t2`
(
`sessionid`
bigint
(
20
)
unsigned
NOT
NULL
auto_increment
,
`pid`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`date`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`ip`
varchar
(
15
)
collate
latin1_general_ci
NOT
NULL
default
''
,
PRIMARY
KEY
(
`sessionid`
)
)
DEFAULT
CHARSET
=
latin1
COLLATE
=
latin1_general_ci
;
INSERT
INTO
`t2`
VALUES
(
1
,
1
,
1
,
'10.10.10.1'
);
SELECT
s
.
ip
,
count
(
e
.
itemid
)
FROM
`t1`
e
JOIN
t2
s
ON
s
.
sessionid
=
e
.
sessionid
WHERE
e
.
sessionid
=
(
SELECT
sessionid
FROM
t2
ORDER
BY
sessionid
DESC
LIMIT
1
)
GROUP
BY
s
.
ip
HAVING
count
(
e
.
itemid
)
>
0
LIMIT
0
,
30
;
drop
tables
t1
,
t2
;
ndb/src/common/util/version.c
View file @
3f6aad90
...
...
@@ -91,6 +91,8 @@ void ndbSetOwnVersion() {}
#ifndef TEST_VERSION
struct
NdbUpGradeCompatible
ndbCompatibleTable_full
[]
=
{
{
MAKE_VERSION
(
5
,
0
,
3
),
MAKE_VERSION
(
5
,
0
,
2
),
UG_Exact
},
{
MAKE_VERSION
(
4
,
1
,
12
),
MAKE_VERSION
(
4
,
1
,
10
),
UG_Range
},
{
MAKE_VERSION
(
4
,
1
,
10
),
MAKE_VERSION
(
4
,
1
,
9
),
UG_Exact
},
{
MAKE_VERSION
(
4
,
1
,
9
),
MAKE_VERSION
(
4
,
1
,
8
),
UG_Exact
},
{
MAKE_VERSION
(
3
,
5
,
2
),
MAKE_VERSION
(
3
,
5
,
1
),
UG_Exact
},
{
0
,
0
,
UG_Null
}
...
...
ndb/src/ndbapi/ndberror.c
View file @
3f6aad90
...
...
@@ -330,8 +330,8 @@ ErrorBundle ErrorCodes[] = {
{
703
,
SE
,
"Invalid table format"
},
{
704
,
SE
,
"Attribute name too long"
},
{
705
,
SE
,
"Table name too long"
},
{
707
,
SE
,
"No more table metadata records"
},
{
708
,
SE
,
"No more attribute metadata records"
},
{
707
,
SE
,
"No more table metadata records
(increase MaxNoOfTables)
"
},
{
708
,
SE
,
"No more attribute metadata records
(increase MaxNoOfAttributes)
"
},
{
709
,
SE
,
"No such table existed"
},
{
721
,
OE
,
"Table or index with given name already exists"
},
{
723
,
SE
,
"No such table existed"
},
...
...
sql/item.cc
View file @
3f6aad90
...
...
@@ -3554,7 +3554,7 @@ bool Item_int::eq(const Item *arg, bool binary_cmp) const
Item
*
Item_int_with_ref
::
new_item
()
{
DBUG_ASSERT
(
ref
->
basic_
const_item
());
DBUG_ASSERT
(
ref
->
const_item
());
/*
We need to evaluate the constant to make sure it works with
parameter markers.
...
...
sql/sql_select.cc
View file @
3f6aad90
...
...
@@ -1320,7 +1320,7 @@ JOIN::exec()
}
curr_all_fields
=
&
tmp_all_fields1
;
curr_fields_list
=
&
tmp_fields_list1
;
set_items_ref_array
(
items1
);
curr_join
->
set_items_ref_array
(
items1
);
if
(
sort_and_group
||
curr_tmp_table
->
group
)
{
...
...
@@ -1455,7 +1455,7 @@ JOIN::exec()
}
curr_fields_list
=
&
curr_join
->
tmp_fields_list2
;
curr_all_fields
=
&
curr_join
->
tmp_all_fields2
;
set_items_ref_array
(
items2
);
curr_join
->
set_items_ref_array
(
items2
);
curr_join
->
tmp_table_param
.
field_count
+=
curr_join
->
tmp_table_param
.
sum_func_count
;
curr_join
->
tmp_table_param
.
sum_func_count
=
0
;
...
...
@@ -1516,7 +1516,7 @@ JOIN::exec()
}
curr_fields_list
=
&
tmp_fields_list3
;
curr_all_fields
=
&
tmp_all_fields3
;
set_items_ref_array
(
items3
);
curr_join
->
set_items_ref_array
(
items3
);
if
(
curr_join
->
make_sum_func_list
(
*
curr_all_fields
,
*
curr_fields_list
,
1
,
TRUE
)
||
...
...
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