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
c65ebb5d
Commit
c65ebb5d
authored
May 12, 2009
by
Jim Winstead
Browse files
Options
Browse Files
Download
Plain Diff
Merge from 5.0-bugteam
parents
df3887f9
d615a11b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
90 additions
and
5 deletions
+90
-5
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+14
-0
mysql-test/r/distinct.result
mysql-test/r/distinct.result
+4
-4
mysql-test/r/mysqlbinlog.result
mysql-test/r/mysqlbinlog.result
+2
-0
mysql-test/r/user_var.result
mysql-test/r/user_var.result
+11
-0
mysql-test/t/mysqlbinlog.test
mysql-test/t/mysqlbinlog.test
+10
-0
mysql-test/t/user_var.test
mysql-test/t/user_var.test
+12
-0
sql/item_func.cc
sql/item_func.cc
+35
-0
sql/item_func.h
sql/item_func.h
+1
-0
sql/sql_class.cc
sql/sql_class.cc
+1
-1
No files found.
client/mysqlbinlog.cc
View file @
c65ebb5d
...
@@ -626,6 +626,7 @@ Create_file event for file_id: %u\n",exv->file_id);
...
@@ -626,6 +626,7 @@ Create_file event for file_id: %u\n",exv->file_id);
glob_description_event
=
(
Format_description_log_event
*
)
ev
;
glob_description_event
=
(
Format_description_log_event
*
)
ev
;
print_event_info
->
common_header_len
=
glob_description_event
->
common_header_len
;
print_event_info
->
common_header_len
=
glob_description_event
->
common_header_len
;
ev
->
print
(
result_file
,
print_event_info
);
ev
->
print
(
result_file
,
print_event_info
);
ev
->
temp_buf
=
0
;
/*
/*
We don't want this event to be deleted now, so let's hide it (I
We don't want this event to be deleted now, so let's hide it (I
(Guilhem) should later see if this triggers a non-serious Valgrind
(Guilhem) should later see if this triggers a non-serious Valgrind
...
@@ -668,8 +669,16 @@ Begin_load_query event for file_id: %u\n", exlq->file_id);
...
@@ -668,8 +669,16 @@ Begin_load_query event for file_id: %u\n", exlq->file_id);
end:
end:
rec_count
++
;
rec_count
++
;
/*
Destroy the log_event object. If reading from a remote host,
set the temp_buf to NULL so that memory isn't freed twice.
*/
if
(
ev
)
if
(
ev
)
{
if
(
remote_opt
)
ev
->
temp_buf
=
0
;
delete
ev
;
delete
ev
;
}
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
...
@@ -1151,6 +1160,11 @@ could be out of memory");
...
@@ -1151,6 +1160,11 @@ could be out of memory");
error
=
1
;
error
=
1
;
goto
err
;
goto
err
;
}
}
/*
If reading from a remote host, ensure the temp_buf for the
Log_event class is pointing to the incoming stream.
*/
ev
->
register_temp_buf
((
char
*
)
net
->
read_pos
+
1
);
Log_event_type
type
=
ev
->
get_type_code
();
Log_event_type
type
=
ev
->
get_type_code
();
if
(
glob_description_event
->
binlog_version
>=
3
||
if
(
glob_description_event
->
binlog_version
>=
3
||
...
...
mysql-test/r/distinct.result
View file @
c65ebb5d
...
@@ -629,21 +629,21 @@ SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
...
@@ -629,21 +629,21 @@ SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
fruit_name = 'APPLE';
fruit_name = 'APPLE';
SELECT @v5, @v6, @v7, @v8;
SELECT @v5, @v6, @v7, @v8;
@v5 @v6 @v7 @v8
@v5 @v6 @v7 @v8
3 PEAR 3 PEAR
2 APPLE 2 APPLE
SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1
SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1
WHERE fruit_name = 'APPLE';
WHERE fruit_name = 'APPLE';
SELECT @v5, @v6, @v7, @v8, @v9, @v10;
SELECT @v5, @v6, @v7, @v8, @v9, @v10;
@v5 @v6 @v7 @v8 @v9 @v10
@v5 @v6 @v7 @v8 @v9 @v10
3 PEAR 3 PEAR 5 PEAR
APPLE
2 APPLE 2 APPLE 4 APPLE
APPLE
SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO
SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO
@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
SELECT @v11, @v12, @v13, @v14;
SELECT @v11, @v12, @v13, @v14;
@v11 @v12 @v13 @v14
@v11 @v12 @v13 @v14
6 PEARPEAR 6 PEARPEAR
4 APPLEAPPLE 4 APPLEAPPLE
SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
SELECT @v15, @v16;
SELECT @v15, @v16;
@v15 @v16
@v15 @v16
6 PEARPEAR
4 APPLEAPPLE
SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
'APPLE';
'APPLE';
SELECT @v17, @v18;
SELECT @v17, @v18;
...
...
mysql-test/r/mysqlbinlog.result
View file @
c65ebb5d
...
@@ -380,4 +380,6 @@ IS NOT NULL
...
@@ -380,4 +380,6 @@ IS NOT NULL
1
1
*** Unsigned server_id 4294967295 is found: 1 ***
*** Unsigned server_id 4294967295 is found: 1 ***
SET @@global.server_id= 1;
SET @@global.server_id= 1;
RESET MASTER;
FLUSH LOGS;
End of 5.0 tests
End of 5.0 tests
mysql-test/r/user_var.result
View file @
c65ebb5d
...
@@ -353,3 +353,14 @@ select @a:=f4, count(f4) from t1 group by 1 desc;
...
@@ -353,3 +353,14 @@ select @a:=f4, count(f4) from t1 group by 1 desc;
2.6 1
2.6 1
1.6 4
1.6 4
drop table t1;
drop table t1;
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1 VALUES (0, 0), (2, 1), (2, 3), (1, 1), (30, 20);
SELECT a, b INTO @a, @b FROM t1 WHERE a=2 AND b=3 GROUP BY a, b;
SELECT @a, @b;
@a @b
2 3
SELECT a, b FROM t1 WHERE a=2 AND b=3 GROUP BY a, b;
a b
2 3
DROP TABLE t1;
End of 5.0 tests
mysql-test/t/mysqlbinlog.test
View file @
c65ebb5d
...
@@ -294,4 +294,14 @@ echo *** Unsigned server_id $s_id_max is found: $s_id_unsigned ***;
...
@@ -294,4 +294,14 @@ echo *** Unsigned server_id $s_id_max is found: $s_id_unsigned ***;
eval
SET
@@
global
.
server_id
=
$save_server_id
;
eval
SET
@@
global
.
server_id
=
$save_server_id
;
--
remove_file
$binlog_file
--
remove_file
$binlog_file
#
# Bug #41943: mysqlbinlog.exe crashes if --hexdump option is used
#
RESET
MASTER
;
FLUSH
LOGS
;
# We do not need the results, just make sure that mysqlbinlog does not crash
--
exec
$MYSQL_BINLOG
--
hexdump
--
read
-
from
-
remote
-
server
--
user
=
root
--
host
=
127.0
.
0.1
--
port
=
$MASTER_MYPORT
master
-
bin
.
000001
>/
dev
/
null
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
mysql-test/t/user_var.test
View file @
c65ebb5d
...
@@ -237,3 +237,15 @@ select @a:=f2, count(f2) from t1 group by 1 desc;
...
@@ -237,3 +237,15 @@ select @a:=f2, count(f2) from t1 group by 1 desc;
select
@
a
:=
f3
,
count
(
f3
)
from
t1
group
by
1
desc
;
select
@
a
:=
f3
,
count
(
f3
)
from
t1
group
by
1
desc
;
select
@
a
:=
f4
,
count
(
f4
)
from
t1
group
by
1
desc
;
select
@
a
:=
f4
,
count
(
f4
)
from
t1
group
by
1
desc
;
drop
table
t1
;
drop
table
t1
;
#
# Bug#42009: SELECT into variable gives different results to direct SELECT
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
);
INSERT
INTO
t1
VALUES
(
0
,
0
),
(
2
,
1
),
(
2
,
3
),
(
1
,
1
),
(
30
,
20
);
SELECT
a
,
b
INTO
@
a
,
@
b
FROM
t1
WHERE
a
=
2
AND
b
=
3
GROUP
BY
a
,
b
;
SELECT
@
a
,
@
b
;
SELECT
a
,
b
FROM
t1
WHERE
a
=
2
AND
b
=
3
GROUP
BY
a
,
b
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
sql/item_func.cc
View file @
c65ebb5d
...
@@ -4151,6 +4151,41 @@ Item_func_set_user_var::check(bool use_result_field)
...
@@ -4151,6 +4151,41 @@ Item_func_set_user_var::check(bool use_result_field)
}
}
/**
@brief Evaluate and store item's result.
This function is invoked on "SELECT ... INTO @var ...".
@param item An item to get value from.
*/
void
Item_func_set_user_var
::
save_item_result
(
Item
*
item
)
{
DBUG_ENTER
(
"Item_func_set_user_var::save_item_result"
);
switch
(
cached_result_type
)
{
case
REAL_RESULT
:
save_result
.
vreal
=
item
->
val_result
();
break
;
case
INT_RESULT
:
save_result
.
vint
=
item
->
val_int_result
();
unsigned_flag
=
item
->
unsigned_flag
;
break
;
case
STRING_RESULT
:
save_result
.
vstr
=
item
->
str_result
(
&
value
);
break
;
case
DECIMAL_RESULT
:
save_result
.
vdec
=
item
->
val_decimal_result
(
&
decimal_buff
);
break
;
case
ROW_RESULT
:
default:
// Should never happen
DBUG_ASSERT
(
0
);
break
;
}
DBUG_VOID_RETURN
;
}
/*
/*
This functions is invoked on SET @variable or @variable:= expression.
This functions is invoked on SET @variable or @variable:= expression.
...
...
sql/item_func.h
View file @
c65ebb5d
...
@@ -1308,6 +1308,7 @@ public:
...
@@ -1308,6 +1308,7 @@ public:
bool
send
(
Protocol
*
protocol
,
String
*
str_arg
);
bool
send
(
Protocol
*
protocol
,
String
*
str_arg
);
void
make_field
(
Send_field
*
tmp_field
);
void
make_field
(
Send_field
*
tmp_field
);
bool
check
(
bool
use_result_field
);
bool
check
(
bool
use_result_field
);
void
save_item_result
(
Item
*
item
);
bool
update
();
bool
update
();
enum
Item_result
result_type
()
const
{
return
cached_result_type
;
}
enum
Item_result
result_type
()
const
{
return
cached_result_type
;
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
...
...
sql/sql_class.cc
View file @
c65ebb5d
...
@@ -2052,7 +2052,7 @@ bool select_dumpvar::send_data(List<Item> &items)
...
@@ -2052,7 +2052,7 @@ bool select_dumpvar::send_data(List<Item> &items)
{
{
Item_func_set_user_var
*
suv
=
new
Item_func_set_user_var
(
mv
->
s
,
item
);
Item_func_set_user_var
*
suv
=
new
Item_func_set_user_var
(
mv
->
s
,
item
);
suv
->
fix_fields
(
thd
,
0
);
suv
->
fix_fields
(
thd
,
0
);
suv
->
check
(
0
);
suv
->
save_item_result
(
item
);
suv
->
update
();
suv
->
update
();
}
}
}
}
...
...
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