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
9a1d80e9
Commit
9a1d80e9
authored
Apr 06, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into shellback.(none):/home/msvensson/mysql/mysql-5.0
parents
0e97b724
a0f7e755
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
681 additions
and
34 deletions
+681
-34
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/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/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/opt_sum.cc
sql/opt_sum.cc
+7
-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
No files found.
libmysql/libmysql.c
View file @
9a1d80e9
...
@@ -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 @
9a1d80e9
...
@@ -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/view.result
View file @
9a1d80e9
...
@@ -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 @
9a1d80e9
...
@@ -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/view.test
View file @
9a1d80e9
...
@@ -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 @
9a1d80e9
...
@@ -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 @
9a1d80e9
...
@@ -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/opt_sum.cc
View file @
9a1d80e9
...
@@ -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
;
...
...
sql/sql_update.cc
View file @
9a1d80e9
...
@@ -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 @
9a1d80e9
...
@@ -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 @
9a1d80e9
This diff is collapsed.
Click to expand it.
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