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
4d01bcdf
Commit
4d01bcdf
authored
Dec 04, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime
parents
2803891b
3d5c638b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
10 deletions
+59
-10
mysql-test/t/log.sh
mysql-test/t/log.sh
+1
-1
server-tools/instance-manager/listener.cc
server-tools/instance-manager/listener.cc
+5
-5
sql/sql_class.cc
sql/sql_class.cc
+14
-0
sql/sql_class.h
sql/sql_class.h
+10
-2
sql/sql_prepare.cc
sql/sql_prepare.cc
+1
-2
tests/mysql_client_test.c
tests/mysql_client_test.c
+28
-0
No files found.
mysql-test/t/log.sh
View file @
4d01bcdf
#!/bin/
ba
sh
#!/bin/sh
###########################################################################
###########################################################################
...
...
server-tools/instance-manager/listener.cc
View file @
4d01bcdf
...
@@ -188,7 +188,7 @@ void Listener_thread::run()
...
@@ -188,7 +188,7 @@ void Listener_thread::run()
else
else
{
{
shutdown
(
client_fd
,
SHUT_RDWR
);
shutdown
(
client_fd
,
SHUT_RDWR
);
close
(
client_fd
);
close
socket
(
client_fd
);
}
}
}
}
}
}
...
@@ -200,7 +200,7 @@ void Listener_thread::run()
...
@@ -200,7 +200,7 @@ void Listener_thread::run()
log_info
(
"Listener_thread::run(): shutdown requested, exiting..."
);
log_info
(
"Listener_thread::run(): shutdown requested, exiting..."
);
for
(
i
=
0
;
i
<
num_sockets
;
i
++
)
for
(
i
=
0
;
i
<
num_sockets
;
i
++
)
close
(
sockets
[
i
]);
close
socket
(
sockets
[
i
]);
#ifndef __WIN__
#ifndef __WIN__
unlink
(
unix_socket_address
.
sun_path
);
unlink
(
unix_socket_address
.
sun_path
);
...
@@ -213,7 +213,7 @@ void Listener_thread::run()
...
@@ -213,7 +213,7 @@ void Listener_thread::run()
err:
err:
// we have to close the ip sockets in case of error
// we have to close the ip sockets in case of error
for
(
i
=
0
;
i
<
num_sockets
;
i
++
)
for
(
i
=
0
;
i
<
num_sockets
;
i
++
)
close
(
sockets
[
i
]);
close
socket
(
sockets
[
i
]);
thread_registry
.
unregister_thread
(
&
thread_info
);
thread_registry
.
unregister_thread
(
&
thread_info
);
thread_registry
.
request_shutdown
();
thread_registry
.
request_shutdown
();
...
@@ -260,7 +260,7 @@ int Listener_thread::create_tcp_socket()
...
@@ -260,7 +260,7 @@ int Listener_thread::create_tcp_socket()
{
{
log_error
(
"Listener_thread::run(): bind(ip socket) failed, '%s'"
,
log_error
(
"Listener_thread::run(): bind(ip socket) failed, '%s'"
,
strerror
(
errno
));
strerror
(
errno
));
close
(
ip_socket
);
close
socket
(
ip_socket
);
return
-
1
;
return
-
1
;
}
}
...
@@ -268,7 +268,7 @@ int Listener_thread::create_tcp_socket()
...
@@ -268,7 +268,7 @@ int Listener_thread::create_tcp_socket()
{
{
log_error
(
"Listener_thread::run(): listen(ip socket) failed, %s"
,
log_error
(
"Listener_thread::run(): listen(ip socket) failed, %s"
,
strerror
(
errno
));
strerror
(
errno
));
close
(
ip_socket
);
close
socket
(
ip_socket
);
return
-
1
;
return
-
1
;
}
}
...
...
sql/sql_class.cc
View file @
4d01bcdf
...
@@ -885,6 +885,13 @@ void select_result::cleanup()
...
@@ -885,6 +885,13 @@ void select_result::cleanup()
/* do nothing */
/* do nothing */
}
}
bool
select_result
::
check_simple_select
()
const
{
my_error
(
ER_SP_BAD_CURSOR_QUERY
,
MYF
(
0
));
return
TRUE
;
}
static
String
default_line_term
(
"
\n
"
,
default_charset_info
);
static
String
default_line_term
(
"
\n
"
,
default_charset_info
);
static
String
default_escaped
(
"
\\
"
,
default_charset_info
);
static
String
default_escaped
(
"
\\
"
,
default_charset_info
);
static
String
default_field_term
(
"
\t
"
,
default_charset_info
);
static
String
default_field_term
(
"
\t
"
,
default_charset_info
);
...
@@ -1553,6 +1560,13 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
...
@@ -1553,6 +1560,13 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
}
}
bool
select_dumpvar
::
check_simple_select
()
const
{
my_error
(
ER_SP_BAD_CURSOR_SELECT
,
MYF
(
0
));
return
TRUE
;
}
void
select_dumpvar
::
cleanup
()
void
select_dumpvar
::
cleanup
()
{
{
vars
.
empty
();
vars
.
empty
();
...
...
sql/sql_class.h
View file @
4d01bcdf
...
@@ -1724,7 +1724,14 @@ public:
...
@@ -1724,7 +1724,14 @@ public:
virtual
bool
initialize_tables
(
JOIN
*
join
=
0
)
{
return
0
;
}
virtual
bool
initialize_tables
(
JOIN
*
join
=
0
)
{
return
0
;
}
virtual
void
send_error
(
uint
errcode
,
const
char
*
err
);
virtual
void
send_error
(
uint
errcode
,
const
char
*
err
);
virtual
bool
send_eof
()
=
0
;
virtual
bool
send_eof
()
=
0
;
virtual
bool
simple_select
()
{
return
0
;
}
/**
Check if this query returns a result set and therefore is allowed in
cursors and set an error message if it is not the case.
@retval FALSE success
@retval TRUE error, an error message is set
*/
virtual
bool
check_simple_select
()
const
;
virtual
void
abort
()
{}
virtual
void
abort
()
{}
/*
/*
Cleanup instance of this class for next execution of a prepared
Cleanup instance of this class for next execution of a prepared
...
@@ -1762,7 +1769,7 @@ public:
...
@@ -1762,7 +1769,7 @@ public:
bool
send_fields
(
List
<
Item
>
&
list
,
uint
flags
);
bool
send_fields
(
List
<
Item
>
&
list
,
uint
flags
);
bool
send_data
(
List
<
Item
>
&
items
);
bool
send_data
(
List
<
Item
>
&
items
);
bool
send_eof
();
bool
send_eof
();
bool
simple_select
()
{
return
1
;
}
virtual
bool
check_simple_select
()
const
{
return
FALSE
;
}
void
abort
();
void
abort
();
};
};
...
@@ -2202,6 +2209,7 @@ public:
...
@@ -2202,6 +2209,7 @@ public:
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
bool
send_data
(
List
<
Item
>
&
items
);
bool
send_data
(
List
<
Item
>
&
items
);
bool
send_eof
();
bool
send_eof
();
virtual
bool
check_simple_select
()
const
;
void
cleanup
();
void
cleanup
();
};
};
...
...
sql/sql_prepare.cc
View file @
4d01bcdf
...
@@ -2906,10 +2906,9 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
...
@@ -2906,10 +2906,9 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
in INSERT ... SELECT and similar commands.
in INSERT ... SELECT and similar commands.
*/
*/
if
(
open_cursor
&&
lex
->
result
&&
!
lex
->
result
->
simple_select
())
if
(
open_cursor
&&
lex
->
result
&&
lex
->
result
->
check_
simple_select
())
{
{
DBUG_PRINT
(
"info"
,(
"Cursor asked for not SELECT stmt"
));
DBUG_PRINT
(
"info"
,(
"Cursor asked for not SELECT stmt"
));
my_error
(
ER_SP_BAD_CURSOR_QUERY
,
MYF
(
0
));
return
TRUE
;
return
TRUE
;
}
}
...
...
tests/mysql_client_test.c
View file @
4d01bcdf
...
@@ -15456,6 +15456,33 @@ static void test_bug21635()
...
@@ -15456,6 +15456,33 @@ static void test_bug21635()
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
/*
Bug#24179 "select b into $var" fails with --cursor_protocol"
The failure is correct, check that the returned message is meaningful.
*/
static
void
test_bug24179
()
{
int
rc
;
MYSQL_STMT
*
stmt
;
DBUG_ENTER
(
"test_bug24179"
);
myheader
(
"test_bug24179"
);
stmt
=
open_cursor
(
"select 1 into @a"
);
rc
=
mysql_stmt_execute
(
stmt
);
DIE_UNLESS
(
rc
);
if
(
!
opt_silent
)
{
printf
(
"Got error (as expected): %d %s
\n
"
,
mysql_stmt_errno
(
stmt
),
mysql_stmt_error
(
stmt
));
}
DIE_UNLESS
(
mysql_stmt_errno
(
stmt
)
==
1323
);
DBUG_VOID_RETURN
;
}
/*
/*
Read and parse arguments and MySQL options from my.cnf
Read and parse arguments and MySQL options from my.cnf
...
@@ -15735,6 +15762,7 @@ static struct my_tests_st my_tests[]= {
...
@@ -15735,6 +15762,7 @@ static struct my_tests_st my_tests[]= {
{
"test_bug21726"
,
test_bug21726
},
{
"test_bug21726"
,
test_bug21726
},
{
"test_bug23383"
,
test_bug23383
},
{
"test_bug23383"
,
test_bug23383
},
{
"test_bug21635"
,
test_bug21635
},
{
"test_bug21635"
,
test_bug21635
},
{
"test_bug24179"
,
test_bug24179
},
{
0
,
0
}
{
0
,
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