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
96f43fdc
Commit
96f43fdc
authored
Apr 24, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into lmy004.:/work/mysql-5.1-new-clean
parents
11b67667
3f63edb3
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
170 additions
and
22 deletions
+170
-22
config/ac-macros/misc.m4
config/ac-macros/misc.m4
+4
-1
configure.in
configure.in
+5
-0
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_ucs.result
+12
-0
mysql-test/r/func_op.result
mysql-test/r/func_op.result
+11
-0
mysql-test/r/view.result
mysql-test/r/view.result
+23
-0
mysql-test/t/ctype_ucs.test
mysql-test/t/ctype_ucs.test
+8
-0
mysql-test/t/func_op.test
mysql-test/t/func_op.test
+14
-0
mysql-test/t/view.test
mysql-test/t/view.test
+31
-0
sql/item_func.cc
sql/item_func.cc
+1
-4
sql/item_timefunc.cc
sql/item_timefunc.cc
+33
-14
sql/item_timefunc.h
sql/item_timefunc.h
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+1
-1
sql/share/errmsg.txt
sql/share/errmsg.txt
+2
-0
sql/sql_view.cc
sql/sql_view.cc
+19
-1
storage/myisam/mi_dynrec.c
storage/myisam/mi_dynrec.c
+5
-0
No files found.
config/ac-macros/misc.m4
View file @
96f43fdc
...
...
@@ -361,7 +361,8 @@ AC_CACHE_VAL(mysql_cv_termcap_lib,
[AC_CHECK_LIB(ncurses, tgetent, mysql_cv_termcap_lib=libncurses,
[AC_CHECK_LIB(curses, tgetent, mysql_cv_termcap_lib=libcurses,
[AC_CHECK_LIB(termcap, tgetent, mysql_cv_termcap_lib=libtermcap,
mysql_cv_termcap_lib=NOT_FOUND)])])])
[AC_CHECK_LIB(tinfo, tgetent, mysql_cv_termcap_lib=libtinfo,
mysql_cv_termcap_lib=NOT_FOUND)])])])])
AC_MSG_CHECKING(for termcap functions library)
if test "$mysql_cv_termcap_lib" = "NOT_FOUND"; then
AC_MSG_ERROR([No curses/termcap library found])
...
...
@@ -369,6 +370,8 @@ elif test "$mysql_cv_termcap_lib" = "libtermcap"; then
TERMCAP_LIB=-ltermcap
elif test "$mysql_cv_termcap_lib" = "libncurses"; then
TERMCAP_LIB=-lncurses
elif test "$mysql_cv_termcap_lib" = "libtinfo"; then
TERMCAP_LIB=-ltinfo
else
TERMCAP_LIB=-lcurses
fi
...
...
configure.in
View file @
96f43fdc
...
...
@@ -775,6 +775,9 @@ AC_SUBST(WRAPLIBS)
if
test
"
$TARGET_LINUX
"
=
"true"
;
then
AC_MSG_CHECKING
([
for
atomic operations]
)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
atom_ops
=
AC_TRY_RUN
([
#include <asm/atomic.h>
...
...
@@ -810,6 +813,8 @@ int main()
if
test
-z
"
$atom_ops
"
;
then
atom_ops
=
"no"
;
fi
AC_MSG_RESULT
(
$atom_ops
)
AC_LANG_RESTORE
AC_ARG_WITH
(
pstack,
[
--with-pstack
Use the pstack backtrace library],
[
USE_PSTACK
=
$withval
]
,
...
...
mysql-test/r/ctype_ucs.result
View file @
96f43fdc
...
...
@@ -674,6 +674,18 @@ Warnings:
Warning 1264 Out of range value for column 'Field1' at row 1
DROP TABLE t1;
SET NAMES latin1;
SELECT CONVERT(103, CHAR(50) UNICODE);
CONVERT(103, CHAR(50) UNICODE)
103
SELECT CONVERT(103.0, CHAR(50) UNICODE);
CONVERT(103.0, CHAR(50) UNICODE)
103.0
SELECT CONVERT(-103, CHAR(50) UNICODE);
CONVERT(-103, CHAR(50) UNICODE)
-103
SELECT CONVERT(-103.0, CHAR(50) UNICODE);
CONVERT(-103.0, CHAR(50) UNICODE)
-103.0
CREATE TABLE t1 (
a varchar(255) NOT NULL default '',
KEY a (a)
...
...
mysql-test/r/func_op.result
View file @
96f43fdc
...
...
@@ -35,3 +35,14 @@ select -1 >> 0, -1 << 0;
select -1 >> 1, -1 << 1;
-1 >> 1 -1 << 1
9223372036854775807 18446744073709551614
drop table if exists t1,t2;
create table t1(a int);
create table t2(a int, b int);
insert into t1 values (1), (2), (3);
insert into t2 values (1, 7), (3, 7);
select t1.a, t2.a, t2.b, bit_count(t2.b) from t1 left join t2 on t1.a=t2.a;
a a b bit_count(t2.b)
1 1 7 3
2 NULL NULL NULL
3 3 7 3
drop table t1, t2;
mysql-test/r/view.result
View file @
96f43fdc
...
...
@@ -2600,3 +2600,26 @@ id td
5 2005-01-04
DROP VIEW v1;
DROP TABLE t1;
create table t1 (a int);
create view v1 as select * from t1;
create view v2 as select * from v1;
drop table t1;
rename table v2 to t1;
select * from v1;
ERROR HY000: `test`.`v1` contain view recursion
drop view t1, v1;
create table t1 (a int);
create function f1() returns int
begin
declare mx int;
select max(a) from t1 into mx;
return mx;
end//
create view v1 as select f1() as a;
create view v2 as select * from v1;
drop table t1;
rename table v2 to t1;
select * from v1;
ERROR HY000: Recursive stored functions and triggers are not allowed.
drop function f1;
drop view t1, v1;
mysql-test/t/ctype_ucs.test
View file @
96f43fdc
...
...
@@ -409,6 +409,14 @@ INSERT INTO t1 VALUES ('-1');
DROP
TABLE
t1
;
SET
NAMES
latin1
;
#
# Bug#18691 Converting number to UNICODE string returns invalid result
#
SELECT
CONVERT
(
103
,
CHAR
(
50
)
UNICODE
);
SELECT
CONVERT
(
103.0
,
CHAR
(
50
)
UNICODE
);
SELECT
CONVERT
(
-
103
,
CHAR
(
50
)
UNICODE
);
SELECT
CONVERT
(
-
103.0
,
CHAR
(
50
)
UNICODE
);
#
# Bug#9557 MyISAM utf8 table crash
#
...
...
mysql-test/t/func_op.test
View file @
96f43fdc
...
...
@@ -17,4 +17,18 @@ select 0 | -1, 0 ^ -1, 0 & -1;
select
-
1
>>
0
,
-
1
<<
0
;
select
-
1
>>
1
,
-
1
<<
1
;
#
# Bug 13044: wrong bit_count() results
#
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
create
table
t1
(
a
int
);
create
table
t2
(
a
int
,
b
int
);
insert
into
t1
values
(
1
),
(
2
),
(
3
);
insert
into
t2
values
(
1
,
7
),
(
3
,
7
);
select
t1
.
a
,
t2
.
a
,
t2
.
b
,
bit_count
(
t2
.
b
)
from
t1
left
join
t2
on
t1
.
a
=
t2
.
a
;
drop
table
t1
,
t2
;
# End of 4.1 tests
mysql-test/t/view.test
View file @
96f43fdc
...
...
@@ -2459,3 +2459,34 @@ SELECT * FROM v1 WHERE td BETWEEN '2005.01.02' AND '2005.01.04';
DROP
VIEW
v1
;
DROP
TABLE
t1
;
#
# BUG#14308: Recursive view definitions
#
# using view only
create
table
t1
(
a
int
);
create
view
v1
as
select
*
from
t1
;
create
view
v2
as
select
*
from
v1
;
drop
table
t1
;
rename
table
v2
to
t1
;
--
error
ER_VIEW_RECURSIVE
select
*
from
v1
;
drop
view
t1
,
v1
;
# using SP function
create
table
t1
(
a
int
);
delimiter
//;
create
function
f1
()
returns
int
begin
declare
mx
int
;
select
max
(
a
)
from
t1
into
mx
;
return
mx
;
end
//
delimiter
;
//
create
view
v1
as
select
f1
()
as
a
;
create
view
v2
as
select
*
from
v1
;
drop
table
t1
;
rename
table
v2
to
t1
;
--
error
ER_SP_NO_RECURSION
select
*
from
v1
;
drop
function
f1
;
drop
view
t1
,
v1
;
sql/item_func.cc
View file @
96f43fdc
...
...
@@ -2489,11 +2489,8 @@ longlong Item_func_bit_count::val_int()
{
DBUG_ASSERT
(
fixed
==
1
);
ulonglong
value
=
(
ulonglong
)
args
[
0
]
->
val_int
();
if
(
args
[
0
]
->
null_value
)
{
null_value
=
1
;
/* purecov: inspected */
if
((
null_value
=
args
[
0
]
->
null_value
))
return
0
;
/* purecov: inspected */
}
return
(
longlong
)
my_count_bits
(
value
);
}
...
...
sql/item_timefunc.cc
View file @
96f43fdc
...
...
@@ -2255,7 +2255,7 @@ String *Item_char_typecast::val_str(String *str)
// Convert character set if differ
uint
dummy_errors
;
if
(
!
(
res
=
args
[
0
]
->
val_str
(
&
tmp_value
))
||
str
->
copy
(
res
->
ptr
(),
res
->
length
(),
res
->
charset
()
,
str
->
copy
(
res
->
ptr
(),
res
->
length
(),
from_cs
,
cast_cs
,
&
dummy_errors
))
{
null_value
=
1
;
...
...
@@ -2312,20 +2312,39 @@ void Item_char_typecast::fix_length_and_dec()
{
uint32
char_length
;
/*
We always force character set conversion if cast_cs is a
multi-byte character set. It garantees that the result of CAST is
a well-formed string. For single-byte character sets we allow
just to copy from the argument. A single-byte character sets
string is always well-formed.
We always force character set conversion if cast_cs
is a multi-byte character set. It garantees that the
result of CAST is a well-formed string.
For single-byte character sets we allow just to copy
from the argument. A single-byte character sets string
is always well-formed.
There is a special trick to convert form a number to ucs2.
As numbers have my_charset_bin as their character set,
it wouldn't do conversion to ucs2 without an additional action.
To force conversion, we should pretend to be non-binary.
Let's choose from_cs this way:
- If the argument in a number and cast_cs is ucs2 (i.e. mbminlen > 1),
then from_cs is set to latin1, to perform latin1 -> ucs2 conversion.
- If the argument is a number and cast_cs is ASCII-compatible
(i.e. mbminlen == 1), then from_cs is set to cast_cs,
which allows just to take over the args[0]->val_str() result
and thus avoid unnecessary character set conversion.
- If the argument is not a number, then from_cs is set to
the argument's charset.
*/
charset_conversion
=
((
cast_cs
->
mbmaxlen
>
1
)
||
!
my_charset_same
(
args
[
0
]
->
collation
.
collation
,
cast_cs
)
&&
args
[
0
]
->
collation
.
collation
!=
&
my_charset_bin
&&
cast_cs
!=
&
my_charset_bin
);
from_cs
=
(
args
[
0
]
->
result_type
()
==
INT_RESULT
||
args
[
0
]
->
result_type
()
==
DECIMAL_RESULT
||
args
[
0
]
->
result_type
()
==
REAL_RESULT
)
?
(
cast_cs
->
mbminlen
==
1
?
cast_cs
:
&
my_charset_latin1
)
:
args
[
0
]
->
collation
.
collation
;
charset_conversion
=
(
cast_cs
->
mbmaxlen
>
1
)
||
!
my_charset_same
(
from_cs
,
cast_cs
)
&&
from_cs
!=
&
my_charset_bin
&&
cast_cs
!=
&
my_charset_bin
;
collation
.
set
(
cast_cs
,
DERIVATION_IMPLICIT
);
char_length
=
(
cast_length
>=
0
)
?
cast_length
:
args
[
0
]
->
max_length
/
args
[
0
]
->
collation
.
collation
->
mbmaxlen
;
args
[
0
]
->
max_length
/
from_cs
->
mbmaxlen
;
max_length
=
char_length
*
cast_cs
->
mbmaxlen
;
}
...
...
sql/item_timefunc.h
View file @
96f43fdc
...
...
@@ -708,7 +708,7 @@ public:
class
Item_char_typecast
:
public
Item_typecast
{
int
cast_length
;
CHARSET_INFO
*
cast_cs
;
CHARSET_INFO
*
cast_cs
,
*
from_cs
;
bool
charset_conversion
;
String
tmp_value
;
public:
...
...
sql/mysqld.cc
View file @
96f43fdc
...
...
@@ -5931,7 +5931,7 @@ The minimum value for this variable is 4096.",
(
gptr
*
)
&
max_system_variables
.
max_length_for_sort_data
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
1024
,
4
,
8192
*
1024L
,
0
,
1
,
0
},
{
"max_prepared_stmt_count"
,
OPT_MAX_PREPARED_STMT_COUNT
,
"Maximum numb
r
er of prepared statements in the server."
,
"Maximum number of prepared statements in the server."
,
(
gptr
*
)
&
max_prepared_stmt_count
,
(
gptr
*
)
&
max_prepared_stmt_count
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
16382
,
0
,
1
*
1024
*
1024
,
0
,
1
,
0
},
{
"max_relay_log_size"
,
OPT_MAX_RELAY_LOG_SIZE
,
...
...
sql/share/errmsg.txt
View file @
96f43fdc
...
...
@@ -5836,3 +5836,5 @@ ER_WRONG_PARTITION_NAME
swe "Felaktigt partitionsnamn"
ER_MAX_PREPARED_STMT_COUNT_REACHED 42000
eng "Can't create more than max_prepared_stmt_count statements (current value: %lu)"
ER_VIEW_RECURSIVE
eng "`%-.64s`.`%-.64s` contain view recursion"
sql/sql_view.cc
View file @
96f43fdc
...
...
@@ -773,6 +773,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
SELECT_LEX
*
end
,
*
view_select
;
LEX
*
old_lex
,
*
lex
;
Query_arena
*
arena
,
backup
;
TABLE_LIST
*
top_view
=
table
->
top_table
();
int
res
;
bool
result
;
DBUG_ENTER
(
"mysql_make_view"
);
...
...
@@ -800,6 +801,24 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
DBUG_RETURN
(
0
);
}
/* check loop via view definition */
for
(
TABLE_LIST
*
precedent
=
table
->
referencing_view
;
precedent
;
precedent
=
precedent
->
referencing_view
)
{
if
(
precedent
->
view_name
.
length
==
table
->
table_name_length
&&
precedent
->
view_db
.
length
==
table
->
db_length
&&
my_strcasecmp
(
system_charset_info
,
precedent
->
view_name
.
str
,
table
->
table_name
)
==
0
&&
my_strcasecmp
(
system_charset_info
,
precedent
->
view_db
.
str
,
table
->
db
)
==
0
)
{
my_error
(
ER_VIEW_RECURSIVE
,
MYF
(
0
),
top_view
->
view_db
.
str
,
top_view
->
view_name
.
str
);
DBUG_RETURN
(
TRUE
);
}
}
/*
For now we assume that tables will not be changed during PS life (it
will be TRUE as far as we make new table cache).
...
...
@@ -898,7 +917,6 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
}
if
(
!
res
&&
!
thd
->
is_fatal_error
)
{
TABLE_LIST
*
top_view
=
table
->
top_table
();
TABLE_LIST
*
view_tables
=
lex
->
query_tables
;
TABLE_LIST
*
view_tables_tail
=
0
;
TABLE_LIST
*
tbl
;
...
...
storage/myisam/mi_dynrec.c
View file @
96f43fdc
...
...
@@ -67,6 +67,11 @@ static int _mi_cmp_buffer(File file, const byte *buff, my_off_t filepos,
my_bool
mi_dynmap_file
(
MI_INFO
*
info
,
my_off_t
size
)
{
DBUG_ENTER
(
"mi_dynmap_file"
);
if
(
size
>
(
my_off_t
)
(
~
((
size_t
)
0
))
-
MEMMAP_EXTRA_MARGIN
)
{
DBUG_PRINT
(
"warning"
,
(
"File is too large for mmap"
));
DBUG_RETURN
(
1
);
}
info
->
s
->
file_map
=
(
byte
*
)
my_mmap
(
0
,
(
size_t
)(
size
+
MEMMAP_EXTRA_MARGIN
),
info
->
s
->
mode
==
O_RDONLY
?
PROT_READ
:
...
...
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