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
a7f19365
Commit
a7f19365
authored
Apr 07, 2006
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
parents
14528928
4ef7e5b5
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
759 additions
and
77 deletions
+759
-77
libmysql/libmysql.c
libmysql/libmysql.c
+0
-29
mysql-test/r/ctype_latin1.result
mysql-test/r/ctype_latin1.result
+22
-0
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_ucs.result
+8
-0
mysql-test/r/func_gconcat.result
mysql-test/r/func_gconcat.result
+5
-0
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+0
-8
mysql-test/r/sp.result
mysql-test/r/sp.result
+11
-0
mysql-test/r/view.result
mysql-test/r/view.result
+17
-0
mysql-test/t/ctype_latin1.test
mysql-test/t/ctype_latin1.test
+14
-0
mysql-test/t/ctype_ucs.test
mysql-test/t/ctype_ucs.test
+8
-0
mysql-test/t/func_gconcat.test
mysql-test/t/func_gconcat.test
+8
-0
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+0
-9
mysql-test/t/sp.test
mysql-test/t/sp.test
+15
-0
mysql-test/t/view.test
mysql-test/t/view.test
+21
-0
sql-common/client.c
sql-common/client.c
+33
-0
sql/field.h
sql/field.h
+6
-3
sql/item_sum.cc
sql/item_sum.cc
+4
-1
sql/opt_sum.cc
sql/opt_sum.cc
+14
-21
sql/sql_delete.cc
sql/sql_delete.cc
+1
-2
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
sql/sql_update.cc
sql/sql_update.cc
+5
-0
strings/conf_to_src.c
strings/conf_to_src.c
+2
-1
strings/ctype-extra.c
strings/ctype-extra.c
+554
-0
support-files/mysql.server.sh
support-files/mysql.server.sh
+10
-2
No files found.
libmysql/libmysql.c
View file @
a7f19365
...
@@ -1386,35 +1386,6 @@ mysql_get_server_info(MYSQL *mysql)
...
@@ -1386,35 +1386,6 @@ mysql_get_server_info(MYSQL *mysql)
}
}
/*
Get version number for server in a form easy to test on
SYNOPSIS
mysql_get_server_version()
mysql Connection
EXAMPLE
4.1.0-alfa -> 40100
NOTES
We will ensure that a newer server always has a bigger number.
RETURN
Signed number > 323000
*/
ulong
STDCALL
mysql_get_server_version
(
MYSQL
*
mysql
)
{
uint
major
,
minor
,
version
;
char
*
pos
=
mysql
->
server_version
,
*
end_pos
;
major
=
(
uint
)
strtoul
(
pos
,
&
end_pos
,
10
);
pos
=
end_pos
+
1
;
minor
=
(
uint
)
strtoul
(
pos
,
&
end_pos
,
10
);
pos
=
end_pos
+
1
;
version
=
(
uint
)
strtoul
(
pos
,
&
end_pos
,
10
);
return
(
ulong
)
major
*
10000L
+
(
ulong
)
(
minor
*
100
+
version
);
}
const
char
*
STDCALL
const
char
*
STDCALL
mysql_get_host_info
(
MYSQL
*
mysql
)
mysql_get_host_info
(
MYSQL
*
mysql
)
{
{
...
...
mysql-test/r/ctype_latin1.result
View file @
a7f19365
...
@@ -369,3 +369,25 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
...
@@ -369,3 +369,25 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT 'a' as str;
SELECT 'a' as str;
str
str
a
a
set @str= _latin1 'ABC ߲~ @ abc';
SELECT convert(@str collate latin1_bin using utf8);
convert(@str collate latin1_bin using utf8)
ABC ߲~ @ abc
SELECT convert(@str collate latin1_general_ci using utf8);
convert(@str collate latin1_general_ci using utf8)
ABC ߲~ @ abc
SELECT convert(@str collate latin1_german1_ci using utf8);
convert(@str collate latin1_german1_ci using utf8)
ABC ߲~ @ abc
SELECT convert(@str collate latin1_danish_ci using utf8);
convert(@str collate latin1_danish_ci using utf8)
ABC ߲~ @ abc
SELECT convert(@str collate latin1_spanish_ci using utf8);
convert(@str collate latin1_spanish_ci using utf8)
ABC ߲~ @ abc
SELECT convert(@str collate latin1_german2_ci using utf8);
convert(@str collate latin1_german2_ci using utf8)
ABC ߲~ @ abc
SELECT convert(@str collate latin1_swedish_ci using utf8);
convert(@str collate latin1_swedish_ci using utf8)
ABC ߲~ @ abc
mysql-test/r/ctype_ucs.result
View file @
a7f19365
...
@@ -719,3 +719,11 @@ lily
...
@@ -719,3 +719,11 @@ lily
river
river
drop table t1;
drop table t1;
deallocate prepare stmt;
deallocate prepare stmt;
create table t1(a blob, b text charset utf8, c text charset ucs2);
select data_type, character_octet_length, character_maximum_length
from information_schema.columns where table_name='t1';
data_type character_octet_length character_maximum_length
blob 65535 65535
text 65535 65535
text 65535 32767
drop table t1;
mysql-test/r/func_gconcat.result
View file @
a7f19365
...
@@ -626,3 +626,8 @@ latin1
...
@@ -626,3 +626,8 @@ latin1
latin1
latin1
drop table t1, t2, t3;
drop table t1, t2, t3;
set names default;
set names default;
create table t1 (c1 varchar(10), c2 int);
select charset(group_concat(c1 order by c2)) from t1;
charset(group_concat(c1 order by c2))
latin1
drop table t1;
mysql-test/r/information_schema.result
View file @
a7f19365
...
@@ -1041,14 +1041,6 @@ select 1 from (select 1 from test.t1) a;
...
@@ -1041,14 +1041,6 @@ select 1 from (select 1 from test.t1) a;
1
1
use test;
use test;
drop table t1;
drop table t1;
create table t1(a blob, b text charset utf8, c text charset ucs2);
select data_type, character_octet_length, character_maximum_length
from information_schema.columns where table_name='t1';
data_type character_octet_length character_maximum_length
blob 65535 65535
text 65535 65535
text 65535 32767
drop table t1;
create table t1 (f1 int(11));
create table t1 (f1 int(11));
create view v1 as select * from t1;
create view v1 as select * from t1;
drop table t1;
drop table t1;
...
...
mysql-test/r/sp.result
View file @
a7f19365
...
@@ -4811,6 +4811,17 @@ begin
...
@@ -4811,6 +4811,17 @@ begin
declare x int;
declare x int;
select id from t1 order by x;
select id from t1 order by x;
end|
end|
drop procedure if exists bug14945|
create table t3 (id int not null auto_increment primary key)|
create procedure bug14945() deterministic truncate t3|
insert into t3 values (null)|
call bug14945()|
insert into t3 values (null)|
select * from t3|
id
1
drop table t3|
drop procedure bug14945|
create procedure bug16474_2(x int)
create procedure bug16474_2(x int)
select id from t1 order by x|
select id from t1 order by x|
call bug16474_1()|
call bug16474_1()|
...
...
mysql-test/r/view.result
View file @
a7f19365
...
@@ -2562,3 +2562,20 @@ my_sqrt
...
@@ -2562,3 +2562,20 @@ my_sqrt
1.4142135623731
1.4142135623731
DROP VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (id int PRIMARY KEY);
CREATE TABLE t2 (id int PRIMARY KEY);
INSERT INTO t1 VALUES (1), (3);
INSERT INTO t2 VALUES (1), (2), (3);
CREATE VIEW v2 AS SELECT * FROM t2;
SELECT COUNT(*) FROM t1 LEFT JOIN t2 ON t1.id=t2.id;
COUNT(*)
2
SELECT * FROM t1 LEFT JOIN t2 ON t1.id=t2.id;
id id
1 1
3 3
SELECT COUNT(*) FROM t1 LEFT JOIN v2 ON t1.id=v2.id;
COUNT(*)
2
DROP VIEW v2;
DROP TABLE t1, t2;
mysql-test/t/ctype_latin1.test
View file @
a7f19365
...
@@ -95,4 +95,18 @@ SET collation_connection='latin1_bin';
...
@@ -95,4 +95,18 @@ SET collation_connection='latin1_bin';
CREATE
TABLE
a
(
a
int
);
CREATE
TABLE
a
(
a
int
);
SELECT
'a'
as
str
;
SELECT
'a'
as
str
;
#
# Bug#18321: Can't store EuroSign with latin1_german1_ci and latin1_general_ci
# The problem was in latin1->utf8->latin1 round trip.
#
set
@
str
=
_latin1
'ABC ߲~ @ abc'
;
SELECT
convert
(
@
str
collate
latin1_bin
using
utf8
);
SELECT
convert
(
@
str
collate
latin1_general_ci
using
utf8
);
SELECT
convert
(
@
str
collate
latin1_german1_ci
using
utf8
);
SELECT
convert
(
@
str
collate
latin1_danish_ci
using
utf8
);
SELECT
convert
(
@
str
collate
latin1_spanish_ci
using
utf8
);
SELECT
convert
(
@
str
collate
latin1_german2_ci
using
utf8
);
SELECT
convert
(
@
str
collate
latin1_swedish_ci
using
utf8
);
# End of 4.1 tests
# End of 4.1 tests
mysql-test/t/ctype_ucs.test
View file @
a7f19365
...
@@ -455,3 +455,11 @@ execute stmt using @param1;
...
@@ -455,3 +455,11 @@ execute stmt using @param1;
select
utext
from
t1
where
utext
like
'%%'
;
select
utext
from
t1
where
utext
like
'%%'
;
drop
table
t1
;
drop
table
t1
;
deallocate
prepare
stmt
;
deallocate
prepare
stmt
;
#
# Bug #14290: character_maximum_length for text fields
#
create
table
t1
(
a
blob
,
b
text
charset
utf8
,
c
text
charset
ucs2
);
select
data_type
,
character_octet_length
,
character_maximum_length
from
information_schema
.
columns
where
table_name
=
't1'
;
drop
table
t1
;
mysql-test/t/func_gconcat.test
View file @
a7f19365
...
@@ -414,3 +414,11 @@ select charset(a) from t2;
...
@@ -414,3 +414,11 @@ select charset(a) from t2;
select
charset
(
a
)
from
t3
;
select
charset
(
a
)
from
t3
;
drop
table
t1
,
t2
,
t3
;
drop
table
t1
,
t2
,
t3
;
set
names
default
;
set
names
default
;
#
# Bug#18281 group_concat changes charset to binary
#
create
table
t1
(
c1
varchar
(
10
),
c2
int
);
select
charset
(
group_concat
(
c1
order
by
c2
))
from
t1
;
drop
table
t1
;
mysql-test/t/information_schema.test
View file @
a7f19365
...
@@ -738,15 +738,6 @@ select 1 from (select 1 from test.t1) a;
...
@@ -738,15 +738,6 @@ select 1 from (select 1 from test.t1) a;
use
test
;
use
test
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #14290: character_maximum_length for text fields
#
create
table
t1
(
a
blob
,
b
text
charset
utf8
,
c
text
charset
ucs2
);
select
data_type
,
character_octet_length
,
character_maximum_length
from
information_schema
.
columns
where
table_name
=
't1'
;
drop
table
t1
;
#
#
# Bug#14476 `information_schema`.`TABLES`.`TABLE_TYPE` with empty value
# Bug#14476 `information_schema`.`TABLES`.`TABLE_TYPE` with empty value
#
#
...
...
mysql-test/t/sp.test
View file @
a7f19365
...
@@ -5666,6 +5666,21 @@ begin
...
@@ -5666,6 +5666,21 @@ begin
select
id
from
t1
order
by
x
;
select
id
from
t1
order
by
x
;
end
|
end
|
#
# BUG#14945: Truncate table doesn't reset the auto_increment counter
#
--
disable_warnings
drop
procedure
if
exists
bug14945
|
--
enable_warnings
create
table
t3
(
id
int
not
null
auto_increment
primary
key
)
|
create
procedure
bug14945
()
deterministic
truncate
t3
|
insert
into
t3
values
(
null
)
|
call
bug14945
()
|
insert
into
t3
values
(
null
)
|
select
*
from
t3
|
drop
table
t3
|
drop
procedure
bug14945
|
# This does NOT order by column index; variable is an expression.
# This does NOT order by column index; variable is an expression.
create
procedure
bug16474_2
(
x
int
)
create
procedure
bug16474_2
(
x
int
)
select
id
from
t1
order
by
x
|
select
id
from
t1
order
by
x
|
...
...
mysql-test/t/view.test
View file @
a7f19365
...
@@ -2413,3 +2413,24 @@ SELECT my_sqrt FROM v1 ORDER BY my_sqrt;
...
@@ -2413,3 +2413,24 @@ SELECT my_sqrt FROM v1 ORDER BY my_sqrt;
DROP
VIEW
v1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug #18237: invalid count optimization applied to an outer join with a view
#
CREATE
TABLE
t1
(
id
int
PRIMARY
KEY
);
CREATE
TABLE
t2
(
id
int
PRIMARY
KEY
);
INSERT
INTO
t1
VALUES
(
1
),
(
3
);
INSERT
INTO
t2
VALUES
(
1
),
(
2
),
(
3
);
CREATE
VIEW
v2
AS
SELECT
*
FROM
t2
;
SELECT
COUNT
(
*
)
FROM
t1
LEFT
JOIN
t2
ON
t1
.
id
=
t2
.
id
;
SELECT
*
FROM
t1
LEFT
JOIN
t2
ON
t1
.
id
=
t2
.
id
;
SELECT
COUNT
(
*
)
FROM
t1
LEFT
JOIN
v2
ON
t1
.
id
=
v2
.
id
;
DROP
VIEW
v2
;
DROP
TABLE
t1
,
t2
;
sql-common/client.c
View file @
a7f19365
...
@@ -2817,6 +2817,36 @@ const char * STDCALL mysql_error(MYSQL *mysql)
...
@@ -2817,6 +2817,36 @@ const char * STDCALL mysql_error(MYSQL *mysql)
return
mysql
->
net
.
last_error
;
return
mysql
->
net
.
last_error
;
}
}
/*
Get version number for server in a form easy to test on
SYNOPSIS
mysql_get_server_version()
mysql Connection
EXAMPLE
4.1.0-alfa -> 40100
NOTES
We will ensure that a newer server always has a bigger number.
RETURN
Signed number > 323000
*/
ulong
STDCALL
mysql_get_server_version
(
MYSQL
*
mysql
)
{
uint
major
,
minor
,
version
;
char
*
pos
=
mysql
->
server_version
,
*
end_pos
;
major
=
(
uint
)
strtoul
(
pos
,
&
end_pos
,
10
);
pos
=
end_pos
+
1
;
minor
=
(
uint
)
strtoul
(
pos
,
&
end_pos
,
10
);
pos
=
end_pos
+
1
;
version
=
(
uint
)
strtoul
(
pos
,
&
end_pos
,
10
);
return
(
ulong
)
major
*
10000L
+
(
ulong
)
(
minor
*
100
+
version
);
}
/*
/*
mysql_set_character_set function sends SET NAMES cs_name to
mysql_set_character_set function sends SET NAMES cs_name to
the server (which changes character_set_client, character_set_result
the server (which changes character_set_client, character_set_result
...
@@ -2836,6 +2866,9 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name)
...
@@ -2836,6 +2866,9 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name)
{
{
char
buff
[
MY_CS_NAME_SIZE
+
10
];
char
buff
[
MY_CS_NAME_SIZE
+
10
];
charsets_dir
=
save_csdir
;
charsets_dir
=
save_csdir
;
/* Skip execution of "SET NAMES" for pre-4.1 servers */
if
(
mysql_get_server_version
(
mysql
)
<
40100
)
return
0
;
sprintf
(
buff
,
"SET NAMES %s"
,
cs_name
);
sprintf
(
buff
,
"SET NAMES %s"
,
cs_name
);
if
(
!
mysql_real_query
(
mysql
,
buff
,
strlen
(
buff
)))
if
(
!
mysql_real_query
(
mysql
,
buff
,
strlen
(
buff
)))
{
{
...
...
sql/field.h
View file @
a7f19365
...
@@ -986,20 +986,23 @@ public:
...
@@ -986,20 +986,23 @@ public:
class
Field_string
:
public
Field_longstr
{
class
Field_string
:
public
Field_longstr
{
public:
public:
bool
can_alter_field_type
;
Field_string
(
char
*
ptr_arg
,
uint32
len_arg
,
uchar
*
null_ptr_arg
,
Field_string
(
char
*
ptr_arg
,
uint32
len_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
uchar
null_bit_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_longstr
(
ptr_arg
,
len_arg
,
null_ptr_arg
,
null_bit_arg
,
:
Field_longstr
(
ptr_arg
,
len_arg
,
null_ptr_arg
,
null_bit_arg
,
unireg_check_arg
,
field_name_arg
,
table_arg
,
cs
)
{};
unireg_check_arg
,
field_name_arg
,
table_arg
,
cs
),
can_alter_field_type
(
1
)
{};
Field_string
(
uint32
len_arg
,
bool
maybe_null_arg
,
const
char
*
field_name_arg
,
Field_string
(
uint32
len_arg
,
bool
maybe_null_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_longstr
((
char
*
)
0
,
len_arg
,
maybe_null_arg
?
(
uchar
*
)
""
:
0
,
0
,
:
Field_longstr
((
char
*
)
0
,
len_arg
,
maybe_null_arg
?
(
uchar
*
)
""
:
0
,
0
,
NONE
,
field_name_arg
,
table_arg
,
cs
)
{};
NONE
,
field_name_arg
,
table_arg
,
cs
),
can_alter_field_type
(
1
)
{};
enum_field_types
type
()
const
enum_field_types
type
()
const
{
{
return
((
orig_table
&&
return
((
can_alter_field_type
&&
orig_table
&&
orig_table
->
s
->
db_create_options
&
HA_OPTION_PACK_RECORD
&&
orig_table
->
s
->
db_create_options
&
HA_OPTION_PACK_RECORD
&&
field_length
>=
4
)
&&
field_length
>=
4
)
&&
orig_table
->
s
->
frm_version
<
FRM_VER_TRUE_VARCHAR
?
orig_table
->
s
->
frm_version
<
FRM_VER_TRUE_VARCHAR
?
...
...
sql/item_sum.cc
View file @
a7f19365
...
@@ -3226,7 +3226,10 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
...
@@ -3226,7 +3226,10 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
}
}
if
(
agg_item_charsets
(
collation
,
func_name
(),
if
(
agg_item_charsets
(
collation
,
func_name
(),
args
,
arg_count
,
MY_COLL_ALLOW_CONV
))
args
,
/* skip charset aggregation for order columns */
arg_count
-
arg_count_order
,
MY_COLL_ALLOW_CONV
))
return
1
;
return
1
;
result
.
set_charset
(
collation
.
collation
);
result
.
set_charset
(
collation
.
collation
);
...
...
sql/opt_sum.cc
View file @
a7f19365
...
@@ -96,8 +96,14 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
...
@@ -96,8 +96,14 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
*/
*/
for
(
TABLE_LIST
*
tl
=
tables
;
tl
;
tl
=
tl
->
next_leaf
)
for
(
TABLE_LIST
*
tl
=
tables
;
tl
;
tl
=
tl
->
next_leaf
)
{
{
TABLE_LIST
*
embedded
;
for
(
embedded
=
tl
;
embedded
;
embedded
=
embedded
->
embedding
)
{
if
(
embedded
->
on_expr
)
break
;
}
if
(
embedded
)
/* Don't replace expression on a table that is part of an outer join */
/* Don't replace expression on a table that is part of an outer join */
if
(
tl
->
on_expr
)
{
{
outer_tables
|=
tl
->
table
->
map
;
outer_tables
|=
tl
->
table
->
map
;
...
@@ -117,8 +123,11 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
...
@@ -117,8 +123,11 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
If the storage manager of 'tl' gives exact row count, compute the total
If the storage manager of 'tl' gives exact row count, compute the total
number of rows. If there are no outer table dependencies, this count
number of rows. If there are no outer table dependencies, this count
may be used as the real count.
may be used as the real count.
Schema tables are filled after this function is invoked, so we can't
get row count
*/
*/
if
(
tl
->
table
->
file
->
table_flags
()
&
HA_NOT_EXACT_COUNT
)
if
((
tl
->
table
->
file
->
table_flags
()
&
HA_NOT_EXACT_COUNT
)
||
tl
->
schema_table
)
{
{
is_exact_count
=
FALSE
;
is_exact_count
=
FALSE
;
count
=
1
;
// ensure count != 0
count
=
1
;
// ensure count != 0
...
@@ -143,31 +152,15 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
...
@@ -143,31 +152,15 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
switch
(
item_sum
->
sum_func
())
{
switch
(
item_sum
->
sum_func
())
{
case
Item_sum
:
:
COUNT_FUNC
:
case
Item_sum
:
:
COUNT_FUNC
:
/*
/*
If the expr in
count
(expr) can never be null we can change this
If the expr in
COUNT
(expr) can never be null we can change this
to the number of rows in the tables if this number is exact and
to the number of rows in the tables if this number is exact and
there are no outer joins.
there are no outer joins.
*/
*/
if
(
!
conds
&&
!
((
Item_sum_count
*
)
item
)
->
args
[
0
]
->
maybe_null
&&
if
(
!
conds
&&
!
((
Item_sum_count
*
)
item
)
->
args
[
0
]
->
maybe_null
&&
!
outer_tables
&&
is_exact_count
)
!
outer_tables
&&
is_exact_count
)
{
{
longlong
count
=
1
;
((
Item_sum_count
*
)
item
)
->
make_const
(
count
);
TABLE_LIST
*
table
;
recalc_const_item
=
1
;
for
(
table
=
tables
;
table
;
table
=
table
->
next_leaf
)
{
if
(
outer_tables
||
(
table
->
table
->
file
->
table_flags
()
&
HA_NOT_EXACT_COUNT
)
||
table
->
schema_table
)
{
const_result
=
0
;
// Can't optimize left join
break
;
}
tables
->
table
->
file
->
info
(
HA_STATUS_VARIABLE
|
HA_STATUS_NO_LOCK
);
count
*=
table
->
table
->
file
->
records
;
}
if
(
!
table
)
{
((
Item_sum_count
*
)
item
)
->
make_const
(
count
);
recalc_const_item
=
1
;
}
}
}
else
else
const_result
=
0
;
const_result
=
0
;
...
...
sql/sql_delete.cc
View file @
a7f19365
...
@@ -842,8 +842,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
...
@@ -842,8 +842,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
table_list
->
db
,
table_list
->
table_name
);
table_list
->
db
,
table_list
->
table_name
);
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
if
(
!
ha_check_storage_engine_flag
(
table_type
,
HTON_CAN_RECREATE
)
if
(
!
ha_check_storage_engine_flag
(
table_type
,
HTON_CAN_RECREATE
))
||
thd
->
lex
->
sphead
)
goto
trunc_by_del
;
goto
trunc_by_del
;
if
(
lock_and_wait_for_table_name
(
thd
,
table_list
))
if
(
lock_and_wait_for_table_name
(
thd
,
table_list
))
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
...
...
sql/sql_parse.cc
View file @
a7f19365
...
@@ -3350,7 +3350,7 @@ end_with_restore_list:
...
@@ -3350,7 +3350,7 @@ end_with_restore_list:
Don't allow this within a transaction because we want to use
Don't allow this within a transaction because we want to use
re-generate table
re-generate table
*/
*/
if
(
(
thd
->
locked_tables
&&
!
lex
->
sphead
)
||
thd
->
active_transaction
())
if
(
thd
->
locked_tables
||
thd
->
active_transaction
())
{
{
my_message
(
ER_LOCK_OR_ACTIVE_TRANSACTION
,
my_message
(
ER_LOCK_OR_ACTIVE_TRANSACTION
,
ER
(
ER_LOCK_OR_ACTIVE_TRANSACTION
),
MYF
(
0
));
ER
(
ER_LOCK_OR_ACTIVE_TRANSACTION
),
MYF
(
0
));
...
...
sql/sql_update.cc
View file @
a7f19365
...
@@ -1093,6 +1093,11 @@ multi_update::initialize_tables(JOIN *join)
...
@@ -1093,6 +1093,11 @@ multi_update::initialize_tables(JOIN *join)
/* ok to be on stack as this is not referenced outside of this func */
/* ok to be on stack as this is not referenced outside of this func */
Field_string
offset
(
table
->
file
->
ref_length
,
0
,
"offset"
,
Field_string
offset
(
table
->
file
->
ref_length
,
0
,
"offset"
,
table
,
&
my_charset_bin
);
table
,
&
my_charset_bin
);
/*
The field will be converted to varstring when creating tmp table if
table to be updated was created by mysql 4.1. Deny this.
*/
offset
.
can_alter_field_type
=
0
;
if
(
!
(
ifield
=
new
Item_field
(((
Field
*
)
&
offset
))))
if
(
!
(
ifield
=
new
Item_field
(((
Field
*
)
&
offset
))))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
ifield
->
maybe_null
=
0
;
ifield
->
maybe_null
=
0
;
...
...
strings/conf_to_src.c
View file @
a7f19365
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#define ROW_LEN 16
#define ROW_LEN 16
#define ROW16_LEN 8
#define ROW16_LEN 8
#define MAX_BUF
16
*1024
#define MAX_BUF
64
*1024
static
CHARSET_INFO
all_charsets
[
256
];
static
CHARSET_INFO
all_charsets
[
256
];
...
@@ -156,6 +156,7 @@ static int my_read_charset_file(const char *filename)
...
@@ -156,6 +156,7 @@ static int my_read_charset_file(const char *filename)
}
}
len
=
read
(
fd
,
buf
,
MAX_BUF
);
len
=
read
(
fd
,
buf
,
MAX_BUF
);
DBUG_ASSERT
(
len
<
MAX_BUF
);
close
(
fd
);
close
(
fd
);
if
(
my_parse_charset_xml
(
buf
,
len
,
add_collation
))
if
(
my_parse_charset_xml
(
buf
,
len
,
add_collation
))
...
...
strings/ctype-extra.c
View file @
a7f19365
This diff is collapsed.
Click to expand it.
support-files/mysql.server.sh
View file @
a7f19365
...
@@ -72,6 +72,10 @@ else
...
@@ -72,6 +72,10 @@ else
libexecdir
=
"
$basedir
/libexec"
libexecdir
=
"
$basedir
/libexec"
fi
fi
# datadir_set is used to determine if datadir was set (and so should be
# *not* set inside of the --basedir= handler.)
datadir_set
=
#
#
# Use LSB init script functions for printing messages, if possible
# Use LSB init script functions for printing messages, if possible
#
#
...
@@ -105,11 +109,15 @@ parse_server_arguments() {
...
@@ -105,11 +109,15 @@ parse_server_arguments() {
case
"
$arg
"
in
case
"
$arg
"
in
--basedir
=
*
)
basedir
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
--basedir
=
*
)
basedir
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
bindir
=
"
$basedir
/bin"
bindir
=
"
$basedir
/bin"
datadir
=
"
$basedir
/data"
if
test
-z
"
$datadir_set
"
;
then
datadir
=
"
$basedir
/data"
fi
sbindir
=
"
$basedir
/sbin"
sbindir
=
"
$basedir
/sbin"
libexecdir
=
"
$basedir
/libexec"
libexecdir
=
"
$basedir
/libexec"
;;
;;
--datadir
=
*
)
datadir
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--datadir
=
*
)
datadir
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
datadir_set
=
1
;;
--user
=
*
)
user
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--user
=
*
)
user
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--pid-file
=
*
)
server_pid_file
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--pid-file
=
*
)
server_pid_file
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--use-mysqld_safe
)
use_mysqld_safe
=
1
;;
--use-mysqld_safe
)
use_mysqld_safe
=
1
;;
...
...
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