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
94779963
Commit
94779963
authored
Jan 19, 2007
by
mtaylor@qualinost.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into qualinost.(none):/home/mtaylor/src/mysql-5.0-maint
parents
3fdf318e
205f7a05
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
71 additions
and
29 deletions
+71
-29
mysql-test/r/range.result
mysql-test/r/range.result
+2
-2
mysql-test/r/select.result
mysql-test/r/select.result
+17
-0
mysql-test/r/type_bit.result
mysql-test/r/type_bit.result
+1
-1
mysql-test/r/type_bit_innodb.result
mysql-test/r/type_bit_innodb.result
+1
-1
mysql-test/t/ps.test
mysql-test/t/ps.test
+2
-0
mysql-test/t/range.test
mysql-test/t/range.test
+2
-2
mysql-test/t/select.test
mysql-test/t/select.test
+12
-1
mysys/string.c
mysys/string.c
+13
-15
sql/field.cc
sql/field.cc
+2
-0
sql/item.cc
sql/item.cc
+19
-6
tests/mysql_client_test.c
tests/mysql_client_test.c
+0
-1
No files found.
mysql-test/r/range.result
View file @
94779963
...
@@ -521,8 +521,8 @@ select count(*) from t1 where x = 18446744073709551601;
...
@@ -521,8 +521,8 @@ select count(*) from t1 where x = 18446744073709551601;
count(*)
count(*)
1
1
create table t2 (x bigint not null);
create table t2 (x bigint not null);
insert into t2(x) values (
cast(0xfffffffffffffff0+0 as signed)
);
insert into t2(x) values (
-16
);
insert into t2(x) values (
cast(0xfffffffffffffff1+0 as signed)
);
insert into t2(x) values (
-15
);
select * from t2;
select * from t2;
x
x
-16
-16
...
...
mysql-test/r/select.result
View file @
94779963
...
@@ -2811,6 +2811,23 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
...
@@ -2811,6 +2811,23 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
min(key1)
min(key1)
0.37619999051094
0.37619999051094
DROP TABLE t1,t2;
DROP TABLE t1,t2;
create table t1(a bigint unsigned, b bigint);
insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),
(0x10000000000000000, 0x10000000000000000),
(0x8fffffffffffffff, 0x8fffffffffffffff);
Warnings:
Warning 1264 Out of range value adjusted for column 'a' at row 1
Warning 1264 Out of range value adjusted for column 'b' at row 1
Warning 1264 Out of range value adjusted for column 'a' at row 2
Warning 1264 Out of range value adjusted for column 'b' at row 2
Warning 1264 Out of range value adjusted for column 'b' at row 3
select hex(a), hex(b) from t1;
hex(a) hex(b)
FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
drop table t1;
End of 4.1 tests
CREATE TABLE t1 (
CREATE TABLE t1 (
K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '',
K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '',
K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000',
K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000',
...
...
mysql-test/r/type_bit.result
View file @
94779963
...
@@ -568,7 +568,7 @@ create table t1 (a bit(7));
...
@@ -568,7 +568,7 @@ create table t1 (a bit(7));
insert into t1 values (0x60);
insert into t1 values (0x60);
select * from t1;
select * from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 a a 16 7 1 Y
0
0 63
def test t1 t1 a a 16 7 1 Y
32
0 63
a
a
`
`
drop table t1;
drop table t1;
...
...
mysql-test/r/type_bit_innodb.result
View file @
94779963
...
@@ -406,7 +406,7 @@ create table t1 (a bit(7)) engine=innodb;
...
@@ -406,7 +406,7 @@ create table t1 (a bit(7)) engine=innodb;
insert into t1 values (0x60);
insert into t1 values (0x60);
select * from t1;
select * from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 a a 16 7 1 Y
0
0 63
def test t1 t1 a a 16 7 1 Y
32
0 63
a
a
`
`
drop table t1;
drop table t1;
...
...
mysql-test/t/ps.test
View file @
94779963
...
@@ -1171,6 +1171,7 @@ deallocate prepare stmt2;
...
@@ -1171,6 +1171,7 @@ deallocate prepare stmt2;
# Protect ourselves from data left in tmp/ by a previos possibly failed
# Protect ourselves from data left in tmp/ by a previos possibly failed
# test
# test
--
system
rm
-
f
$MYSQLTEST_VARDIR
/
tmp
/
t1
.*
--
system
rm
-
f
$MYSQLTEST_VARDIR
/
tmp
/
t1
.*
--
disable_warnings
--
disable_query_log
--
disable_query_log
eval
prepare
stmt
from
"create table t1 (c char(10)) data directory='
$MYSQLTEST_VARDIR
/tmp'"
;
eval
prepare
stmt
from
"create table t1 (c char(10)) data directory='
$MYSQLTEST_VARDIR
/tmp'"
;
--
enable_query_log
--
enable_query_log
...
@@ -1190,6 +1191,7 @@ execute stmt;
...
@@ -1190,6 +1191,7 @@ execute stmt;
--
disable_result_log
--
disable_result_log
show
create
table
t1
;
show
create
table
t1
;
--
enable_result_log
--
enable_result_log
--
enable_warnings
drop
table
t1
;
drop
table
t1
;
deallocate
prepare
stmt
;
deallocate
prepare
stmt
;
...
...
mysql-test/t/range.test
View file @
94779963
...
@@ -406,8 +406,8 @@ select count(*) from t1 where x = 18446744073709551601;
...
@@ -406,8 +406,8 @@ select count(*) from t1 where x = 18446744073709551601;
create
table
t2
(
x
bigint
not
null
);
create
table
t2
(
x
bigint
not
null
);
insert
into
t2
(
x
)
values
(
cast
(
0xfffffffffffffff0
+
0
as
signed
)
);
insert
into
t2
(
x
)
values
(
-
16
);
insert
into
t2
(
x
)
values
(
cast
(
0xfffffffffffffff1
+
0
as
signed
)
);
insert
into
t2
(
x
)
values
(
-
15
);
select
*
from
t2
;
select
*
from
t2
;
select
count
(
*
)
from
t2
where
x
>
0
;
select
count
(
*
)
from
t2
where
x
>
0
;
select
count
(
*
)
from
t2
where
x
=
0
;
select
count
(
*
)
from
t2
where
x
=
0
;
...
...
mysql-test/t/select.test
View file @
94779963
...
@@ -2349,7 +2349,18 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
...
@@ -2349,7 +2349,18 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
--
enable_ps_protocol
--
enable_ps_protocol
# End of 4.1 tests
#
# Bug #22533: storing large hex strings
#
create
table
t1
(
a
bigint
unsigned
,
b
bigint
);
insert
into
t1
values
(
0xfffffffffffffffff
,
0xfffffffffffffffff
),
(
0x10000000000000000
,
0x10000000000000000
),
(
0x8fffffffffffffff
,
0x8fffffffffffffff
);
select
hex
(
a
),
hex
(
b
)
from
t1
;
drop
table
t1
;
--
echo
End
of
4.1
tests
#
#
# Test for bug #6474
# Test for bug #6474
...
...
mysys/string.c
View file @
94779963
...
@@ -131,37 +131,35 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
...
@@ -131,37 +131,35 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
my_bool
dynstr_append_os_quoted
(
DYNAMIC_STRING
*
str
,
const
char
*
append
,
...)
my_bool
dynstr_append_os_quoted
(
DYNAMIC_STRING
*
str
,
const
char
*
append
,
...)
{
{
#ifdef __WIN__
#ifdef __WIN__
char
quote_str
[]
=
"
\"
"
;
const
char
*
quote_str
=
"
\"
"
;
const
uint
quote_len
=
1
;
#else
#else
char
quote_str
[]
=
"
\'
"
;
const
char
*
quote_str
=
"
\'
"
;
const
uint
quote_len
=
1
;
#endif
/* __WIN__ */
#endif
/* __WIN__ */
my_bool
ret
=
TRUE
;
my_bool
ret
=
TRUE
;
va_list
dirty_text
;
va_list
dirty_text
;
ret
&=
dynstr_append
(
str
,
quote_str
);
/* Leading quote */
ret
&=
dynstr_append
_mem
(
str
,
quote_str
,
quote_len
);
/* Leading quote */
va_start
(
dirty_text
,
append
);
va_start
(
dirty_text
,
append
);
while
(
append
!=
NullS
)
while
(
append
!=
NullS
)
{
{
c
har
*
cur_pos
=
append
;
c
onst
char
*
cur_pos
=
append
;
char
*
next_pos
=
cur_pos
;
c
onst
c
har
*
next_pos
=
cur_pos
;
/* Search for quote in each string and replace with escaped quote */
/* Search for quote in each string and replace with escaped quote */
while
(
*
(
next_pos
=
strcend
(
cur_pos
,
quote_str
[
0
]))
!=
'\0'
)
while
(
*
(
next_pos
=
strcend
(
cur_pos
,
quote_str
[
0
]))
!=
'\0'
)
{
{
char
*
tmp_buff
=
my_malloc
((
next_pos
-
cur_pos
)
+
1
,
MYF
(
MY_ZEROFILL
));
ret
&=
dynstr_append_mem
(
str
,
cur_pos
,
next_pos
-
cur_pos
);
strnmov
(
tmp_buff
,
cur_pos
,
(
next_pos
-
cur_pos
));
ret
&=
dynstr_append_mem
(
str
,
"
\\
"
,
1
);
ret
&=
dynstr_append
(
str
,
tmp_buff
);
ret
&=
dynstr_append_mem
(
str
,
quote_str
,
quote_len
);
my_free
((
gptr
)
tmp_buff
,
MYF
(
0
));
ret
&=
dynstr_append
(
str
,
"
\\
"
);
ret
&=
dynstr_append
(
str
,
quote_str
);
cur_pos
=
next_pos
+
1
;
cur_pos
=
next_pos
+
1
;
}
}
ret
&=
dynstr_append
(
str
,
cur_pos
);
ret
&=
dynstr_append
_mem
(
str
,
cur_pos
,
next_pos
-
cur_pos
);
append
=
va_arg
(
dirty_text
,
char
*
);
append
=
va_arg
(
dirty_text
,
char
*
);
}
}
va_end
(
dirty_text
);
va_end
(
dirty_text
);
ret
&=
dynstr_append
(
str
,
quote_str
);
/* Trailing quote */
ret
&=
dynstr_append
_mem
(
str
,
quote_str
,
quote_len
);
/* Trailing quote */
return
ret
;
return
ret
;
}
}
...
...
sql/field.cc
View file @
94779963
...
@@ -8037,6 +8037,7 @@ Field_bit::Field_bit(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
...
@@ -8037,6 +8037,7 @@ Field_bit::Field_bit(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
bit_ptr
(
bit_ptr_arg
),
bit_ofs
(
bit_ofs_arg
),
bit_len
(
len_arg
&
7
),
bit_ptr
(
bit_ptr_arg
),
bit_ofs
(
bit_ofs_arg
),
bit_len
(
len_arg
&
7
),
bytes_in_rec
(
len_arg
/
8
)
bytes_in_rec
(
len_arg
/
8
)
{
{
flags
|=
UNSIGNED_FLAG
;
/*
/*
Ensure that Field::eq() can distinguish between two different bit fields.
Ensure that Field::eq() can distinguish between two different bit fields.
(two bit fields that are not null, may have same ptr and null_ptr)
(two bit fields that are not null, may have same ptr and null_ptr)
...
@@ -8276,6 +8277,7 @@ Field_bit_as_char::Field_bit_as_char(char *ptr_arg, uint32 len_arg,
...
@@ -8276,6 +8277,7 @@ Field_bit_as_char::Field_bit_as_char(char *ptr_arg, uint32 len_arg,
:
Field_bit
(
ptr_arg
,
len_arg
,
null_ptr_arg
,
null_bit_arg
,
0
,
:
Field_bit
(
ptr_arg
,
len_arg
,
null_ptr_arg
,
null_bit_arg
,
0
,
0
,
unireg_check_arg
,
field_name_arg
,
table_arg
)
0
,
unireg_check_arg
,
field_name_arg
,
table_arg
)
{
{
flags
|=
UNSIGNED_FLAG
;
bit_len
=
0
;
bit_len
=
0
;
bytes_in_rec
=
(
len_arg
+
7
)
/
8
;
bytes_in_rec
=
(
len_arg
+
7
)
/
8
;
}
}
...
...
sql/item.cc
View file @
94779963
...
@@ -4553,18 +4553,31 @@ my_decimal *Item_hex_string::val_decimal(my_decimal *decimal_value)
...
@@ -4553,18 +4553,31 @@ my_decimal *Item_hex_string::val_decimal(my_decimal *decimal_value)
int
Item_hex_string
::
save_in_field
(
Field
*
field
,
bool
no_conversions
)
int
Item_hex_string
::
save_in_field
(
Field
*
field
,
bool
no_conversions
)
{
{
int
error
;
field
->
set_notnull
();
field
->
set_notnull
();
if
(
field
->
result_type
()
==
STRING_RESULT
)
if
(
field
->
result_type
()
==
STRING_RESULT
)
return
field
->
store
(
str_value
.
ptr
(),
str_value
.
length
(),
collation
.
collation
);
ulonglong
nr
;
uint32
length
=
str_value
.
length
();
if
(
length
>
8
)
{
{
error
=
field
->
store
(
str_value
.
ptr
(),
str_value
.
length
(),
collation
.
collation
);
nr
=
field
->
flags
&
UNSIGNED_FLAG
?
ULONGLONG_MAX
:
LONGLONG_MAX
;
goto
warn
;
}
}
else
nr
=
(
ulonglong
)
val_int
();
if
((
length
==
8
)
&&
!
(
field
->
flags
&
UNSIGNED_FLAG
)
&&
(
nr
>
LONGLONG_MAX
))
{
{
longlong
nr
=
val_int
()
;
nr
=
LONGLONG_MAX
;
error
=
field
->
store
(
nr
,
TRUE
);
// Assume hex numbers are unsigned
goto
warn
;
}
}
return
error
;
return
field
->
store
((
longlong
)
nr
,
TRUE
);
// Assume hex numbers are unsigned
warn:
if
(
!
field
->
store
((
longlong
)
nr
,
TRUE
))
field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_DATA_OUT_OF_RANGE
,
1
);
return
1
;
}
}
...
...
tests/mysql_client_test.c
View file @
94779963
...
@@ -12923,7 +12923,6 @@ static void test_bug15518()
...
@@ -12923,7 +12923,6 @@ static void test_bug15518()
DIE_UNLESS
(
rc
&&
mysql_stmt_errno
(
stmt
));
DIE_UNLESS
(
rc
&&
mysql_stmt_errno
(
stmt
));
mysql_stmt_close
(
stmt
);
mysql_stmt_close
(
stmt
);
DIE_UNLESS
(
mysql_errno
(
mysql1
));
}
}
...
...
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