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
e041331c
Commit
e041331c
authored
Jan 18, 2012
by
Igor Babaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
4fa282db
4cd19779
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
41 deletions
+58
-41
client/CMakeLists.txt
client/CMakeLists.txt
+1
-1
include/typelib.h
include/typelib.h
+4
-4
libmysql/get_password.c
libmysql/get_password.c
+1
-1
mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
+4
-0
mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
+3
-0
mysys/typelib.c
mysys/typelib.c
+43
-31
sql/sql_partition.cc
sql/sql_partition.cc
+1
-1
sql/sql_trigger.cc
sql/sql_trigger.cc
+1
-1
vio/viosocket.c
vio/viosocket.c
+0
-2
No files found.
client/CMakeLists.txt
View file @
e041331c
...
...
@@ -31,7 +31,7 @@ MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc
TARGET_LINK_LIBRARIES
(
mysql mysqlclient
)
IF
(
UNIX
)
TARGET_LINK_LIBRARIES
(
mysql
${
MY_READLINE_LIBRARY
}
)
SET
(
CMAKE_
CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-rdynamic"
)
SET
(
CMAKE_
EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
-rdynamic"
)
ENDIF
(
UNIX
)
MYSQL_ADD_EXECUTABLE
(
mysqltest mysqltest.cc COMPONENT Test
)
...
...
include/typelib.h
View file @
e041331c
...
...
@@ -35,10 +35,10 @@ extern int find_type_or_exit(const char *x, TYPELIB *typelib,
/** makes @c find_type() require the whole name, no prefix */
#define FIND_TYPE_NO_PREFIX (1 << 0)
/** always implicitely on, so unused, but old code may pass it */
#define FIND_TYPE_NO_OVERWRITE
(1 << 1)
/** makes @c find_type() accept a number */
#define FIND_TYPE_ALLOW_NUMBER
(1 << 2)
/** makes @c find_type() treat ',' a
s terminator
*/
#define FIND_TYPE_NO_OVERWRITE
0
/** makes @c find_type() accept a number
. Not used either
*/
#define FIND_TYPE_ALLOW_NUMBER
0
/** makes @c find_type() treat ',' a
nd '=' as terminators
*/
#define FIND_TYPE_COMMA_TERM (1 << 3)
extern
int
find_type
(
const
char
*
x
,
const
TYPELIB
*
typelib
,
unsigned
int
flags
);
...
...
libmysql/get_password.c
View file @
e041331c
...
...
@@ -157,7 +157,7 @@ void get_tty_password_buff(const char *opt_message, char *buff, size_t buflen)
passbuff
=
getpass
(
opt_message
?
opt_message
:
"Enter password: "
);
/* copy the password to buff and clear original (static) buffer */
strn
mov
(
buff
,
passbuff
,
buflen
-
1
);
strn
cpy
(
buff
,
passbuff
,
buflen
-
1
);
#ifdef _PASSWORD_LEN
memset
(
passbuff
,
0
,
_PASSWORD_LEN
);
#endif
...
...
mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
View file @
e041331c
...
...
@@ -52,6 +52,10 @@ set session optimizer_switch="default";
select @@session.optimizer_switch;
@@session.optimizer_switch
index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off
set optimizer_switch = replace(@@optimizer_switch, '=off', '=on');
select @@optimizer_switch;
@@optimizer_switch
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on
set global optimizer_switch=1.1;
ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
set global optimizer_switch=1e1;
...
...
mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
View file @
e041331c
...
...
@@ -34,6 +34,9 @@ select * from information_schema.session_variables where variable_name='optimize
set
session
optimizer_switch
=
"default"
;
select
@@
session
.
optimizer_switch
;
set
optimizer_switch
=
replace
(
@@
optimizer_switch
,
'=off'
,
'=on'
);
select
@@
optimizer_switch
;
#
# incorrect assignments
#
...
...
mysys/typelib.c
View file @
e041331c
...
...
@@ -20,7 +20,8 @@
#include <m_ctype.h>
#define is_field_separator(X) ((X) == ',' || (X) == '=')
#define is_field_separator(F, X) \
((F & FIND_TYPE_COMMA_TERM) && ((X) == ',' || (X) == '='))
int
find_type_with_warning
(
const
char
*
x
,
TYPELIB
*
typelib
,
const
char
*
option
)
{
...
...
@@ -58,14 +59,14 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
/**
Search after a string in a list of strings. Endspace in x is not compared.
@param x String to find
@param x pointer to string to find
(not necessarily zero-terminated).
by return it'll be advanced to point to the terminator.
@param typelib TYPELIB (struct of pointer to values + count)
@param flags flags to tune behaviour: a combination of
FIND_TYPE_NO_PREFIX
FIND_TYPE_ALLOW_NUMBER
FIND_TYPE_COMMA_TERM.
FIND_TYPE_NO_OVERWRITE can be passed but is
superfluous (is always implicitely on).
@param eol a pointer to the end of the string.
@retval
-1 Too many matching values
...
...
@@ -76,17 +77,20 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
*/
int
find_type
(
const
char
*
x
,
const
TYPELIB
*
typelib
,
uint
flags
)
static
int
find_type_eol
(
const
char
**
x
,
const
TYPELIB
*
typelib
,
uint
flags
,
const
char
*
eol
)
{
int
find
,
pos
;
int
UNINIT_VAR
(
findpos
);
/* guarded by find */
const
char
*
UNINIT_VAR
(
termptr
);
const
char
*
i
;
const
char
*
j
;
DBUG_ENTER
(
"find_type"
);
DBUG_PRINT
(
"enter"
,(
"x: '%s' lib: 0x%lx"
,
x
,
(
long
)
typelib
));
CHARSET_INFO
*
cs
=
&
my_charset_latin1
;
DBUG_ENTER
(
"find_type_eol"
);
DBUG_PRINT
(
"enter"
,(
"x: '%s' lib: 0x%lx"
,
*
x
,
(
long
)
typelib
));
DBUG_ASSERT
(
!
(
flags
&
~
(
FIND_TYPE_NO_PREFIX
|
FIND_TYPE_COMMA_TERM
)));
DBUG_ASSERT
(
!
(
flags
&
~
(
FIND_TYPE_NO_PREFIX
|
FIND_TYPE_ALLOW_NUMBER
|
FIND_TYPE_NO_OVERWRITE
|
FIND_TYPE_COMMA_TERM
)));
if
(
!
typelib
->
count
)
{
DBUG_PRINT
(
"exit"
,(
"no count"
));
...
...
@@ -95,42 +99,52 @@ int find_type(const char *x, const TYPELIB *typelib, uint flags)
find
=
0
;
for
(
pos
=
0
;
(
j
=
typelib
->
type_names
[
pos
])
;
pos
++
)
{
for
(
i
=
x
;
*
i
&&
(
!
(
flags
&
FIND_TYPE_COMMA_TERM
)
||
!
is_field_separator
(
*
i
))
&&
my_toupper
(
&
my_charset_latin1
,
*
i
)
==
my_toupper
(
&
my_charset_latin1
,
*
j
)
;
i
++
,
j
++
)
;
for
(
i
=*
x
;
i
<
eol
&&
!
is_field_separator
(
flags
,
*
i
)
&&
my_toupper
(
cs
,
*
i
)
==
my_toupper
(
cs
,
*
j
)
;
i
++
,
j
++
)
;
if
(
!
*
j
)
{
while
(
*
i
==
' '
)
while
(
i
<
eol
&&
*
i
==
' '
)
i
++
;
/* skip_end_space */
if
(
!
*
i
||
((
flags
&
FIND_TYPE_COMMA_TERM
)
&&
is_field_separator
(
*
i
)))
if
(
i
>=
eol
||
is_field_separator
(
flags
,
*
i
))
{
*
x
=
i
;
DBUG_RETURN
(
pos
+
1
);
}
}
if
((
!*
i
&&
(
!
(
flags
&
FIND_TYPE_COMMA_TERM
)
||
!
is_field_separator
(
*
i
)))
&&
if
((
i
>=
eol
&&
!
is_field_separator
(
flags
,
*
i
))
&&
(
!*
j
||
!
(
flags
&
FIND_TYPE_NO_PREFIX
)))
{
find
++
;
findpos
=
pos
;
termptr
=
i
;
}
}
if
(
find
==
0
&&
(
flags
&
FIND_TYPE_ALLOW_NUMBER
)
&&
x
[
0
]
==
'#'
&&
strend
(
x
)[
-
1
]
==
'#'
&&
(
findpos
=
atoi
(
x
+
1
)
-
1
)
>=
0
&&
(
uint
)
findpos
<
typelib
->
count
)
find
=
1
;
else
if
(
find
==
0
||
!
x
[
0
])
if
(
find
==
0
||
*
x
==
eol
)
{
DBUG_PRINT
(
"exit"
,(
"Couldn't find type"
));
DBUG_RETURN
(
0
);
}
else
if
(
find
!=
1
||
(
flags
&
FIND_TYPE_NO_PREFIX
))
{
DBUG_PRINT
(
"exit"
,(
"Too many poss
y
bilities"
));
DBUG_PRINT
(
"exit"
,(
"Too many poss
i
bilities"
));
DBUG_RETURN
(
-
1
);
}
*
x
=
termptr
;
DBUG_RETURN
(
findpos
+
1
);
}
/* find_type */
}
/* find_type_eol */
/**
Search after a string in a list of strings. Endspace in x is not compared.
Same as find_type_eol, but for zero-terminated strings,
and without advancing the pointer.
*/
int
find_type
(
const
char
*
x
,
const
TYPELIB
*
typelib
,
uint
flags
)
{
return
find_type_eol
(
&
x
,
typelib
,
flags
,
x
+
strlen
(
x
));
}
/**
Get name of type nr
...
...
@@ -198,7 +212,7 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err)
{
(
*
err
)
++
;
i
=
x
;
while
(
*
x
&&
!
is_field_separator
(
*
x
)
)
while
(
*
x
&&
*
x
!=
','
)
x
++
;
if
(
x
[
0
]
&&
x
[
1
])
/* skip separator if found */
x
++
;
...
...
@@ -283,12 +297,10 @@ static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1,
>0 Offset+1 in typelib for matched name
*/
static
uint
parse_name
(
const
TYPELIB
*
lib
,
const
char
**
str
pos
,
const
char
*
end
)
static
uint
parse_name
(
const
TYPELIB
*
lib
,
const
char
**
pos
,
const
char
*
end
)
{
const
char
*
pos
=
*
strpos
;
uint
find
=
find_type
(
pos
,
lib
,
FIND_TYPE_COMMA_TERM
);
for
(;
pos
!=
end
&&
*
pos
!=
'='
&&
*
pos
!=
','
;
pos
++
);
*
strpos
=
pos
;
uint
find
=
find_type_eol
(
pos
,
lib
,
FIND_TYPE_COMMA_TERM
|
FIND_TYPE_NO_PREFIX
,
end
);
return
find
;
}
...
...
sql/sql_partition.cc
View file @
e041331c
...
...
@@ -7348,7 +7348,7 @@ int get_part_iter_for_interval_cols_via_map(partition_info *part_info,
PARTITION_ITERATOR
*
part_iter
)
{
uint32
nparts
;
get_col_endpoint_func
get_col_endpoint
;
get_col_endpoint_func
UNINIT_VAR
(
get_col_endpoint
)
;
DBUG_ENTER
(
"get_part_iter_for_interval_cols_via_map"
);
if
(
part_info
->
part_type
==
RANGE_PARTITION
)
...
...
sql/sql_trigger.cc
View file @
e041331c
...
...
@@ -1722,7 +1722,7 @@ bool add_table_for_trigger(THD *thd,
LEX
*
lex
=
thd
->
lex
;
char
trn_path_buff
[
FN_REFLEN
];
LEX_STRING
trn_path
=
{
trn_path_buff
,
0
};
LEX_STRING
tbl_name
;
LEX_STRING
tbl_name
=
null_lex_str
;
DBUG_ENTER
(
"add_table_for_trigger"
);
...
...
vio/viosocket.c
View file @
e041331c
...
...
@@ -692,9 +692,7 @@ my_bool vio_is_connected(Vio *vio)
void
vio_timeout
(
Vio
*
vio
,
uint
which
,
uint
timeout
)
{
#if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO)
#ifndef DBUG_OFF
int
r
;
#endif
DBUG_ENTER
(
"vio_timeout"
);
{
...
...
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