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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
32594c99
Commit
32594c99
authored
Sep 04, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print value of Item_param if it has a value (when debugging)
parent
46ff9073
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
40 additions
and
16 deletions
+40
-16
libmysql/libmysql.c
libmysql/libmysql.c
+1
-1
sql/item.cc
sql/item.cc
+20
-1
sql/item.h
sql/item.h
+1
-1
sql/log.cc
sql/log.cc
+5
-5
sql/sql_insert.cc
sql/sql_insert.cc
+3
-4
sql/sql_parse.cc
sql/sql_parse.cc
+1
-0
sql/sql_select.cc
sql/sql_select.cc
+6
-3
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-1
tests/client_test.c
tests/client_test.c
+2
-0
No files found.
libmysql/libmysql.c
View file @
32594c99
...
...
@@ -2384,7 +2384,7 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
char
buff
[
4
/* size of stmt id */
+
5
/* execution flags */
];
DBUG_ENTER
(
"execute"
);
DBUG_
PRINT
(
"enter"
,(
"packet: %s, length :%d"
,
packet
?
packet
:
" "
,
length
)
);
DBUG_
DUMP
(
"packet"
,
packet
,
length
);
mysql
->
last_used_con
=
mysql
;
int4store
(
buff
,
stmt
->
stmt_id
);
/* Send stmt id to server */
...
...
sql/item.cc
View file @
32594c99
...
...
@@ -1143,8 +1143,27 @@ bool Item_param::convert_str_value(THD *thd)
return
rc
;
}
/* End of Item_param related */
void
Item_param
::
print
(
String
*
str
)
{
if
(
state
==
NO_VALUE
)
{
str
->
append
(
'?'
);
}
else
{
char
buffer
[
80
];
String
tmp
(
buffer
,
sizeof
(
buffer
),
&
my_charset_bin
);
const
String
*
res
;
res
=
query_val_str
(
&
tmp
);
str
->
append
(
*
res
);
}
}
/****************************************************************************
Item_copy_string
****************************************************************************/
void
Item_copy_string
::
copy
()
{
...
...
sql/item.h
View file @
32594c99
...
...
@@ -635,7 +635,7 @@ class Item_param :public Item
*/
virtual
table_map
used_tables
()
const
{
return
state
!=
NO_VALUE
?
(
table_map
)
0
:
PARAM_TABLE_BIT
;
}
void
print
(
String
*
str
)
{
str
->
append
(
'?'
);
}
void
print
(
String
*
str
)
;
/* parameter never equal to other parameter of other item */
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
{
return
0
;
}
};
...
...
sql/log.cc
View file @
32594c99
...
...
@@ -838,13 +838,13 @@ int MYSQL_LOG::purge_logs(const char *to_log,
while
((
strcmp
(
to_log
,
log_info
.
log_file_name
)
||
(
exit_loop
=
included
))
&&
!
log_in_use
(
log_info
.
log_file_name
))
{
ulong
tmp
;
LINT_INIT
(
tmp
);
ulong
file_size
;
LINT_INIT
(
file_size
);
if
(
decrease_log_space
)
//stat the file we want to delete
{
MY_STAT
s
;
if
(
my_stat
(
log_info
.
log_file_name
,
&
s
,
MYF
(
0
)))
tmp
=
s
.
st_size
;
file_size
=
s
.
st_size
;
else
{
/*
...
...
@@ -852,7 +852,7 @@ int MYSQL_LOG::purge_logs(const char *to_log,
of space that deletion will free. In most cases,
deletion won't work either, so it's not a problem.
*/
tmp
=
0
;
file_size
=
0
;
}
}
/*
...
...
@@ -861,7 +861,7 @@ int MYSQL_LOG::purge_logs(const char *to_log,
*/
DBUG_PRINT
(
"info"
,(
"purging %s"
,
log_info
.
log_file_name
));
if
(
!
my_delete
(
log_info
.
log_file_name
,
MYF
(
0
))
&&
decrease_log_space
)
*
decrease_log_space
-=
tmp
;
*
decrease_log_space
-=
file_size
;
if
(
find_next_log
(
&
log_info
,
0
)
||
exit_loop
)
break
;
}
...
...
sql/sql_insert.cc
View file @
32594c99
...
...
@@ -86,14 +86,13 @@ check_insert_fields(THD *thd, TABLE_LIST *table_list, List<Item> &fields,
return
-
1
;
}
table_list
->
next_local
=
0
;
thd
->
dupp_field
=
0
;
save_next
=
table_list
->
next_local
;
// fields only from first table
thd
->
lex
->
select_lex
.
no_wrap_view_item
=
1
;
save_next
=
table_list
->
next_local
;
// fields only from first table
table_list
->
next_local
=
0
;
res
=
setup_fields
(
thd
,
0
,
table_list
,
fields
,
1
,
0
,
0
);
thd
->
lex
->
select_lex
.
no_wrap_view_item
=
0
;
table_list
->
next_local
=
save_next
;
thd
->
lex
->
select_lex
.
no_wrap_view_item
=
0
;
if
(
res
)
return
-
1
;
...
...
sql/sql_parse.cc
View file @
32594c99
...
...
@@ -78,6 +78,7 @@ const char *command_name[]={
"Connect"
,
"Kill"
,
"Debug"
,
"Ping"
,
"Time"
,
"Delayed_insert"
,
"Change user"
,
"Binlog Dump"
,
"Table Dump"
,
"Connect Out"
,
"Register Slave"
,
"Prepare"
,
"Prepare Execute"
,
"Long Data"
,
"Close stmt"
,
"Reset stmt"
,
"Set option"
,
"Fetch"
,
"Error"
// Last command number
};
...
...
sql/sql_select.cc
View file @
32594c99
...
...
@@ -543,6 +543,7 @@ JOIN::optimize()
if
(
cond_value
==
Item
::
COND_FALSE
||
(
!
unit
->
select_limit_cnt
&&
!
(
select_options
&
OPTION_FOUND_ROWS
)))
{
/* Impossible cond */
DBUG_PRINT
(
"info"
,
(
"Impossible WHERE"
));
zero_result_cause
=
"Impossible WHERE"
;
error
=
0
;
DBUG_RETURN
(
0
);
...
...
@@ -560,20 +561,24 @@ JOIN::optimize()
{
if
(
res
>
1
)
{
DBUG_PRINT
(
"error"
,(
"Error from opt_sum_query"
));
DBUG_RETURN
(
1
);
}
if
(
res
<
0
)
{
DBUG_PRINT
(
"info"
,(
"No matching min/max row"
));
zero_result_cause
=
"No matching min/max row"
;
error
=
0
;
DBUG_RETURN
(
0
);
}
DBUG_PRINT
(
"info"
,(
"Select tables optimized away"
));
zero_result_cause
=
"Select tables optimized away"
;
tables_list
=
0
;
// All tables resolved
}
}
if
(
!
tables_list
)
{
DBUG_PRINT
(
"info"
,(
"No tables"
));
error
=
0
;
DBUG_RETURN
(
0
);
}
...
...
@@ -11641,7 +11646,6 @@ void st_table_list::print(THD *thd, String *str)
}
if
(
my_strcasecmp
(
table_alias_charset
,
cmp_name
,
alias
))
{
{
str
->
append
(
' '
);
append_identifier
(
thd
,
str
,
alias
,
strlen
(
alias
));
}
...
...
@@ -11649,7 +11653,6 @@ void st_table_list::print(THD *thd, String *str)
}
void
st_select_lex
::
print
(
THD
*
thd
,
String
*
str
)
{
if
(
!
thd
)
...
...
@@ -11657,7 +11660,7 @@ void st_select_lex::print(THD *thd, String *str)
str
->
append
(
"select "
,
7
);
/
/options
/
* First add options */
if
(
options
&
SELECT_STRAIGHT_JOIN
)
str
->
append
(
"straight_join "
,
14
);
if
((
thd
->
lex
->
lock_option
==
TL_READ_HIGH_PRIORITY
)
&&
...
...
sql/sql_yacc.yy
View file @
32594c99
...
...
@@ -7553,7 +7553,7 @@ algorithm:
| ALGORITHM_SYM EQ MERGE_SYM
{ Lex->create_view_algorithm= VIEW_ALGORITHM_MERGE; }
| ALGORITHM_SYM EQ TEMPTABLE_SYM
{ Lex->create_view_algorithm= VIEW_ALGORITHM_TM
E
PTABLE; }
{ Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; }
;
check_option:
/* empty */ {}
...
...
tests/client_test.c
View file @
32594c99
...
...
@@ -5508,6 +5508,7 @@ static void test_subselect()
MYSQL_STMT
*
stmt
;
int
rc
,
id
;
MYSQL_BIND
bind
[
1
];
DBUG_ENTER
(
"test_subselect"
);
myheader
(
"test_subselect"
);
...
...
@@ -5609,6 +5610,7 @@ static void test_subselect()
assert
(
rc
==
MYSQL_NO_DATA
);
mysql_stmt_close
(
stmt
);
DBUG_VOID_RETURN
;
}
...
...
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