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
e47742cb
Commit
e47742cb
authored
May 11, 2006
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: Merge revisions 536:558 from trunk.
parent
e69d2f57
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
279 additions
and
12 deletions
+279
-12
Makefile.am
Makefile.am
+1
-1
export.sh
export.sh
+15
-7
handler/ha_innodb.cc
handler/ha_innodb.cc
+23
-0
include/fil0fil.h
include/fil0fil.h
+14
-2
include/ha_prototypes.h
include/ha_prototypes.h
+22
-0
include/mem0mem.h
include/mem0mem.h
+27
-0
include/rem0rec.h
include/rem0rec.h
+4
-2
mem/mem0mem.c
mem/mem0mem.c
+166
-0
pars/pars0sym.c
pars/pars0sym.c
+7
-0
No files found.
Makefile.am
View file @
e47742cb
...
...
@@ -76,7 +76,7 @@ EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr
include/univ.i include/usr0sess.h include/usr0sess.ic include/usr0types.h
\
include/ut0byte.h include/ut0byte.ic include/ut0dbg.h include/ut0lst.h
\
include/ut0mem.h include/ut0mem.ic include/ut0rnd.h include/ut0rnd.ic
\
include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic
\
include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic
include/ha_prototypes.h
\
cmakelists.txt
noinst_LIBRARIES
=
libinnobase.a
...
...
export.sh
View file @
e47742cb
...
...
@@ -21,16 +21,24 @@ fi
set
-u
rm
-rf
to-mysql
mkdir
-p
to-mysql/storage/
mkdir
to-mysql
{
,/storage,/patches,/mysql-test
{
,/t,/r,/include
}}
svn log
-v
-r
"
$((
$1
+
1
))
:BASE"
>
to-mysql/log
svn
export
-q
.
to-mysql/storage/innobase
cd
to-mysql
mkdir
-p
sql mysql-test/t mysql-test/r mysql-test/include
cd
storage/innobase
mv
handler/
*
../../sql
rmdir
handler
seq
$((
$1
+
1
))
$2
|while
read
REV
do
PATCH
=
to-mysql/patches/r
$REV
.patch
svn log
-v
-r
$REV
>
$PATCH
if
[
$(
wc
-c
<
$PATCH
)
-gt
73
]
then
svn diff
-r
$((
$REV
-
1
))
:
$REV
>>
$PATCH
else
rm
$PATCH
fi
done
cd
to-mysql/storage/innobase
mv
handler ../../sql
mv
mysql-test/
*
.test mysql-test/
*
.opt ../../mysql-test/t
mv
mysql-test/
*
.result ../../mysql-test/r
...
...
handler/ha_innodb.cc
View file @
e47742cb
...
...
@@ -134,6 +134,7 @@ extern "C" {
#include "../storage/innobase/include/fil0fil.h"
#include "../storage/innobase/include/trx0xa.h"
#include "../storage/innobase/include/thr0loc.h"
#include "../storage/innobase/include/ha_prototypes.h"
}
#define HA_INNOBASE_ROWS_IN_TABLE 10000
/* to get optimization right */
...
...
@@ -780,6 +781,25 @@ innobase_mysql_tmpfile(void)
return
(
fd2
);
}
/*************************************************************************
Wrapper around MySQL's copy_and_convert function, see it for
documentation. */
extern
"C"
ulint
innobase_convert_string
(
/*====================*/
void
*
to
,
ulint
to_length
,
CHARSET_INFO
*
to_cs
,
const
void
*
from
,
ulint
from_length
,
CHARSET_INFO
*
from_cs
,
uint
*
errors
)
{
return
(
copy_and_convert
((
char
*
)
to
,
to_length
,
to_cs
,
(
const
char
*
)
from
,
from_length
,
from_cs
,
errors
));
}
/*************************************************************************
Gets the InnoDB transaction handle for a MySQL handler object, creates
an InnoDB transaction struct if the corresponding MySQL thread struct still
...
...
@@ -4131,6 +4151,9 @@ ha_innobase::index_prev(
mysql_byte
*
buf
)
/* in/out: buffer for previous row in MySQL
format */
{
statistic_increment
(
current_thd
->
status_var
.
ha_read_prev_count
,
&
LOCK_status
);
return
(
general_fetch
(
buf
,
ROW_SEL_PREV
,
0
));
}
...
...
include/fil0fil.h
View file @
e47742cb
...
...
@@ -57,11 +57,23 @@ extern fil_addr_t fil_addr_null;
page */
#define FIL_PAGE_OFFSET 4
/* page offset inside space */
#define FIL_PAGE_PREV 8
/* if there is a 'natural' predecessor
of the page, its offset */
of the page, its offset.
Otherwise FIL_NULL.
This field is not set on BLOB pages,
which are stored as a singly-linked
list. See also FIL_PAGE_NEXT. */
#define FIL_PAGE_ZBLOB_SPACE_ID 8
/* space id of a compressed BLOB page,
4 bytes */
#define FIL_PAGE_NEXT 12
/* if there is a 'natural' successor
of the page, its offset */
of the page, its offset.
Otherwise FIL_NULL.
B-tree index pages
(FIL_PAGE_TYPE contains FIL_PAGE_INDEX)
on the same PAGE_LEVEL are maintained
as a doubly linked list via
FIL_PAGE_PREV and FIL_PAGE_NEXT
in the collation order of the
smallest user record on each page. */
#define FIL_PAGE_LSN 16
/* lsn of the end of the newest
modification log record to the page */
#define FIL_PAGE_TYPE 24
/* file page type: FIL_PAGE_INDEX,...,
...
...
include/ha_prototypes.h
0 → 100644
View file @
e47742cb
#ifndef HA_INNODB_PROTOTYPES_H
#define HA_INNODB_PROTOTYPES_H
/* Prototypes for global functions in ha_innodb.cc that are called by
InnoDB's C-code. */
/*************************************************************************
Wrapper around MySQL's copy_and_convert function, see it for
documentation. */
ulint
innobase_convert_string
(
/*====================*/
void
*
to
,
ulint
to_length
,
CHARSET_INFO
*
to_cs
,
const
void
*
from
,
ulint
from_length
,
CHARSET_INFO
*
from_cs
,
uint
*
errors
);
#endif
include/mem0mem.h
View file @
e47742cb
...
...
@@ -333,6 +333,33 @@ mem_heap_dup(
const
void
*
data
,
/* in: data to be copied */
ulint
len
);
/* in: length of data, in bytes */
/**************************************************************************
Concatenate two memory blocks and return the result, using a memory heap. */
void
*
mem_heap_cat
(
/*=========*/
/* out, own: the result */
mem_heap_t
*
heap
,
/* in: memory heap where result is allocated */
const
void
*
b1
,
/* in: block 1 */
ulint
len1
,
/* in: length of b1, in bytes */
const
void
*
b2
,
/* in: block 2 */
ulint
len2
);
/* in: length of b2, in bytes */
/********************************************************************
A simple (s)printf replacement that dynamically allocates the space for the
formatted string from the given heap. This supports a very limited set of
the printf syntax: types 's' and 'u' and length modifier 'l' (which is
required for the 'u' type). */
char
*
mem_heap_printf
(
/*============*/
/* out: heap-allocated formatted string */
mem_heap_t
*
heap
,
/* in: memory heap */
const
char
*
format
,
/* in: format string */
...)
__attribute__
((
format
(
printf
,
2
,
3
)));
#ifdef MEM_PERIODIC_CHECK
/**********************************************************************
Goes through the list of all allocated mem blocks, checks their magic
...
...
include/rem0rec.h
View file @
e47742cb
...
...
@@ -18,8 +18,10 @@ Created 5/30/1994 Heikki Tuuri
/* Maximum values for various fields (for non-blob tuples) */
#define REC_MAX_N_FIELDS (1024 - 1)
/* Flag denoting the predefined minimum record: this bit is ORed in the 4
info bits of a record */
/* Info bit denoting the predefined minimum record: this bit is set
if and only if the record is the first user record on a non-leaf
B-tree page that is the leftmost page on its level
(PAGE_LEVEL is nonzero and FIL_PAGE_PREV is FIL_NULL). */
#define REC_INFO_MIN_REC_FLAG 0x10UL
/* The deleted flag in info bits */
#define REC_INFO_DELETED_FLAG 0x20UL
/* when bit is set to 1, it means the
...
...
mem/mem0mem.c
View file @
e47742cb
...
...
@@ -17,6 +17,7 @@ Created 6/9/1994 Heikki Tuuri
#include "btr0sea.h"
#include "srv0srv.h"
#include "mem0dbg.c"
#include <stdarg.h>
/*
THE MEMORY MANAGEMENT
...
...
@@ -127,6 +128,27 @@ mem_heap_dup(
return
(
memcpy
(
mem_heap_alloc
(
heap
,
len
),
data
,
len
));
}
/**************************************************************************
Concatenate two memory blocks and return the result, using a memory heap. */
void
*
mem_heap_cat
(
/*=========*/
/* out, own: the result */
mem_heap_t
*
heap
,
/* in: memory heap where result is allocated */
const
void
*
b1
,
/* in: block 1 */
ulint
len1
,
/* in: length of b1, in bytes */
const
void
*
b2
,
/* in: block 2 */
ulint
len2
)
/* in: length of b2, in bytes */
{
void
*
res
=
mem_heap_alloc
(
heap
,
len1
+
len2
);
memcpy
(
res
,
b1
,
len1
);
memcpy
(
res
+
len1
,
b2
,
len2
);
return
(
res
);
}
/**************************************************************************
Concatenate two strings and return the result, using a memory heap. */
...
...
@@ -152,6 +174,150 @@ mem_heap_strcat(
return
(
s
);
}
/********************************************************************
Helper function for mem_heap_printf. */
static
ulint
mem_heap_printf_low
(
/*================*/
/* out: length of formatted string,
including terminating NUL */
char
*
buf
,
/* in/out: buffer to store formatted string
in, or NULL to just calculate length */
const
char
*
format
,
/* in: format string */
va_list
ap
)
/* in: arguments */
{
ulint
len
=
0
;
while
(
*
format
)
{
/* Does this format specifier have the 'l' length modifier. */
ibool
is_long
=
FALSE
;
/* Length of one parameter. */
size_t
plen
;
if
(
*
format
++
!=
'%'
)
{
/* Non-format character. */
len
++
;
if
(
buf
)
{
*
buf
++
=
*
(
format
-
1
);
}
continue
;
}
if
(
*
format
==
'l'
)
{
is_long
=
TRUE
;
format
++
;
}
switch
(
*
format
++
)
{
case
's'
:
/* string */
{
char
*
s
=
va_arg
(
ap
,
char
*
);
/* "%ls" is a non-sensical format specifier. */
ut_a
(
!
is_long
);
plen
=
strlen
(
s
);
len
+=
plen
;
if
(
buf
)
{
memcpy
(
buf
,
s
,
plen
);
buf
+=
plen
;
}
}
break
;
case
'u'
:
/* unsigned int */
{
char
tmp
[
32
];
unsigned
long
val
;
/* We only support 'long' values for now. */
ut_a
(
is_long
);
val
=
va_arg
(
ap
,
unsigned
long
);
plen
=
sprintf
(
tmp
,
"%lu"
,
val
);
len
+=
plen
;
if
(
buf
)
{
memcpy
(
buf
,
tmp
,
plen
);
buf
+=
plen
;
}
}
break
;
case
'%'
:
/* "%l%" is a non-sensical format specifier. */
ut_a
(
!
is_long
);
len
++
;
if
(
buf
)
{
*
buf
++
=
'%'
;
}
break
;
default:
ut_error
;
}
}
/* For the NUL character. */
len
++
;
if
(
buf
)
{
*
buf
=
'\0'
;
}
return
(
len
);
}
/********************************************************************
A simple (s)printf replacement that dynamically allocates the space for the
formatted string from the given heap. This supports a very limited set of
the printf syntax: types 's' and 'u' and length modifier 'l' (which is
required for the 'u' type). */
char
*
mem_heap_printf
(
/*============*/
/* out: heap-allocated formatted string */
mem_heap_t
*
heap
,
/* in: memory heap */
const
char
*
format
,
/* in: format string */
...)
{
va_list
ap
;
char
*
str
;
ulint
len
;
/* Calculate length of string */
len
=
0
;
va_start
(
ap
,
format
);
len
=
mem_heap_printf_low
(
NULL
,
format
,
ap
);
va_end
(
ap
);
/* Now create it for real. */
str
=
mem_heap_alloc
(
heap
,
len
);
va_start
(
ap
,
format
);
mem_heap_printf_low
(
str
,
format
,
ap
);
va_end
(
ap
);
return
(
str
);
}
/*******************************************************************
Creates a memory heap block where data can be allocated. */
...
...
pars/pars0sym.c
View file @
e47742cb
...
...
@@ -207,6 +207,13 @@ sym_tab_add_bound_lit(
*
lit_type
=
PARS_STR_LIT
;
break
;
case
DATA_CHAR
:
ut_a
(
blit
->
length
>
0
);
len
=
blit
->
length
;
*
lit_type
=
PARS_STR_LIT
;
break
;
case
DATA_INT
:
ut_a
(
blit
->
length
>
0
);
ut_a
(
blit
->
length
<=
8
);
...
...
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