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
06ff30f6
Commit
06ff30f6
authored
Feb 10, 2005
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/dev/mysql-4.0-0
into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
parents
dcc65b77
8b3d59ad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
13 deletions
+42
-13
extra/replace.c
extra/replace.c
+13
-13
mysql-test/r/select.result
mysql-test/r/select.result
+13
-0
mysql-test/t/select.test
mysql-test/t/select.test
+15
-0
sql/table.cc
sql/table.cc
+1
-0
No files found.
extra/replace.c
View file @
06ff30f6
...
...
@@ -376,8 +376,8 @@ static REP_SET *make_new_set(REP_SETS *sets);
static
void
make_sets_invisible
(
REP_SETS
*
sets
);
static
void
free_last_set
(
REP_SETS
*
sets
);
static
void
free_sets
(
REP_SETS
*
sets
);
static
void
set_bit
(
REP_SET
*
set
,
uint
bit
);
static
void
clear_bit
(
REP_SET
*
set
,
uint
bit
);
static
void
internal_
set_bit
(
REP_SET
*
set
,
uint
bit
);
static
void
internal_
clear_bit
(
REP_SET
*
set
,
uint
bit
);
static
void
or_bits
(
REP_SET
*
to
,
REP_SET
*
from
);
static
void
copy_bits
(
REP_SET
*
to
,
REP_SET
*
from
);
static
int
cmp_bits
(
REP_SET
*
set1
,
REP_SET
*
set2
);
...
...
@@ -454,7 +454,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
{
if
(
from
[
i
][
0
]
==
'\\'
&&
from
[
i
][
1
]
==
'^'
)
{
set_bit
(
start_states
,
states
+
1
);
internal_
set_bit
(
start_states
,
states
+
1
);
if
(
!
from
[
i
][
2
])
{
start_states
->
table_offset
=
i
;
...
...
@@ -463,8 +463,8 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
}
else
if
(
from
[
i
][
0
]
==
'\\'
&&
from
[
i
][
1
]
==
'$'
)
{
set_bit
(
start_states
,
states
);
set_bit
(
word_states
,
states
);
internal_
set_bit
(
start_states
,
states
);
internal_
set_bit
(
word_states
,
states
);
if
(
!
from
[
i
][
2
]
&&
start_states
->
table_offset
==
(
uint
)
~
0
)
{
start_states
->
table_offset
=
i
;
...
...
@@ -473,11 +473,11 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
}
else
{
set_bit
(
word_states
,
states
);
internal_
set_bit
(
word_states
,
states
);
if
(
from
[
i
][
0
]
==
'\\'
&&
(
from
[
i
][
1
]
==
'b'
&&
from
[
i
][
2
]))
set_bit
(
start_states
,
states
+
1
);
internal_
set_bit
(
start_states
,
states
+
1
);
else
set_bit
(
start_states
,
states
);
internal_
set_bit
(
start_states
,
states
);
}
for
(
pos
=
from
[
i
],
len
=
0
;
*
pos
;
pos
++
)
{
...
...
@@ -583,9 +583,9 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
follow
[
i
].
len
>
found_end
)
found_end
=
follow
[
i
].
len
;
if
(
chr
&&
follow
[
i
].
chr
)
set_bit
(
new_set
,
i
+
1
);
/* To next set */
internal_
set_bit
(
new_set
,
i
+
1
);
/* To next set */
else
set_bit
(
new_set
,
i
);
internal_
set_bit
(
new_set
,
i
);
}
}
if
(
found_end
)
...
...
@@ -602,7 +602,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
if
(
follow
[
bit_nr
-
1
].
len
<
found_end
||
(
new_set
->
found_len
&&
(
chr
==
0
||
!
follow
[
bit_nr
].
chr
)))
clear_bit
(
new_set
,
i
);
internal_
clear_bit
(
new_set
,
i
);
else
{
if
(
chr
==
0
||
!
follow
[
bit_nr
].
chr
)
...
...
@@ -751,13 +751,13 @@ static void free_sets(REP_SETS *sets)
return
;
}
static
void
set_bit
(
REP_SET
*
set
,
uint
bit
)
static
void
internal_
set_bit
(
REP_SET
*
set
,
uint
bit
)
{
set
->
bits
[
bit
/
WORD_BIT
]
|=
1
<<
(
bit
%
WORD_BIT
);
return
;
}
static
void
clear_bit
(
REP_SET
*
set
,
uint
bit
)
static
void
internal_
clear_bit
(
REP_SET
*
set
,
uint
bit
)
{
set
->
bits
[
bit
/
WORD_BIT
]
&=
~
(
1
<<
(
bit
%
WORD_BIT
));
return
;
...
...
mysql-test/r/select.result
View file @
06ff30f6
...
...
@@ -2387,3 +2387,16 @@ EXPLAIN SELECT i FROM t1 WHERE i=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
DROP TABLE t1;
CREATE TABLE t1 ( a BLOB, INDEX (a(20)) );
CREATE TABLE t2 ( a BLOB, INDEX (a(20)) );
INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five');
INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 5
t2 ref a a 23 t1.a 5
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 5
t2 ref a a 23 t1.a 5
DROP TABLE t1, t2;
mysql-test/t/select.test
View file @
06ff30f6
...
...
@@ -1930,3 +1930,18 @@ INSERT INTO t1 VALUES (3,'c');
EXPLAIN
SELECT
i
FROM
t1
WHERE
i
=
1
;
DROP
TABLE
t1
;
#
# Test case for bug 7520: a wrong cost of the index for a BLOB field
#
CREATE
TABLE
t1
(
a
BLOB
,
INDEX
(
a
(
20
))
);
CREATE
TABLE
t2
(
a
BLOB
,
INDEX
(
a
(
20
))
);
INSERT
INTO
t1
VALUES
(
'one'
),(
'two'
),(
'three'
),(
'four'
),(
'five'
);
INSERT
INTO
t2
VALUES
(
'one'
),(
'two'
),(
'three'
),(
'four'
),(
'five'
);
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
;
DROP
TABLE
t1
,
t2
;
sql/table.cc
View file @
06ff30f6
...
...
@@ -627,6 +627,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if
(
!
(
field
->
flags
&
BINARY_FLAG
))
keyinfo
->
flags
|=
HA_END_SPACE_KEY
;
}
set_if_bigger
(
outparam
->
max_key_length
,
keyinfo
->
key_length
);
if
(
i
==
0
&&
key
!=
primary_key
)
field
->
flags
|=
((
keyinfo
->
flags
&
HA_NOSAME
)
&&
...
...
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