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
0e38e9fc
Commit
0e38e9fc
authored
Mar 25, 2003
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Plain Diff
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.0
into sinisa.nasamreza.org:/mnt/work/mysql-4.0
parents
a71abe82
8c36b3b4
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
49 additions
and
26 deletions
+49
-26
myisam/mi_dynrec.c
myisam/mi_dynrec.c
+1
-1
mysql-test/r/having.result
mysql-test/r/having.result
+7
-0
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+2
-2
mysql-test/r/variables.result
mysql-test/r/variables.result
+5
-0
mysql-test/t/having.test
mysql-test/t/having.test
+4
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+2
-2
mysql-test/t/variables.test
mysql-test/t/variables.test
+7
-0
sql/item_func.cc
sql/item_func.cc
+20
-20
sql/set_var.cc
sql/set_var.cc
+1
-1
No files found.
myisam/mi_dynrec.c
View file @
0e38e9fc
...
...
@@ -62,7 +62,7 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record)
extra
=
(
ALIGN_SIZE
(
MI_MAX_DYN_BLOCK_HEADER
)
+
MI_SPLIT_LENGTH
+
MI_DYN_DELETE_BLOCK_HEADER
+
1
);
reclength
=
(
info
->
s
->
base
.
pack_reclength
+
reclength
=
(
info
->
s
->
base
.
pack_reclength
+
info
->
s
->
base
.
pack_bits
+
_my_calc_total_blob_length
(
info
,
record
)
+
extra
);
#ifdef NOT_USED
/* We now support big rows */
if
(
reclength
>
MI_DYN_MAX_ROW_LENGTH
)
...
...
mysql-test/r/having.result
View file @
0e38e9fc
...
...
@@ -63,3 +63,10 @@ Fld1 max(Fld2)
1 20
3 50
drop table t1;
create table t1 (id int not null, qty int not null);
insert into t1 values (1,2),(1,3),(2,4),(2,5);
select id, sum(qty) as sqty from t1 group by id having sqty>2;
id sqty
1 5
2 9
drop table t1;
mysql-test/r/myisam.result
View file @
0e38e9fc
...
...
@@ -246,7 +246,7 @@ int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
int, i999 int, i1000 int) row_format=dynamic;
int, i999 int, i1000 int
, b blob
) row_format=dynamic;
insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
...
...
@@ -285,7 +285,7 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
, "Sergei"
);
drop table if exists t1;
CREATE TABLE `t1` (
`post_id` mediumint(8) unsigned NOT NULL auto_increment,
...
...
mysql-test/r/variables.result
View file @
0e38e9fc
...
...
@@ -335,3 +335,8 @@ Table Op Msg_type Msg_text
test.t1 check status OK
test.t2 check status OK
drop table t1,t2;
select @@xxxxxxxxxx;
Unknown system variable 'xxxxxxxxxx'
select 1;
1
1
mysql-test/t/having.test
View file @
0e38e9fc
...
...
@@ -60,3 +60,7 @@ select Fld1, max(Fld2) from t1 group by Fld1 having max(Fld2) is not null;
select
Fld1
,
max
(
Fld2
)
from
t1
group
by
Fld1
having
avg
(
Fld2
)
is
not
null
;
select
Fld1
,
max
(
Fld2
)
from
t1
group
by
Fld1
having
std
(
Fld2
)
is
not
null
;
drop
table
t1
;
create
table
t1
(
id
int
not
null
,
qty
int
not
null
);
insert
into
t1
values
(
1
,
2
),(
1
,
3
),(
2
,
4
),(
2
,
5
);
select
id
,
sum
(
qty
)
as
sqty
from
t1
group
by
id
having
sqty
>
2
;
drop
table
t1
;
mysql-test/t/myisam.test
View file @
0e38e9fc
...
...
@@ -252,7 +252,7 @@ int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
int
,
i975
int
,
i976
int
,
i977
int
,
i978
int
,
i979
int
,
i980
int
,
i981
int
,
i982
int
,
i983
int
,
i984
int
,
i985
int
,
i986
int
,
i987
int
,
i988
int
,
i989
int
,
i990
int
,
i991
int
,
i992
int
,
i993
int
,
i994
int
,
i995
int
,
i996
int
,
i997
int
,
i998
int
,
i999
int
,
i1000
int
)
row_format
=
dynamic
;
int
,
i999
int
,
i1000
int
,
b
blob
)
row_format
=
dynamic
;
insert
into
t1
values
(
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
...
...
@@ -291,7 +291,7 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
);
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
"Sergei"
);
drop
table
if
exists
t1
;
#
...
...
mysql-test/t/variables.test
View file @
0e38e9fc
...
...
@@ -241,3 +241,10 @@ select * from t2 where a=3;
check
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# error conditions
#
--
error
1193
select
@@
xxxxxxxxxx
;
select
1
;
sql/item_func.cc
View file @
0e38e9fc
...
...
@@ -70,15 +70,16 @@ Item_func::fix_fields(THD *thd,TABLE_LIST *tables)
{
// Print purify happy
for
(
arg
=
args
,
arg_end
=
args
+
arg_count
;
arg
!=
arg_end
;
arg
++
)
{
if
((
*
arg
)
->
fix_fields
(
thd
,
tables
))
Item
*
item
=*
arg
;
if
(
item
->
fix_fields
(
thd
,
tables
))
return
1
;
/* purecov: inspected */
if
(
(
*
arg
)
->
maybe_null
)
if
(
item
->
maybe_null
)
maybe_null
=
1
;
if
(
(
*
arg
)
->
binary
)
if
(
item
->
binary
)
binary
=
1
;
with_sum_func
=
with_sum_func
||
(
*
arg
)
->
with_sum_func
;
used_tables_cache
|=
(
*
arg
)
->
used_tables
();
const_item_cache
&=
(
*
arg
)
->
const_item
();
with_sum_func
=
with_sum_func
||
item
->
with_sum_func
;
used_tables_cache
|=
item
->
used_tables
();
const_item_cache
&=
item
->
const_item
();
}
}
fix_length_and_dec
();
...
...
@@ -91,12 +92,13 @@ void Item_func::split_sum_func(List<Item> &fields)
Item
**
arg
,
**
arg_end
;
for
(
arg
=
args
,
arg_end
=
args
+
arg_count
;
arg
!=
arg_end
;
arg
++
)
{
if
((
*
arg
)
->
with_sum_func
&&
(
*
arg
)
->
type
()
!=
SUM_FUNC_ITEM
)
(
*
arg
)
->
split_sum_func
(
fields
);
else
if
((
*
arg
)
->
used_tables
()
||
(
*
arg
)
->
type
()
==
SUM_FUNC_ITEM
)
Item
*
item
=*
arg
;
if
(
item
->
with_sum_func
&&
item
->
type
()
!=
SUM_FUNC_ITEM
)
item
->
split_sum_func
(
fields
);
else
if
(
item
->
used_tables
()
||
item
->
type
()
==
SUM_FUNC_ITEM
)
{
fields
.
push_front
(
*
arg
);
*
arg
=
new
Item_ref
((
Item
**
)
fields
.
head_ref
(),
0
,
(
*
arg
)
->
name
);
*
arg
=
new
Item_ref
((
Item
**
)
fields
.
head_ref
(),
0
,
item
->
name
);
}
}
}
...
...
@@ -1231,16 +1233,17 @@ udf_handler::fix_fields(THD *thd,TABLE_LIST *tables,Item_result_field *func,
arg
!=
arg_end
;
arg
++
,
i
++
)
{
if
((
*
arg
)
->
fix_fields
(
thd
,
tables
))
Item
*
item
=*
arg
;
if
(
item
->
fix_fields
(
thd
,
tables
))
return
1
;
if
(
(
*
arg
)
->
binary
)
if
(
item
->
binary
)
func
->
binary
=
1
;
if
(
(
*
arg
)
->
maybe_null
)
if
(
item
->
maybe_null
)
func
->
maybe_null
=
1
;
func
->
with_sum_func
=
func
->
with_sum_func
||
(
*
arg
)
->
with_sum_func
;
used_tables_cache
|=
(
*
arg
)
->
used_tables
();
const_item_cache
&=
(
*
arg
)
->
const_item
();
f_args
.
arg_type
[
i
]
=
(
*
arg
)
->
result_type
();
func
->
with_sum_func
=
func
->
with_sum_func
||
item
->
with_sum_func
;
used_tables_cache
|=
item
->
used_tables
();
const_item_cache
&=
item
->
const_item
();
f_args
.
arg_type
[
i
]
=
item
->
result_type
();
}
if
(
!
(
buffers
=
new
String
[
arg_count
])
||
!
(
f_args
.
args
=
(
char
**
)
sql_alloc
(
arg_count
*
sizeof
(
char
*
)))
||
...
...
@@ -2382,10 +2385,7 @@ Item *get_system_var(enum_var_type var_type, LEX_STRING name)
char
buff
[
MAX_SYS_VAR_LENGTH
+
3
+
8
],
*
pos
;
if
(
!
(
var
=
find_sys_var
(
name
.
str
)))
{
net_printf
(
&
thd
->
net
,
ER_UNKNOWN_SYSTEM_VARIABLE
,
name
.
str
);
return
0
;
}
if
(
!
(
item
=
var
->
item
(
thd
,
var_type
)))
return
0
;
// Impossible
thd
->
safe_to_cache_query
=
0
;
...
...
sql/set_var.cc
View file @
0e38e9fc
...
...
@@ -239,7 +239,7 @@ static sys_var_thd_bit sys_sql_big_tables("sql_big_tables",
#endif
static
sys_var_thd_bit
sys_big_selects
(
"sql_big_selects"
,
set_option_bit
,
OPTION_BIG_
TABLE
S
);
OPTION_BIG_
SELECT
S
);
static
sys_var_thd_bit
sys_log_off
(
"sql_log_off"
,
set_option_bit
,
OPTION_LOG_OFF
);
...
...
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