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
8d616390
Commit
8d616390
authored
Jan 15, 2005
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
After merge fixes
Fix for BIT(X) field as string
parent
3b0f8cab
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
80 additions
and
37 deletions
+80
-37
mysql-test/r/func_gconcat.result
mysql-test/r/func_gconcat.result
+5
-5
mysql-test/r/func_sapdb.result
mysql-test/r/func_sapdb.result
+3
-3
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+4
-4
mysql-test/r/ps_1general.result
mysql-test/r/ps_1general.result
+1
-0
mysql-test/r/type_bit.result
mysql-test/r/type_bit.result
+11
-0
mysql-test/t/ps_1general.test
mysql-test/t/ps_1general.test
+1
-0
mysql-test/t/type_bit.test
mysql-test/t/type_bit.test
+9
-0
sql/field.cc
sql/field.cc
+4
-2
sql/item.h
sql/item.h
+6
-4
sql/item_func.h
sql/item_func.h
+9
-5
sql/item_sum.h
sql/item_sum.h
+6
-4
sql/procedure.h
sql/procedure.h
+13
-4
sql/sql_base.cc
sql/sql_base.cc
+8
-6
No files found.
mysql-test/r/func_gconcat.result
View file @
8d616390
...
@@ -457,6 +457,11 @@ group_concat(distinct b order by b)
...
@@ -457,6 +457,11 @@ group_concat(distinct b order by b)
Warnings:
Warnings:
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
drop table t1;
drop table t1;
CREATE TABLE t1 (id int);
SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL;
gc
NULL
DROP TABLE t1;
create table t1 (a char(3), b char(20), primary key (a, b));
create table t1 (a char(3), b char(20), primary key (a, b));
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
select group_concat(a) from t1 group by b;
select group_concat(a) from t1 group by b;
...
@@ -464,8 +469,3 @@ group_concat(a)
...
@@ -464,8 +469,3 @@ group_concat(a)
ABW
ABW
ABW
ABW
drop table t1;
drop table t1;
CREATE TABLE t1 (id int);
SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL;
gc
NULL
DROP TABLE t1;
mysql-test/r/func_sapdb.result
View file @
8d616390
...
@@ -107,7 +107,7 @@ timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002")
...
@@ -107,7 +107,7 @@ timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002")
46:58:57.999999
46:58:57.999999
select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002");
select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002");
timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002")
timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002")
-2
4:00:00.000001
-2
3:59:59.999999
select timediff("1997-12-31 23:59:59.000001","23:59:59.000001");
select timediff("1997-12-31 23:59:59.000001","23:59:59.000001");
timediff("1997-12-31 23:59:59.000001","23:59:59.000001")
timediff("1997-12-31 23:59:59.000001","23:59:59.000001")
NULL
NULL
...
@@ -116,7 +116,7 @@ timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001")
...
@@ -116,7 +116,7 @@ timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001")
-00:00:00.000001
-00:00:00.000001
select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50");
select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50");
timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50")
timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50")
-00:00:0
0.000001
-00:00:0
1.999999
select maketime(10,11,12);
select maketime(10,11,12);
maketime(10,11,12)
maketime(10,11,12)
10:11:12
10:11:12
...
@@ -188,7 +188,7 @@ f8 date YES NULL
...
@@ -188,7 +188,7 @@ f8 date YES NULL
f9 time YES NULL
f9 time YES NULL
select * from t1;
select * from t1;
f1 f2 f3 f4 f5 f6 f7 f8 f9
f1 f2 f3 f4 f5 f6 f7 f8 f9
1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -2
4:00:00
10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59
1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -2
3:59:59
10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59
create table test(t1 datetime, t2 time, t3 time, t4 datetime);
create table test(t1 datetime, t2 time, t3 time, t4 datetime);
insert into test values
insert into test values
('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'),
('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'),
...
...
mysql-test/r/innodb.result
View file @
8d616390
...
@@ -1326,8 +1326,8 @@ truncate table t1;
...
@@ -1326,8 +1326,8 @@ truncate table t1;
insert into t1 (a) values (NULL),(NULL);
insert into t1 (a) values (NULL),(NULL);
SELECT * from t1;
SELECT * from t1;
a
a
3
1
4
2
drop table t1;
drop table t1;
CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
...
@@ -1690,13 +1690,13 @@ Variable_name Value
...
@@ -1690,13 +1690,13 @@ Variable_name Value
Innodb_page_size 16384
Innodb_page_size 16384
show status like "Innodb_rows_deleted";
show status like "Innodb_rows_deleted";
Variable_name Value
Variable_name Value
Innodb_rows_deleted 207
8
Innodb_rows_deleted 207
0
show status like "Innodb_rows_inserted";
show status like "Innodb_rows_inserted";
Variable_name Value
Variable_name Value
Innodb_rows_inserted 31706
Innodb_rows_inserted 31706
show status like "Innodb_rows_read";
show status like "Innodb_rows_read";
Variable_name Value
Variable_name Value
Innodb_rows_read 801
61
Innodb_rows_read 801
53
show status like "Innodb_rows_updated";
show status like "Innodb_rows_updated";
Variable_name Value
Variable_name Value
Innodb_rows_updated 29530
Innodb_rows_updated 29530
...
...
mysql-test/r/ps_1general.result
View file @
8d616390
...
@@ -295,6 +295,7 @@ execute stmt4;
...
@@ -295,6 +295,7 @@ execute stmt4;
prepare stmt4 from ' show full processlist ';
prepare stmt4 from ' show full processlist ';
execute stmt4;
execute stmt4;
Id User Host db Command Time State Info
Id User Host db Command Time State Info
number root localhost test Query time NULL show full processlist
prepare stmt4 from ' show grants for user ';
prepare stmt4 from ' show grants for user ';
prepare stmt4 from ' show create table t2 ';
prepare stmt4 from ' show create table t2 ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
ERROR HY000: This command is not supported in the prepared statement protocol yet
...
...
mysql-test/r/type_bit.result
View file @
8d616390
...
@@ -368,3 +368,14 @@ a+0
...
@@ -368,3 +368,14 @@ a+0
44
44
57
57
drop table t1;
drop table t1;
create table t1 (a bit(3), b bit(12));
insert into t1 values (7,(1<<12)-2), (0x01,0x01ff);
select hex(a),hex(b) from t1;
hex(a) hex(b)
7 FFE
1 1FF
select hex(concat(a)),hex(concat(b)) from t1;
hex(concat(a)) hex(concat(b))
07 0FFE
01 01FF
drop table t1;
mysql-test/t/ps_1general.test
View file @
8d616390
...
@@ -321,6 +321,7 @@ prepare stmt4 from ' show engine bdb logs ';
...
@@ -321,6 +321,7 @@ prepare stmt4 from ' show engine bdb logs ';
execute
stmt4
;
execute
stmt4
;
--
enable_result_log
--
enable_result_log
prepare
stmt4
from
' show full processlist '
;
prepare
stmt4
from
' show full processlist '
;
--
replace_column
1
number
6
time
execute
stmt4
;
execute
stmt4
;
prepare
stmt4
from
' show grants for user '
;
prepare
stmt4
from
' show grants for user '
;
--
error
1295
--
error
1295
...
...
mysql-test/t/type_bit.test
View file @
8d616390
...
@@ -106,3 +106,12 @@ create table t1 (a bit(7), key(a));
...
@@ -106,3 +106,12 @@ create table t1 (a bit(7), key(a));
insert
into
t1
values
(
44
),
(
57
);
insert
into
t1
values
(
44
),
(
57
);
select
a
+
0
from
t1
;
select
a
+
0
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Test conversion to and from strings
#
create
table
t1
(
a
bit
(
3
),
b
bit
(
12
));
insert
into
t1
values
(
7
,(
1
<<
12
)
-
2
),
(
0x01
,
0x01ff
);
select
hex
(
a
),
hex
(
b
)
from
t1
;
select
hex
(
concat
(
a
)),
hex
(
concat
(
b
))
from
t1
;
drop
table
t1
;
sql/field.cc
View file @
8d616390
...
@@ -5358,7 +5358,7 @@ double Field_blob::val_real(void)
...
@@ -5358,7 +5358,7 @@ double Field_blob::val_real(void)
return
0.0
;
return
0.0
;
length
=
get_length
(
ptr
);
length
=
get_length
(
ptr
);
cs
=
charset
();
cs
=
charset
();
return
my_strntod
(
cs
,
blob
,
length
,(
char
**
)
0
,
&
not_used
);
return
my_strntod
(
cs
,
blob
,
length
,
&
end_not_used
,
&
not_used
);
}
}
...
@@ -6362,11 +6362,13 @@ longlong Field_bit::val_int(void)
...
@@ -6362,11 +6362,13 @@ longlong Field_bit::val_int(void)
String
*
Field_bit
::
val_str
(
String
*
val_buffer
,
String
*
Field_bit
::
val_str
(
String
*
val_buffer
,
String
*
val_ptr
__attribute__
((
unused
)))
String
*
val_ptr
__attribute__
((
unused
)))
{
{
char
buff
[
sizeof
(
longlong
)];
uint
length
=
min
(
pack_length
(),
sizeof
(
longlong
));
uint
length
=
min
(
pack_length
(),
sizeof
(
longlong
));
ulonglong
bits
=
val_int
();
ulonglong
bits
=
val_int
();
mi_int8store
(
buff
,
bits
);
val_buffer
->
alloc
(
length
);
val_buffer
->
alloc
(
length
);
memcpy_fixed
((
char
*
)
val_buffer
->
ptr
(),
(
char
*
)
&
bits
,
length
);
memcpy_fixed
((
char
*
)
val_buffer
->
ptr
(),
buff
+
8
-
length
,
length
);
val_buffer
->
length
(
length
);
val_buffer
->
length
(
length
);
val_buffer
->
set_charset
(
&
my_charset_bin
);
val_buffer
->
set_charset
(
&
my_charset_bin
);
return
val_buffer
;
return
val_buffer
;
...
...
sql/item.h
View file @
8d616390
...
@@ -877,9 +877,10 @@ public:
...
@@ -877,9 +877,10 @@ public:
double
val_real
()
double
val_real
()
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
int
err
;
int
err_not_used
;
char
*
end_not_used
;
return
my_strntod
(
str_value
.
charset
(),
(
char
*
)
str_value
.
ptr
(),
return
my_strntod
(
str_value
.
charset
(),
(
char
*
)
str_value
.
ptr
(),
str_value
.
length
(),
(
char
**
)
0
,
&
err
);
str_value
.
length
(),
&
end_not_used
,
&
err_not_used
);
}
}
longlong
val_int
()
longlong
val_int
()
{
{
...
@@ -1230,10 +1231,11 @@ public:
...
@@ -1230,10 +1231,11 @@ public:
enum_field_types
field_type
()
const
{
return
cached_field_type
;
}
enum_field_types
field_type
()
const
{
return
cached_field_type
;
}
double
val_real
()
double
val_real
()
{
{
int
err
;
int
err_not_used
;
char
*
end_not_used
;
return
(
null_value
?
0.0
:
return
(
null_value
?
0.0
:
my_strntod
(
str_value
.
charset
(),
(
char
*
)
str_value
.
ptr
(),
my_strntod
(
str_value
.
charset
(),
(
char
*
)
str_value
.
ptr
(),
str_value
.
length
(),
NULL
,
&
err
));
str_value
.
length
(),
&
end_not_used
,
&
err_not_used
));
}
}
longlong
val_int
()
longlong
val_int
()
{
{
...
...
sql/item_func.h
View file @
8d616390
...
@@ -834,15 +834,19 @@ public:
...
@@ -834,15 +834,19 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
double
val_real
()
double
val_real
()
{
{
int
err
;
int
err_not_used
;
String
*
res
;
res
=
val_str
(
&
str_value
);
char
*
end_not_used
;
return
res
?
my_strntod
(
res
->
charset
(),(
char
*
)
res
->
ptr
(),
res
->
length
(),
0
,
&
err
)
:
0.0
;
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
my_strntod
(
res
->
charset
(),(
char
*
)
res
->
ptr
(),
res
->
length
(),
&
end_not_used
,
&
err_not_used
)
:
0.0
;
}
}
longlong
val_int
()
longlong
val_int
()
{
{
int
err
;
int
err
_not_used
;
String
*
res
;
res
=
val_str
(
&
str_value
);
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
my_strntoll
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),
10
,(
char
**
)
0
,
&
err
)
:
(
longlong
)
0
;
return
res
?
my_strntoll
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),
10
,
(
char
**
)
0
,
&
err_not_used
)
:
(
longlong
)
0
;
}
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
...
...
sql/item_sum.h
View file @
8d616390
...
@@ -643,16 +643,18 @@ public:
...
@@ -643,16 +643,18 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
double
val_real
()
double
val_real
()
{
{
int
err
;
int
err_not_used
;
char
*
end_not_used
;
String
*
res
;
res
=
val_str
(
&
str_value
);
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
my_strntod
(
res
->
charset
(),(
char
*
)
res
->
ptr
(),
res
->
length
(),
return
res
?
my_strntod
(
res
->
charset
(),(
char
*
)
res
->
ptr
(),
res
->
length
(),
(
char
**
)
0
,
&
err
)
:
0.0
;
&
end_not_used
,
&
err_not_used
)
:
0.0
;
}
}
longlong
val_int
()
longlong
val_int
()
{
{
int
err
;
int
err
_not_used
;
String
*
res
;
res
=
val_str
(
&
str_value
);
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
my_strntoll
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),
10
,
(
char
**
)
0
,
&
err
)
:
(
longlong
)
0
;
return
res
?
my_strntoll
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),
10
,
(
char
**
)
0
,
&
err_not_used
)
:
(
longlong
)
0
;
}
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
...
...
sql/procedure.h
View file @
8d616390
...
@@ -59,10 +59,18 @@ public:
...
@@ -59,10 +59,18 @@ public:
void
set
(
double
nr
)
{
value
=
nr
;
}
void
set
(
double
nr
)
{
value
=
nr
;
}
void
set
(
longlong
nr
)
{
value
=
(
double
)
nr
;
}
void
set
(
longlong
nr
)
{
value
=
(
double
)
nr
;
}
void
set
(
const
char
*
str
,
uint
length
,
CHARSET_INFO
*
cs
)
void
set
(
const
char
*
str
,
uint
length
,
CHARSET_INFO
*
cs
)
{
int
err
;
value
=
my_strntod
(
cs
,(
char
*
)
str
,
length
,(
char
**
)
0
,
&
err
);
}
{
int
err_not_used
;
char
*
end_not_used
;
value
=
my_strntod
(
cs
,(
char
*
)
str
,
length
,
&
end_not_used
,
&
err_not_used
);
}
double
val_real
()
{
return
value
;
}
double
val_real
()
{
return
value
;
}
longlong
val_int
()
{
return
(
longlong
)
value
;
}
longlong
val_int
()
{
return
(
longlong
)
value
;
}
String
*
val_str
(
String
*
s
)
{
s
->
set
(
value
,
decimals
,
default_charset
());
return
s
;
}
String
*
val_str
(
String
*
s
)
{
s
->
set
(
value
,
decimals
,
default_charset
());
return
s
;
}
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
};
};
...
@@ -98,10 +106,11 @@ public:
...
@@ -98,10 +106,11 @@ public:
{
str_value
.
copy
(
str
,
length
,
cs
);
}
{
str_value
.
copy
(
str
,
length
,
cs
);
}
double
val_real
()
double
val_real
()
{
{
int
err
;
int
err_not_used
;
char
*
end_not_used
;
CHARSET_INFO
*
cs
=
str_value
.
charset
();
CHARSET_INFO
*
cs
=
str_value
.
charset
();
return
my_strntod
(
cs
,
(
char
*
)
str_value
.
ptr
(),
str_value
.
length
(),
return
my_strntod
(
cs
,
(
char
*
)
str_value
.
ptr
(),
str_value
.
length
(),
(
char
**
)
0
,
&
err
);
&
end_not_used
,
&
err_not_used
);
}
}
longlong
val_int
()
longlong
val_int
()
{
{
...
...
sql/sql_base.cc
View file @
8d616390
...
@@ -1853,8 +1853,8 @@ int simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables)
...
@@ -1853,8 +1853,8 @@ int simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables)
bool
open_and_lock_tables
(
THD
*
thd
,
TABLE_LIST
*
tables
)
bool
open_and_lock_tables
(
THD
*
thd
,
TABLE_LIST
*
tables
)
{
{
DBUG_ENTER
(
"open_and_lock_tables"
);
uint
counter
;
uint
counter
;
DBUG_ENTER
(
"open_and_lock_tables"
);
if
(
open_tables
(
thd
,
tables
,
&
counter
)
||
if
(
open_tables
(
thd
,
tables
,
&
counter
)
||
lock_tables
(
thd
,
tables
,
counter
)
||
lock_tables
(
thd
,
tables
,
counter
)
||
mysql_handle_derived
(
thd
->
lex
,
&
mysql_derived_prepare
)
||
mysql_handle_derived
(
thd
->
lex
,
&
mysql_derived_prepare
)
||
...
@@ -1883,14 +1883,16 @@ bool open_and_lock_tables(THD *thd, TABLE_LIST *tables)
...
@@ -1883,14 +1883,16 @@ bool open_and_lock_tables(THD *thd, TABLE_LIST *tables)
data from the tables.
data from the tables.
*/
*/
int
open_normal_and_derived_tables
(
THD
*
thd
,
TABLE_LIST
*
tables
)
bool
open_normal_and_derived_tables
(
THD
*
thd
,
TABLE_LIST
*
tables
)
{
{
uint
counter
;
uint
counter
;
DBUG_ENTER
(
"open_normal_and_derived_tables"
);
DBUG_ENTER
(
"open_normal_and_derived_tables"
);
if
(
open_tables
(
thd
,
tables
,
&
counter
))
DBUG_ASSERT
(
!
thd
->
fill_derived_tables
());
DBUG_RETURN
(
-
1
);
/* purecov: inspected */
if
(
open_tables
(
thd
,
tables
,
&
counter
)
||
relink_tables_for_derived
(
thd
);
mysql_handle_derived
(
thd
->
lex
,
&
mysql_derived_prepare
))
DBUG_RETURN
(
mysql_handle_derived
(
thd
->
lex
));
DBUG_RETURN
(
TRUE
);
/* purecov: inspected */
relink_tables_for_multidelete
(
thd
);
// Not really needed, but
DBUG_RETURN
(
0
);
}
}
...
...
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