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
8aeb63dd
Commit
8aeb63dd
authored
Nov 21, 2003
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update VC++ files
Portability fixes After merge fixes
parent
32a62d50
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
96 additions
and
65 deletions
+96
-65
VC++Files/mysql.dsw
VC++Files/mysql.dsw
+9
-0
VC++Files/mysys/mysys.dsp
VC++Files/mysys/mysys.dsp
+4
-0
client/mysqlcheck.c
client/mysqlcheck.c
+2
-0
client/mysqltest.c
client/mysqltest.c
+4
-9
include/keycache.h
include/keycache.h
+0
-3
include/m_ctype.h
include/m_ctype.h
+8
-0
include/my_base.h
include/my_base.h
+0
-1
myisam/mi_keycache.c
myisam/mi_keycache.c
+6
-0
mysql-test/r/count_distinct3.result
mysql-test/r/count_distinct3.result
+1
-0
mysql-test/r/rpl_change_master.result
mysql-test/r/rpl_change_master.result
+6
-6
mysql-test/t/count_distinct3.test
mysql-test/t/count_distinct3.test
+3
-0
mysql-test/t/rpl_change_master.test
mysql-test/t/rpl_change_master.test
+2
-0
mysys/default.c
mysys/default.c
+1
-0
mysys/mf_keycache.c
mysys/mf_keycache.c
+3
-5
mysys/my_getopt.c
mysys/my_getopt.c
+1
-3
sql/ha_myisam.cc
sql/ha_myisam.cc
+4
-7
sql/item.cc
sql/item.cc
+1
-1
sql/item_timefunc.cc
sql/item_timefunc.cc
+15
-15
sql/set_var.cc
sql/set_var.cc
+1
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+0
-1
sql/sql_repl.cc
sql/sql_repl.cc
+3
-2
sql/sql_select.h
sql/sql_select.h
+17
-5
sql/sql_table.cc
sql/sql_table.cc
+1
-2
strings/ctype-tis620.c
strings/ctype-tis620.c
+4
-4
No files found.
VC++Files/mysql.dsw
View file @
8aeb63dd
...
@@ -251,6 +251,9 @@ Package=<4>
...
@@ -251,6 +251,9 @@ Package=<4>
Begin Project Dependency
Begin Project Dependency
Project_Dep_Name strings
Project_Dep_Name strings
End Project Dependency
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
}}}
###############################################################################
###############################################################################
...
@@ -275,6 +278,9 @@ Package=<4>
...
@@ -275,6 +278,9 @@ Package=<4>
Begin Project Dependency
Begin Project Dependency
Project_Dep_Name strings
Project_Dep_Name strings
End Project Dependency
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
}}}
###############################################################################
###############################################################################
...
@@ -311,6 +317,9 @@ Package=<4>
...
@@ -311,6 +317,9 @@ Package=<4>
Begin Project Dependency
Begin Project Dependency
Project_Dep_Name strings
Project_Dep_Name strings
End Project Dependency
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
}}}
###############################################################################
###############################################################################
...
...
VC++Files/mysys/mysys.dsp
View file @
8aeb63dd
...
@@ -298,6 +298,10 @@ SOURCE=.\my_copy.c
...
@@ -298,6 +298,10 @@ SOURCE=.\my_copy.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
SOURCE=.\my_crc32.c
# End Source File
# Begin Source File
SOURCE=.\my_create.c
SOURCE=.\my_create.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
...
...
client/mysqlcheck.c
View file @
8aeb63dd
...
@@ -309,6 +309,8 @@ static int get_options(int *argc, char ***argv)
...
@@ -309,6 +309,8 @@ static int get_options(int *argc, char ***argv)
else
else
what_to_do
=
DO_CHECK
;
what_to_do
=
DO_CHECK
;
}
}
/* TODO: This variable is not yet used */
if
(
!
(
charset_info
=
get_charset_by_csname
(
default_charset
,
if
(
!
(
charset_info
=
get_charset_by_csname
(
default_charset
,
MY_CS_PRIMARY
,
MYF
(
MY_WME
))))
MY_CS_PRIMARY
,
MYF
(
MY_WME
))))
exit
(
1
);
exit
(
1
);
...
...
client/mysqltest.c
View file @
8aeb63dd
...
@@ -118,7 +118,6 @@ static FILE** cur_file;
...
@@ -118,7 +118,6 @@ static FILE** cur_file;
static
FILE
**
file_stack_end
;
static
FILE
**
file_stack_end
;
static
uint
lineno_stack
[
MAX_INCLUDE_DEPTH
];
static
uint
lineno_stack
[
MAX_INCLUDE_DEPTH
];
static
char
TMPDIR
[
FN_REFLEN
];
static
char
TMPDIR
[
FN_REFLEN
];
static
int
*
block_ok_stack_end
;
static
int
*
cur_block
,
*
block_stack_end
;
static
int
*
cur_block
,
*
block_stack_end
;
static
int
block_stack
[
BLOCK_STACK_DEPTH
];
static
int
block_stack
[
BLOCK_STACK_DEPTH
];
...
@@ -1495,7 +1494,6 @@ int do_connect(struct st_query* q)
...
@@ -1495,7 +1494,6 @@ int do_connect(struct st_query* q)
char
*
p
=
q
->
first_argument
;
char
*
p
=
q
->
first_argument
;
char
buff
[
FN_REFLEN
];
char
buff
[
FN_REFLEN
];
int
con_port
;
int
con_port
;
int
con_error
;
int
free_con_sock
=
0
;
int
free_con_sock
=
0
;
DBUG_ENTER
(
"do_connect"
);
DBUG_ENTER
(
"do_connect"
);
...
@@ -1560,9 +1558,9 @@ int do_connect(struct st_query* q)
...
@@ -1560,9 +1558,9 @@ int do_connect(struct st_query* q)
/* Special database to allow one to connect without a database name */
/* Special database to allow one to connect without a database name */
if
(
con_db
&&
!
strcmp
(
con_db
,
"*NO-ONE*"
))
if
(
con_db
&&
!
strcmp
(
con_db
,
"*NO-ONE*"
))
con_db
=
0
;
con_db
=
0
;
if
((
con_error
=
safe_connect
(
&
next_con
->
mysql
,
con_host
,
if
((
safe_connect
(
&
next_con
->
mysql
,
con_host
,
con_user
,
con_pass
,
con_user
,
con_pass
,
con_db
,
con_port
,
con_sock
?
con_sock
:
0
)))
con_db
,
con_port
,
con_sock
?
con_sock
:
0
)))
die
(
"Could not open connection '%s': %s"
,
con_name
,
die
(
"Could not open connection '%s': %s"
,
con_name
,
mysql_error
(
&
next_con
->
mysql
));
mysql_error
(
&
next_con
->
mysql
));
...
@@ -2018,12 +2016,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
...
@@ -2018,12 +2016,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
int
parse_args
(
int
argc
,
char
**
argv
)
int
parse_args
(
int
argc
,
char
**
argv
)
{
{
int
ho_error
;
load_defaults
(
"my"
,
load_default_groups
,
&
argc
,
&
argv
);
load_defaults
(
"my"
,
load_default_groups
,
&
argc
,
&
argv
);
default_argv
=
argv
;
default_argv
=
argv
;
if
((
h
o_error
=
h
andle_options
(
&
argc
,
&
argv
,
my_long_options
,
get_one_option
)))
if
((
handle_options
(
&
argc
,
&
argv
,
my_long_options
,
get_one_option
)))
exit
(
1
);
exit
(
1
);
if
(
argc
>
1
)
if
(
argc
>
1
)
...
@@ -2454,7 +2450,6 @@ int main(int argc, char **argv)
...
@@ -2454,7 +2450,6 @@ int main(int argc, char **argv)
memset
(
block_stack
,
0
,
sizeof
(
block_stack
));
memset
(
block_stack
,
0
,
sizeof
(
block_stack
));
block_stack_end
=
block_stack
+
BLOCK_STACK_DEPTH
;
block_stack_end
=
block_stack
+
BLOCK_STACK_DEPTH
;
memset
(
block_ok_stack
,
0
,
sizeof
(
block_stack
));
memset
(
block_ok_stack
,
0
,
sizeof
(
block_stack
));
block_ok_stack_end
=
block_ok_stack
+
BLOCK_STACK_DEPTH
;
cur_block
=
block_stack
;
cur_block
=
block_stack
;
block_ok
=
block_ok_stack
;
block_ok
=
block_ok_stack
;
*
block_ok
=
1
;
*
block_ok
=
1
;
...
...
include/keycache.h
View file @
8aeb63dd
...
@@ -91,9 +91,6 @@ typedef struct st_key_cache
...
@@ -91,9 +91,6 @@ typedef struct st_key_cache
ulong
global_cache_read
;
/* number of reads from files to the cache */
ulong
global_cache_read
;
/* number of reads from files to the cache */
int
blocks
;
/* max number of blocks in the cache */
int
blocks
;
/* max number of blocks in the cache */
my_bool
in_init
;
/* Set to 1 in MySQL during init/resize */
my_bool
in_init
;
/* Set to 1 in MySQL during init/resize */
/* optional call back function */
void
(
*
action
)(
struct
st_key_cache
*
);
}
KEY_CACHE
;
}
KEY_CACHE
;
/* The default key cache */
/* The default key cache */
...
...
include/m_ctype.h
View file @
8aeb63dd
...
@@ -335,6 +335,14 @@ uint my_instr_mb(struct charset_info_st *,
...
@@ -335,6 +335,14 @@ uint my_instr_mb(struct charset_info_st *,
extern
my_bool
my_parse_charset_xml
(
const
char
*
bug
,
uint
len
,
extern
my_bool
my_parse_charset_xml
(
const
char
*
bug
,
uint
len
,
int
(
*
add
)(
CHARSET_INFO
*
cs
));
int
(
*
add
)(
CHARSET_INFO
*
cs
));
#undef _U
#undef _L
#undef _NMR
#undef _SPC
#undef _PNT
#undef _CTR
#undef _B
#undef _X
#define _U 01
/* Upper case */
#define _U 01
/* Upper case */
#define _L 02
/* Lower case */
#define _L 02
/* Lower case */
...
...
include/my_base.h
View file @
8aeb63dd
...
@@ -46,7 +46,6 @@
...
@@ -46,7 +46,6 @@
#define HA_OPEN_DELAY_KEY_WRITE 8
/* Don't update index */
#define HA_OPEN_DELAY_KEY_WRITE 8
/* Don't update index */
#define HA_OPEN_ABORT_IF_CRASHED 16
#define HA_OPEN_ABORT_IF_CRASHED 16
#define HA_OPEN_FOR_REPAIR 32
/* open even if crashed */
#define HA_OPEN_FOR_REPAIR 32
/* open even if crashed */
#define HA_OPEN_TO_ASSIGN 64
/* Open for key cache assignment */
/* The following is parameter to ha_rkey() how to use key */
/* The following is parameter to ha_rkey() how to use key */
...
...
myisam/mi_keycache.c
View file @
8aeb63dd
...
@@ -92,6 +92,11 @@ int mi_assign_to_key_cache(MI_INFO *info,
...
@@ -92,6 +92,11 @@ int mi_assign_to_key_cache(MI_INFO *info,
*/
*/
(
void
)
flush_key_blocks
(
key_cache
,
share
->
kfile
,
FLUSH_REMOVE
);
(
void
)
flush_key_blocks
(
key_cache
,
share
->
kfile
,
FLUSH_REMOVE
);
/*
ensure that setting the key cache and changing the multi_key_cache
is done atomicly
*/
pthread_mutex_lock
(
&
share
->
intern_lock
);
/*
/*
Tell all threads to use the new key cache
Tell all threads to use the new key cache
This should be seen at the lastes for the next call to an myisam function.
This should be seen at the lastes for the next call to an myisam function.
...
@@ -102,6 +107,7 @@ int mi_assign_to_key_cache(MI_INFO *info,
...
@@ -102,6 +107,7 @@ int mi_assign_to_key_cache(MI_INFO *info,
if
(
multi_key_cache_set
(
share
->
unique_file_name
,
share
->
unique_name_length
,
if
(
multi_key_cache_set
(
share
->
unique_file_name
,
share
->
unique_name_length
,
share
->
key_cache
))
share
->
key_cache
))
error
=
my_errno
;
error
=
my_errno
;
pthread_mutex_unlock
(
&
share
->
intern_lock
);
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
...
...
mysql-test/r/count_distinct3.result
View file @
8aeb63dd
...
@@ -5,3 +5,4 @@ COUNT(*)
...
@@ -5,3 +5,4 @@ COUNT(*)
4181000
4181000
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
DROP TABLE t1;
DROP TABLE t1;
set @@read_buffer_size=default;
mysql-test/r/rpl_change_master.result
View file @
8aeb63dd
s
lave stop
;
s
top slave
;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset master;
reset slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
s
lave start
;
s
tart slave
;
select get_lock("a",5);
select get_lock("a",5);
get_lock("a",5)
get_lock("a",5)
1
1
...
@@ -15,12 +15,12 @@ select * from t1;
...
@@ -15,12 +15,12 @@ select * from t1;
n
n
1
1
show slave status;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
Slave_IO_State Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_behind_master
127.0.0.1 root 9306 1 master-bin.001 273 slave-relay-bin.002 255 master-bin.001 No No 0 0 214 314
# 127.0.0.1 root 9306 1 master-bin.000001 273 slave-relay-bin.000002 258 master-bin.000001 No No 0 0 214 317 None 0 No #
change master to master_user='root';
change master to master_user='root';
show slave status;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
Slave_IO_State Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_behind_master
127.0.0.1 root 9306 1 master-bin.001 214 slave-relay-bin.001 4 master-bin.001 No No 0 0 214 4
# 127.0.0.1 root 9306 1 master-bin.000001 214 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 214 4 None 0 No #
select release_lock("a");
select release_lock("a");
release_lock("a")
release_lock("a")
1
1
...
...
mysql-test/t/count_distinct3.test
View file @
8aeb63dd
...
@@ -21,6 +21,7 @@ while ($1)
...
@@ -21,6 +21,7 @@ while ($1)
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
VALUES
(
@
id
,
@
grp
,
@
id_rev
);
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
VALUES
(
@
id
,
@
grp
,
@
id_rev
);
dec
$
1
;
dec
$
1
;
}
}
set
@@
read_buffer_size
=
2
*
1024
*
1024
;
CREATE
TABLE
t2
SELECT
*
FROM
t1
;
CREATE
TABLE
t2
SELECT
*
FROM
t1
;
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t2
;
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
...
@@ -53,3 +54,5 @@ SELECT COUNT(*) FROM t1;
...
@@ -53,3 +54,5 @@ SELECT COUNT(*) FROM t1;
SELECT
COUNT
(
DISTINCT
id
)
FROM
t1
GROUP
BY
grp
;
SELECT
COUNT
(
DISTINCT
id
)
FROM
t1
GROUP
BY
grp
;
--
enable_result_log
--
enable_result_log
DROP
TABLE
t1
;
DROP
TABLE
t1
;
set
@@
read_buffer_size
=
default
;
mysql-test/t/rpl_change_master.test
View file @
8aeb63dd
...
@@ -11,8 +11,10 @@ connection slave;
...
@@ -11,8 +11,10 @@ connection slave;
sleep
3
;
# can't sync_with_master as we should be blocked
sleep
3
;
# can't sync_with_master as we should be blocked
stop
slave
;
stop
slave
;
select
*
from
t1
;
select
*
from
t1
;
--
replace_column
1
# 33 #
show
slave
status
;
show
slave
status
;
change
master
to
master_user
=
'root'
;
change
master
to
master_user
=
'root'
;
--
replace_column
1
# 33 #
show
slave
status
;
show
slave
status
;
# Will restart from after the values(2), which is bug
# Will restart from after the values(2), which is bug
select
release_lock
(
"a"
);
select
release_lock
(
"a"
);
...
...
mysys/default.c
View file @
8aeb63dd
...
@@ -251,6 +251,7 @@ int load_defaults(const char *conf_file, const char **groups,
...
@@ -251,6 +251,7 @@ int load_defaults(const char *conf_file, const char **groups,
err:
err:
fprintf
(
stderr
,
"Fatal error in defaults handling. Program aborted
\n
"
);
fprintf
(
stderr
,
"Fatal error in defaults handling. Program aborted
\n
"
);
exit
(
1
);
exit
(
1
);
return
0
;
/* Keep compiler happy */
}
}
...
...
mysys/mf_keycache.c
View file @
8aeb63dd
...
@@ -15,8 +15,8 @@
...
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
/*
These functions
are to handle keyblock cacheing
These functions
handle keyblock cacheing for ISAM and MyISAM tables.
for NISAM, MISAM and PISAM databases.
One cache can handle many files.
One cache can handle many files.
It must contain buffers of the same blocksize.
It must contain buffers of the same blocksize.
init_key_cache() should be used to init cache handler.
init_key_cache() should be used to init cache handler.
...
@@ -282,6 +282,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
...
@@ -282,6 +282,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
if
(
!
keycache
->
key_cache_inited
)
if
(
!
keycache
->
key_cache_inited
)
{
{
keycache
->
key_cache_inited
=
1
;
keycache
->
key_cache_inited
=
1
;
keycache
->
in_init
=
0
;
pthread_mutex_init
(
&
keycache
->
cache_lock
,
MY_MUTEX_INIT_FAST
);
pthread_mutex_init
(
&
keycache
->
cache_lock
,
MY_MUTEX_INIT_FAST
);
}
}
...
@@ -2159,9 +2160,6 @@ static int flush_key_blocks_int(KEY_CACHE *keycache,
...
@@ -2159,9 +2160,6 @@ static int flush_key_blocks_int(KEY_CACHE *keycache,
}
}
}
}
if
(
type
==
FLUSH_REMOVE
&&
keycache
->
action
)
(
*
keycache
->
action
)(
keycache
);
#ifndef DBUG_OFF
#ifndef DBUG_OFF
DBUG_EXECUTE
(
"check_keycache"
,
DBUG_EXECUTE
(
"check_keycache"
,
test_key_cache
(
keycache
,
"end of flush_key_blocks"
,
0
););
test_key_cache
(
keycache
,
"end of flush_key_blocks"
,
0
););
...
...
mysys/my_getopt.c
View file @
8aeb63dd
...
@@ -83,7 +83,7 @@ int handle_options(int *argc, char ***argv,
...
@@ -83,7 +83,7 @@ int handle_options(int *argc, char ***argv,
char
*
))
char
*
))
{
{
uint
opt_found
,
argvpos
=
0
,
length
,
i
;
uint
opt_found
,
argvpos
=
0
,
length
,
i
;
my_bool
end_of_options
=
0
,
must_be_var
,
set_maximum_value
,
special_used
,
my_bool
end_of_options
=
0
,
must_be_var
,
set_maximum_value
,
option_is_loose
;
option_is_loose
;
char
**
pos
,
**
pos_end
,
*
optend
,
*
prev_found
,
char
**
pos
,
**
pos_end
,
*
optend
,
*
prev_found
,
*
opt_str
,
key_name
[
FN_REFLEN
];
*
opt_str
,
key_name
[
FN_REFLEN
];
...
@@ -104,7 +104,6 @@ int handle_options(int *argc, char ***argv,
...
@@ -104,7 +104,6 @@ int handle_options(int *argc, char ***argv,
char
*
argument
=
0
;
char
*
argument
=
0
;
must_be_var
=
0
;
must_be_var
=
0
;
set_maximum_value
=
0
;
set_maximum_value
=
0
;
special_used
=
0
;
option_is_loose
=
0
;
option_is_loose
=
0
;
cur_arg
++
;
/* skip '-' */
cur_arg
++
;
/* skip '-' */
...
@@ -202,7 +201,6 @@ int handle_options(int *argc, char ***argv,
...
@@ -202,7 +201,6 @@ int handle_options(int *argc, char ***argv,
/*
/*
We were called with a special prefix, we can reuse opt_found
We were called with a special prefix, we can reuse opt_found
*/
*/
special_used
=
1
;
opt_str
+=
(
special_opt_prefix_lengths
[
i
]
+
1
);
opt_str
+=
(
special_opt_prefix_lengths
[
i
]
+
1
);
if
(
i
==
OPT_LOOSE
)
if
(
i
==
OPT_LOOSE
)
option_is_loose
=
1
;
option_is_loose
=
1
;
...
...
sql/ha_myisam.cc
View file @
8aeb63dd
...
@@ -720,13 +720,10 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
...
@@ -720,13 +720,10 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
if
((
error
=
mi_assign_to_key_cache
(
file
,
map
,
new_key_cache
)))
if
((
error
=
mi_assign_to_key_cache
(
file
,
map
,
new_key_cache
)))
{
{
switch
(
error
)
{
char
buf
[
80
];
default:
my_snprintf
(
buf
,
sizeof
(
buf
),
char
buf
[
80
];
"Failed to flush to index file (errno: %d)"
,
error
);
my_snprintf
(
buf
,
sizeof
(
buf
),
errmsg
=
buf
;
"Failed to flush to index file (errno: %d)"
,
error
);
errmsg
=
buf
;
}
error
=
HA_ADMIN_CORRUPT
;
error
=
HA_ADMIN_CORRUPT
;
}
}
...
...
sql/item.cc
View file @
8aeb63dd
...
@@ -1196,7 +1196,7 @@ int Item_uint::save_in_field(Field *field, bool no_conversions)
...
@@ -1196,7 +1196,7 @@ int Item_uint::save_in_field(Field *field, bool no_conversions)
TODO: To be fixed when wen have a
TODO: To be fixed when wen have a
field->store(longlong, unsigned_flag) method
field->store(longlong, unsigned_flag) method
*/
*/
Item_int
::
save_in_field
(
field
,
no_conversions
);
return
Item_int
::
save_in_field
(
field
,
no_conversions
);
}
}
...
...
sql/item_timefunc.cc
View file @
8aeb63dd
...
@@ -235,7 +235,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
...
@@ -235,7 +235,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
/* Second part */
/* Second part */
case
'f'
:
case
'f'
:
tmp
=
(
char
*
)
val_end
;
tmp
=
(
char
*
)
val_end
;
l_time
->
second_part
=
my_strtoll10
(
val
,
&
tmp
,
&
error
);
l_time
->
second_part
=
(
int
)
my_strtoll10
(
val
,
&
tmp
,
&
error
);
val
=
tmp
;
val
=
tmp
;
break
;
break
;
...
@@ -1219,7 +1219,7 @@ String *Item_func_sec_to_time::val_str(String *str)
...
@@ -1219,7 +1219,7 @@ String *Item_func_sec_to_time::val_str(String *str)
sec
=
(
uint
)
((
ulonglong
)
seconds
%
3600
);
sec
=
(
uint
)
((
ulonglong
)
seconds
%
3600
);
ltime
.
day
=
0
;
ltime
.
day
=
0
;
ltime
.
hour
=
seconds
/
3600
;
ltime
.
hour
=
(
uint
)
(
seconds
/
3600
)
;
ltime
.
minute
=
sec
/
60
;
ltime
.
minute
=
sec
/
60
;
ltime
.
second
=
sec
%
60
;
ltime
.
second
=
sec
%
60
;
...
@@ -1850,9 +1850,8 @@ String *Item_datetime_typecast::val_str(String *str)
...
@@ -1850,9 +1850,8 @@ String *Item_datetime_typecast::val_str(String *str)
if
(
!
get_arg0_date
(
&
ltime
,
1
)
&&
if
(
!
get_arg0_date
(
&
ltime
,
1
)
&&
!
make_datetime
(
ltime
.
second_part
?
DATE_TIME_MICROSECOND
:
DATE_TIME
,
!
make_datetime
(
ltime
.
second_part
?
DATE_TIME_MICROSECOND
:
DATE_TIME
,
&
ltime
,
str
))
&
ltime
,
str
))
return
str
;
return
str
;
null_date:
null_value
=
1
;
null_value
=
1
;
return
0
;
return
0
;
}
}
...
@@ -1911,8 +1910,8 @@ String *Item_date_typecast::val_str(String *str)
...
@@ -1911,8 +1910,8 @@ String *Item_date_typecast::val_str(String *str)
String
*
Item_func_makedate
::
val_str
(
String
*
str
)
String
*
Item_func_makedate
::
val_str
(
String
*
str
)
{
{
TIME
l_time
;
TIME
l_time
;
long
daynr
=
args
[
1
]
->
val_int
();
long
daynr
=
(
long
)
args
[
1
]
->
val_int
();
long
yearnr
=
args
[
0
]
->
val_int
();
long
yearnr
=
(
long
)
args
[
0
]
->
val_int
();
long
days
;
long
days
;
if
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
if
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
...
@@ -1920,7 +1919,7 @@ String *Item_func_makedate::val_str(String *str)
...
@@ -1920,7 +1919,7 @@ String *Item_func_makedate::val_str(String *str)
goto
err
;
goto
err
;
days
=
calc_daynr
(
yearnr
,
1
,
1
)
+
daynr
-
1
;
days
=
calc_daynr
(
yearnr
,
1
,
1
)
+
daynr
-
1
;
// Day number from year 0 to 9999-12-31
/* Day number from year 0 to 9999-12-31 */
if
(
days
>=
0
&&
days
<
MAX_DAY_NUMBER
)
if
(
days
>=
0
&&
days
<
MAX_DAY_NUMBER
)
{
{
null_value
=
0
;
null_value
=
0
;
...
@@ -2124,7 +2123,8 @@ String *Item_func_timediff::val_str(String *str)
...
@@ -2124,7 +2123,8 @@ String *Item_func_timediff::val_str(String *str)
microseconds
=
l_time1
.
second_part
-
l_sign
*
l_time2
.
second_part
;
microseconds
=
l_time1
.
second_part
-
l_sign
*
l_time2
.
second_part
;
seconds
=
((
longlong
)
days
*
86400L
+
l_time1
.
hour
*
3600L
+
seconds
=
((
longlong
)
days
*
86400L
+
l_time1
.
hour
*
3600L
+
l_time1
.
minute
*
60L
+
l_time1
.
second
+
microseconds
/
1000000L
-
l_time1
.
minute
*
60L
+
l_time1
.
second
+
microseconds
/
1000000L
-
(
longlong
)
l_sign
*
(
l_time2
.
hour
*
3600L
+
l_time2
.
minute
*
60L
+
l_time2
.
second
));
(
longlong
)
l_sign
*
(
l_time2
.
hour
*
3600L
+
l_time2
.
minute
*
60L
+
l_time2
.
second
));
l_time3
.
neg
=
0
;
l_time3
.
neg
=
0
;
if
(
seconds
<
0
)
if
(
seconds
<
0
)
...
@@ -2145,7 +2145,7 @@ String *Item_func_timediff::val_str(String *str)
...
@@ -2145,7 +2145,7 @@ String *Item_func_timediff::val_str(String *str)
if
((
l_time2
.
neg
==
l_time1
.
neg
)
&&
l_time1
.
neg
)
if
((
l_time2
.
neg
==
l_time1
.
neg
)
&&
l_time1
.
neg
)
l_time3
.
neg
=
l_time3
.
neg
?
0
:
1
;
l_time3
.
neg
=
l_time3
.
neg
?
0
:
1
;
calc_time_from_sec
(
&
l_time3
,
seconds
,
microseconds
);
calc_time_from_sec
(
&
l_time3
,
(
long
)
seconds
,
microseconds
);
if
(
!
make_datetime
(
l_time1
.
second_part
||
l_time2
.
second_part
?
if
(
!
make_datetime
(
l_time1
.
second_part
||
l_time2
.
second_part
?
TIME_MICROSECOND
:
TIME_ONLY
,
TIME_MICROSECOND
:
TIME_ONLY
,
...
@@ -2167,9 +2167,9 @@ String *Item_func_maketime::val_str(String *str)
...
@@ -2167,9 +2167,9 @@ String *Item_func_maketime::val_str(String *str)
{
{
TIME
ltime
;
TIME
ltime
;
long
hour
=
args
[
0
]
->
val_int
();
long
hour
=
(
long
)
args
[
0
]
->
val_int
();
long
minute
=
args
[
1
]
->
val_int
();
long
minute
=
(
long
)
args
[
1
]
->
val_int
();
long
second
=
args
[
2
]
->
val_int
();
long
second
=
(
long
)
args
[
2
]
->
val_int
();
if
((
null_value
=
(
args
[
0
]
->
null_value
||
if
((
null_value
=
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
args
[
1
]
->
null_value
||
...
@@ -2185,9 +2185,9 @@ String *Item_func_maketime::val_str(String *str)
...
@@ -2185,9 +2185,9 @@ String *Item_func_maketime::val_str(String *str)
ltime
.
neg
=
1
;
ltime
.
neg
=
1
;
hour
=
-
hour
;
hour
=
-
hour
;
}
}
ltime
.
hour
=
(
ulong
)
hour
;
ltime
.
hour
=
(
ulong
)
hour
;
ltime
.
minute
=
(
ulong
)
minute
;
ltime
.
minute
=
(
ulong
)
minute
;
ltime
.
second
=
(
ulong
)
second
;
ltime
.
second
=
(
ulong
)
second
;
make_time
((
DATE_TIME_FORMAT
*
)
0
,
&
ltime
,
str
);
make_time
((
DATE_TIME_FORMAT
*
)
0
,
&
ltime
,
str
);
return
str
;
return
str
;
}
}
...
...
sql/set_var.cc
View file @
8aeb63dd
...
@@ -1884,7 +1884,7 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
...
@@ -1884,7 +1884,7 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
bool
sys_var_key_cache_long
::
update
(
THD
*
thd
,
set_var
*
var
)
bool
sys_var_key_cache_long
::
update
(
THD
*
thd
,
set_var
*
var
)
{
{
ulong
tmp
=
var
->
value
->
val_int
();
ulong
tmp
=
(
ulong
)
var
->
value
->
val_int
();
LEX_STRING
*
base_name
=
&
var
->
base
;
LEX_STRING
*
base_name
=
&
var
->
base
;
bool
error
=
0
;
bool
error
=
0
;
...
...
sql/sql_prepare.cc
View file @
8aeb63dd
...
@@ -1056,7 +1056,6 @@ void mysql_stmt_reset(THD *thd, char *packet)
...
@@ -1056,7 +1056,6 @@ void mysql_stmt_reset(THD *thd, char *packet)
void
mysql_stmt_free
(
THD
*
thd
,
char
*
packet
)
void
mysql_stmt_free
(
THD
*
thd
,
char
*
packet
)
{
{
ulong
stmt_id
=
uint4korr
(
packet
);
ulong
stmt_id
=
uint4korr
(
packet
);
PREP_STMT
*
stmt
;
DBUG_ENTER
(
"mysql_stmt_free"
);
DBUG_ENTER
(
"mysql_stmt_free"
);
if
(
!
find_prepared_statement
(
thd
,
stmt_id
,
"close"
))
if
(
!
find_prepared_statement
(
thd
,
stmt_id
,
"close"
))
...
...
sql/sql_repl.cc
View file @
8aeb63dd
...
@@ -1080,8 +1080,9 @@ int change_master(THD* thd, MASTER_INFO* mi)
...
@@ -1080,8 +1080,9 @@ int change_master(THD* thd, MASTER_INFO* mi)
of replication is not 100% clear, so we guard against problems using
of replication is not 100% clear, so we guard against problems using
max().
max().
*/
*/
mi
->
master_log_pos
=
max
(
BIN_LOG_HEADER_SIZE
,
mi
->
rli
.
master_log_pos
);
mi
->
master_log_pos
=
max
(
BIN_LOG_HEADER_SIZE
,
strmake
(
mi
->
master_log_name
,
mi
->
rli
.
master_log_name
,
mi
->
rli
.
group_master_log_pos
);
strmake
(
mi
->
master_log_name
,
mi
->
rli
.
group_master_log_name
,
sizeof
(
mi
->
master_log_name
)
-
1
);
sizeof
(
mi
->
master_log_name
)
-
1
);
}
}
...
...
sql/sql_select.h
View file @
8aeb63dd
...
@@ -166,11 +166,23 @@ class JOIN :public Sql_alloc
...
@@ -166,11 +166,23 @@ class JOIN :public Sql_alloc
JOIN
*
tmp_join
;
// copy of this JOIN to be used with temporary tables
JOIN
*
tmp_join
;
// copy of this JOIN to be used with temporary tables
ROLLUP
rollup
;
// Used with rollup
ROLLUP
rollup
;
// Used with rollup
bool
select_distinct
,
//Is select distinct?
bool
select_distinct
;
// Set if SELECT DISTINCT
no_order
,
simple_order
,
simple_group
,
skip_sort_order
,
need_tmp
,
/*
hidden_group_fields
,
simple_xxxxx is set if ORDER/GROUP BY doesn't include any references
buffer_result
;
to other tables than the first non-constant table in the JOIN.
It's also set if ORDER/GROUP BY is empty.
*/
bool
simple_order
,
simple_group
;
/*
Is set only in case if we have a GROUP BY clause
and no ORDER BY after constant elimination of 'order'.
*/
bool
no_order
;
/* Is set if we have a GROUP BY and we have ORDER BY on a constant. */
bool
skip_sort_order
;
bool
need_tmp
,
hidden_group_fields
,
buffer_result
;
DYNAMIC_ARRAY
keyuse
;
DYNAMIC_ARRAY
keyuse
;
Item
::
cond_result
cond_value
;
Item
::
cond_result
cond_value
;
List
<
Item
>
all_fields
;
// to store all fields that used in query
List
<
Item
>
all_fields
;
// to store all fields that used in query
...
...
sql/sql_table.cc
View file @
8aeb63dd
...
@@ -1652,8 +1652,7 @@ int mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables,
...
@@ -1652,8 +1652,7 @@ int mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables,
check_opt
.
key_cache
=
key_cache
;
check_opt
.
key_cache
=
key_cache
;
DBUG_RETURN
(
mysql_admin_table
(
thd
,
tables
,
&
check_opt
,
DBUG_RETURN
(
mysql_admin_table
(
thd
,
tables
,
&
check_opt
,
"assign_to_keycache"
,
TL_READ_NO_INSERT
,
0
,
"assign_to_keycache"
,
TL_READ_NO_INSERT
,
0
,
HA_OPEN_TO_ASSIGN
,
0
,
0
,
0
,
&
handler
::
assign_to_keycache
));
&
handler
::
assign_to_keycache
));
}
}
...
...
strings/ctype-tis620.c
View file @
8aeb63dd
...
@@ -472,13 +472,13 @@ static uchar *thai2sortable(const uchar *tstr, uint len, uint *out_length)
...
@@ -472,13 +472,13 @@ static uchar *thai2sortable(const uchar *tstr, uint len, uint *out_length)
const
uchar
*
p
=
tstr
;
const
uchar
*
p
=
tstr
;
uchar
*
outBuf
;
uchar
*
outBuf
;
uchar
*
pRight1
,
*
pRight2
,
*
pRight3
;
uchar
*
pRight1
,
*
pRight2
,
*
pRight3
;
uchar
*
pLeft
1
,
*
pLeft
2
,
*
pLeft3
;
uchar
*
pLeft2
,
*
pLeft3
;
uint
bufSize
;
uint
bufSize
;
uint
RightSize
;
uint
RightSize
;
bufSize
=
(
uint
)
(
len
+
1
)
*
BUFFER_MULTIPLY
;
bufSize
=
(
uint
)
(
len
+
1
)
*
BUFFER_MULTIPLY
;
RightSize
=
sizeof
(
uchar
)
*
(
len
+
1
);
RightSize
=
sizeof
(
uchar
)
*
(
len
+
1
);
if
(
!
(
outBuf
=
p
Left1
=
p
Right1
=
if
(
!
(
outBuf
=
pRight1
=
(
uchar
*
)
malloc
(
sizeof
(
uchar
)
*
bufSize
+
RightSize
*
2
)))
(
uchar
*
)
malloc
(
sizeof
(
uchar
)
*
bufSize
+
RightSize
*
2
)))
{
{
/*
/*
...
@@ -608,8 +608,8 @@ int my_strnxfrm_tis620(CHARSET_INFO *cs __attribute__((unused)),
...
@@ -608,8 +608,8 @@ int my_strnxfrm_tis620(CHARSET_INFO *cs __attribute__((unused)),
int
my_strcoll_tis620
(
const
uchar
*
s1
,
const
uchar
*
s2
)
int
my_strcoll_tis620
(
const
uchar
*
s1
,
const
uchar
*
s2
)
{
{
return
my_strnncoll_tis620
((
CHARSET_INFO
*
)
0
,
s1
,
strlen
(
s1
),
s2
,
return
my_strnncoll_tis620
((
CHARSET_INFO
*
)
0
,
s1
,
strlen
(
(
char
*
)
s1
)
,
s
trlen
(
s1
));
s
2
,
strlen
((
char
*
)
s1
));
}
}
...
...
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