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
b0a0c542
Commit
b0a0c542
authored
Aug 26, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in auto-increment handling with InnoDB
Some small speedups
parent
2adf2fad
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
21 deletions
+49
-21
Docs/manual.texi
Docs/manual.texi
+2
-0
client/mysqldump.c
client/mysqldump.c
+5
-3
mysys/mf_casecnv.c
mysys/mf_casecnv.c
+20
-12
sql-bench/test-insert.sh
sql-bench/test-insert.sh
+2
-2
sql-bench/test-select.sh
sql-bench/test-select.sh
+3
-3
sql/field.h
sql/field.h
+14
-0
sql/gen_lex_hash.cc
sql/gen_lex_hash.cc
+1
-1
sql/ha_innobase.cc
sql/ha_innobase.cc
+2
-0
No files found.
Docs/manual.texi
View file @
b0a0c542
...
...
@@ -46672,6 +46672,8 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.42
@itemize @bullet
@item
Fixed bug in @code{InnoDB} and @code{AUTO_INCREMENT} columns.
@item
Applied large patch for OS/2 from Yuri Dario.
@item
Fixed problem with InnoDB when one could get the error @code{Can't
client/mysqldump.c
View file @
b0a0c542
...
...
@@ -37,7 +37,7 @@
** Tnu Samuel <tonu@please.do.not.remove.this.spam.ee>
**/
#define DUMP_VERSION "8.1
4
"
#define DUMP_VERSION "8.1
5
"
#include <global.h>
#include <my_sys.h>
...
...
@@ -1224,6 +1224,7 @@ static int dump_all_tables_in_db(char *database)
{
char
*
table
;
uint
numrows
;
char
table_buff
[
NAME_LEN
+
3
];
if
(
init_dumping
(
database
))
return
1
;
...
...
@@ -1233,7 +1234,7 @@ static int dump_all_tables_in_db(char *database)
init_dynamic_string
(
&
query
,
"LOCK TABLES "
,
256
,
1024
);
for
(
numrows
=
0
;
(
table
=
getTableName
(
1
))
;
numrows
++
)
{
dynstr_append
(
&
query
,
table
);
dynstr_append
(
&
query
,
quote_name
(
table
,
table_buff
)
);
dynstr_append
(
&
query
,
" READ /*!32311 LOCAL */,"
);
}
if
(
numrows
&&
mysql_real_query
(
sock
,
query
.
str
,
query
.
length
-
1
))
...
...
@@ -1263,6 +1264,7 @@ static int dump_all_tables_in_db(char *database)
static
int
dump_selected_tables
(
char
*
db
,
char
**
table_names
,
int
tables
)
{
uint
numrows
;
char
table_buff
[
NAME_LEN
+
3
];
if
(
init_dumping
(
db
))
return
1
;
...
...
@@ -1274,7 +1276,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
init_dynamic_string
(
&
query
,
"LOCK TABLES "
,
256
,
1024
);
for
(
i
=
0
;
i
<
tables
;
i
++
)
{
dynstr_append
(
&
query
,
table_names
[
i
]
);
dynstr_append
(
&
query
,
quote_name
(
table_names
[
i
],
table_buff
)
);
dynstr_append
(
&
query
,
" READ /*!32311 LOCAL */,"
);
}
if
(
mysql_real_query
(
sock
,
query
.
str
,
query
.
length
-
1
))
...
...
mysys/mf_casecnv.c
View file @
b0a0c542
...
...
@@ -31,14 +31,16 @@
void
caseup_str
(
my_string
str
)
{
#ifdef USE_MB
register
uint32
l
;
register
char
*
end
=
str
+
(
uint
)
strlen
(
str
);
if
(
use_mb
(
default_charset_info
))
{
register
uint32
l
;
register
char
*
end
=
str
+
(
uint
)
strlen
(
str
);
while
(
*
str
)
{
if
((
l
=
my_ismbchar
(
default_charset_info
,
str
,
end
)))
str
+=
l
;
else
*
str
=
toupper
(
*
str
),
++
str
;
}
}
else
#endif
while
((
*
str
=
toupper
(
*
str
))
!=
0
)
...
...
@@ -50,14 +52,16 @@ void caseup_str(my_string str)
void
casedn_str
(
my_string
str
)
{
#ifdef USE_MB
register
uint32
l
;
register
char
*
end
=
str
+
(
uint
)
strlen
(
str
);
if
(
use_mb
(
default_charset_info
))
{
register
uint32
l
;
register
char
*
end
=
str
+
(
uint
)
strlen
(
str
);
while
(
*
str
)
{
if
((
l
=
my_ismbchar
(
default_charset_info
,
str
,
end
)))
str
+=
l
;
else
*
str
=
tolower
(
*
str
),
++
str
;
}
}
else
#endif
while
((
*
str
=
tolower
(
*
str
))
!=
0
)
...
...
@@ -70,14 +74,16 @@ void casedn_str(my_string str)
void
caseup
(
my_string
str
,
uint
length
)
{
#ifdef USE_MB
register
uint32
l
;
register
char
*
end
=
str
+
length
;
if
(
use_mb
(
default_charset_info
))
{
register
uint32
l
;
register
char
*
end
=
str
+
length
;
while
(
str
<
end
)
{
if
((
l
=
my_ismbchar
(
default_charset_info
,
str
,
end
)))
str
+=
l
;
else
*
str
=
toupper
(
*
str
),
++
str
;
}
}
else
#endif
for
(
;
length
>
0
;
length
--
,
str
++
)
...
...
@@ -89,14 +95,16 @@ void caseup(my_string str, uint length)
void
casedn
(
my_string
str
,
uint
length
)
{
#ifdef USE_MB
register
uint32
l
;
register
char
*
end
=
str
+
length
;
if
(
use_mb
(
default_charset_info
))
{
register
uint32
l
;
register
char
*
end
=
str
+
length
;
while
(
str
<
end
)
{
if
((
l
=
my_ismbchar
(
default_charset_info
,
str
,
end
)))
str
+=
l
;
else
*
str
=
tolower
(
*
str
),
++
str
;
}
}
else
#endif
for
(
;
length
>
0
;
length
--
,
str
++
)
...
...
@@ -143,10 +151,10 @@ my_string my_strcasestr(const char *str, const char *search)
int
my_strcasecmp
(
const
char
*
s
,
const
char
*
t
)
{
#ifdef USE_MB
register
uint32
l
;
register
const
char
*
end
=
s
+
(
uint
)
strlen
(
s
);
if
(
use_mb
(
default_charset_info
))
{
register
uint32
l
;
register
const
char
*
end
=
s
+
(
uint
)
strlen
(
s
);
while
(
s
<
end
)
{
if
((
l
=
my_ismbchar
(
default_charset_info
,
s
,
end
)))
...
...
@@ -172,10 +180,10 @@ int my_strcasecmp(const char *s, const char *t)
int
my_casecmp
(
const
char
*
s
,
const
char
*
t
,
uint
len
)
{
#ifdef USE_MB
register
uint32
l
;
register
const
char
*
end
=
s
+
len
;
if
(
use_mb
(
default_charset_info
))
{
register
uint32
l
;
register
const
char
*
end
=
s
+
len
;
while
(
s
<
end
)
{
if
((
l
=
my_ismbchar
(
default_charset_info
,
s
,
end
)))
...
...
sql-bench/test-insert.sh
View file @
b0a0c542
...
...
@@ -562,7 +562,7 @@ if ($limits->{'group_functions'})
fetch_all_rows
(
$dbh
,
"select min(id) from bench1"
)
;
fetch_all_rows
(
$dbh
,
"select max(id) from bench1"
)
;
fetch_all_rows
(
$dbh
,
"select sum(id+0.0) from bench1"
)
;
fetch_all_rows
(
$dbh
,
"select min(id3),max(id3),sum(id3
+
0.0) from bench1"
)
;
fetch_all_rows
(
$dbh
,
"select min(id3),max(id3),sum(id3
-
0.0) from bench1"
)
;
if
(
$limits
->
{
'group_func_sql_min_str'
})
{
fetch_all_rows
(
$dbh
,
"select min(dummy1),max(dummy1) from bench1"
)
;
...
...
@@ -579,7 +579,7 @@ if ($limits->{'group_functions'})
$count
++
;
$sth
=
$dbh
->prepare
(
$query
=
"select count(*),sum(id+0.0),min(id),max(id),avg(id
+
0.0) from bench1"
)
or die
$DBI
::errstr
;
$sth
=
$dbh
->prepare
(
$query
=
"select count(*),sum(id+0.0),min(id),max(id),avg(id
-
0.0) from bench1"
)
or die
$DBI
::errstr
;
$sth
->execute or die
$DBI
::errstr
;
@row
=
$sth
->fetchrow_array
;
if
(
$row
[
0]
!=
$total_rows
||
...
...
sql-bench/test-select.sh
View file @
b0a0c542
...
...
@@ -136,12 +136,12 @@ if ($limits->{'group_functions'})
print
"Test if the database has a query cache
\n
"
;
# First ensure that the table is read into memory
fetch_all_rows
(
$dbh
,
"select sum(idn+
$tmp
),sum(rev_idn
+
$tmp
) from bench1"
)
;
fetch_all_rows
(
$dbh
,
"select sum(idn+
$tmp
),sum(rev_idn
-
$tmp
) from bench1"
)
;
$loop_time
=
new Benchmark
;
for
(
$tests
=
0
;
$tests
<
$opt_loop_count
;
$tests
++
)
{
fetch_all_rows
(
$dbh
,
"select sum(idn+
$tests
),sum(rev_idn
+
$tests
) from bench1"
)
;
fetch_all_rows
(
$dbh
,
"select sum(idn+
$tests
),sum(rev_idn
-
$tests
) from bench1"
)
;
}
$end_time
=
new Benchmark
;
print
"Time for select_query_cache (
$opt_loop_count
): "
.
...
...
@@ -153,7 +153,7 @@ if ($limits->{'group_functions'})
$loop_time
=
new Benchmark
;
for
(
$tests
=
0
;
$tests
<
$opt_loop_count
;
$tests
++
)
{
fetch_all_rows
(
$dbh
,
"select sum(idn+
$tests
),sum(rev_idn
+
$tests
) from bench1"
)
;
fetch_all_rows
(
$dbh
,
"select sum(idn+
$tests
),sum(rev_idn
-
$tests
) from bench1"
)
;
}
$end_time
=
new Benchmark
;
print
"Time for select_query_cache2 (
$opt_loop_count
): "
.
...
...
sql/field.h
View file @
b0a0c542
...
...
@@ -300,6 +300,7 @@ class Field_tiny :public Field_num {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
(
void
)
{
ptr
[
0
]
=
0
;
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -328,6 +329,7 @@ class Field_short :public Field_num {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
(
void
)
{
ptr
[
0
]
=
ptr
[
1
]
=
0
;
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -356,6 +358,7 @@ class Field_medium :public Field_num {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
(
void
)
{
ptr
[
0
]
=
ptr
[
1
]
=
ptr
[
2
]
=
0
;
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -389,6 +392,7 @@ class Field_long :public Field_num {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
(
void
)
{
ptr
[
0
]
=
ptr
[
1
]
=
ptr
[
2
]
=
ptr
[
3
]
=
0
;
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -423,6 +427,7 @@ class Field_longlong :public Field_num {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
(
void
)
{
ptr
[
0
]
=
ptr
[
1
]
=
ptr
[
2
]
=
ptr
[
3
]
=
ptr
[
4
]
=
ptr
[
5
]
=
ptr
[
6
]
=
ptr
[
7
]
=
0
;
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -449,6 +454,7 @@ class Field_float :public Field_num {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
(
void
)
{
bzero
(
ptr
,
sizeof
(
float
));
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -480,6 +486,7 @@ class Field_double :public Field_num {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
(
void
)
{
bzero
(
ptr
,
sizeof
(
double
));
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -505,6 +512,7 @@ class Field_null :public Field_str {
void
store
(
const
char
*
to
,
uint
length
)
{
null
[
0
]
=
1
;
}
void
store
(
double
nr
)
{
null
[
0
]
=
1
;
}
void
store
(
longlong
nr
)
{
null
[
0
]
=
1
;
}
void
reset
(
void
)
{}
double
val_real
(
void
)
{
return
0.0
;}
longlong
val_int
(
void
)
{
return
0
;}
String
*
val_str
(
String
*
value
,
String
*
value2
)
...
...
@@ -528,6 +536,7 @@ class Field_timestamp :public Field_num {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
(
void
)
{
ptr
[
0
]
=
ptr
[
1
]
=
ptr
[
2
]
=
ptr
[
3
]
=
0
;
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -588,6 +597,7 @@ class Field_date :public Field_str {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
(
void
)
{
ptr
[
0
]
=
ptr
[
1
]
=
ptr
[
2
]
=
ptr
[
3
]
=
0
;
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -615,6 +625,7 @@ class Field_newdate :public Field_str {
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
store_time
(
TIME
*
ltime
,
timestamp_type
type
);
void
reset
(
void
)
{
ptr
[
0
]
=
ptr
[
1
]
=
ptr
[
2
]
=
0
;
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -643,6 +654,7 @@ class Field_time :public Field_str {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
(
void
)
{
ptr
[
0
]
=
ptr
[
1
]
=
ptr
[
2
]
=
0
;
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -673,6 +685,7 @@ class Field_datetime :public Field_str {
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
store_time
(
TIME
*
ltime
,
timestamp_type
type
);
void
reset
(
void
)
{
ptr
[
0
]
=
ptr
[
1
]
=
ptr
[
2
]
=
ptr
[
3
]
=
ptr
[
4
]
=
ptr
[
5
]
=
ptr
[
6
]
=
ptr
[
7
]
=
0
;
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -922,6 +935,7 @@ class Field_enum :public Field_str {
void
store
(
const
char
*
to
,
uint
length
);
void
store
(
double
nr
);
void
store
(
longlong
nr
);
void
reset
()
{
bzero
(
ptr
,
packlength
);
}
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
sql/gen_lex_hash.cc
View file @
b0a0c542
...
...
@@ -472,7 +472,7 @@ int main(int argc,char **argv)
int
error
;
MY_INIT
(
argv
[
0
]);
start_value
=
4
87844L
;
best_t1
=
4969454L
;
best_t2
=
2266538L
;
best_type
=
2
;
/* mode=4567 add=5
type: 0 */
start_value
=
4
597269L
;
best_t1
=
6001982L
;
best_t2
=
5063828L
;
best_type
=
4
;
/* mode=4513 add=8
type: 0 */
if
(
get_options
(
argc
,(
char
**
)
argv
))
exit
(
1
);
...
...
sql/ha_innobase.cc
View file @
b0a0c542
...
...
@@ -1334,6 +1334,8 @@ ha_innobase::write_row(
autoincrement field */
auto_inc
=
table
->
next_number_field
->
val_int
();
if
(
auto_inc
==
0
)
auto_inc
=
user_thd
->
next_insert_id
;
if
(
auto_inc
!=
0
)
{
/* This call will calculate the max of the
...
...
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