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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7b994129
Commit
7b994129
authored
Aug 26, 2003
by
monty@narttu.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into narttu.mysql.fi:/my/mysql-4.1
parents
5b28d4a9
753cb850
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
42 deletions
+39
-42
mysql-test/t/loaddata.test
mysql-test/t/loaddata.test
+0
-4
mysys/my_malloc.c
mysys/my_malloc.c
+17
-17
mysys/my_realloc.c
mysys/my_realloc.c
+17
-16
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-0
sql/table.cc
sql/table.cc
+2
-5
No files found.
mysql-test/t/loaddata.test
View file @
7b994129
...
@@ -15,7 +15,3 @@ truncate table t1;
...
@@ -15,7 +15,3 @@ truncate table t1;
load
data
infile
'../../std_data/loaddata1.dat'
into
table
t1
fields
terminated
by
','
LINES
STARTING
BY
','
(
b
,
c
,
d
);
load
data
infile
'../../std_data/loaddata1.dat'
into
table
t1
fields
terminated
by
','
LINES
STARTING
BY
','
(
b
,
c
,
d
);
SELECT
*
from
t1
;
SELECT
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
mysys/my_malloc.c
View file @
7b994129
...
@@ -24,26 +24,26 @@
...
@@ -24,26 +24,26 @@
/* My memory allocator */
/* My memory allocator */
gptr
my_malloc
(
unsigned
int
Size
,
myf
MyF
lags
)
gptr
my_malloc
(
unsigned
int
size
,
myf
my_f
lags
)
{
{
gptr
point
;
gptr
point
;
DBUG_ENTER
(
"my_malloc"
);
DBUG_ENTER
(
"my_malloc"
);
DBUG_PRINT
(
"my"
,(
"
Size: %u MyFlags: %d"
,
Size
,
MyF
lags
));
DBUG_PRINT
(
"my"
,(
"
size: %u my_flags: %d"
,
size
,
my_f
lags
));
if
(
!
S
ize
)
if
(
!
s
ize
)
S
ize
=
1
;
/* Safety */
s
ize
=
1
;
/* Safety */
if
((
point
=
(
char
*
)
malloc
(
S
ize
))
==
NULL
)
if
((
point
=
(
char
*
)
malloc
(
s
ize
))
==
NULL
)
{
{
my_errno
=
errno
;
my_errno
=
errno
;
if
(
MyF
lags
&
MY_FAE
)
if
(
my_f
lags
&
MY_FAE
)
error_handler_hook
=
fatal_error_handler_hook
;
error_handler_hook
=
fatal_error_handler_hook
;
if
(
MyF
lags
&
(
MY_FAE
+
MY_WME
))
if
(
my_f
lags
&
(
MY_FAE
+
MY_WME
))
my_error
(
EE_OUTOFMEMORY
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
S
ize
);
my_error
(
EE_OUTOFMEMORY
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
s
ize
);
if
(
MyF
lags
&
MY_FAE
)
if
(
my_f
lags
&
MY_FAE
)
exit
(
1
);
exit
(
1
);
}
}
else
if
(
MyF
lags
&
MY_ZEROFILL
)
else
if
(
my_f
lags
&
MY_ZEROFILL
)
bzero
(
point
,
S
ize
);
bzero
(
point
,
s
ize
);
DBUG_PRINT
(
"exit"
,(
"ptr: %lx"
,
point
));
DBUG_PRINT
(
"exit"
,(
"ptr: %lx"
,
point
));
DBUG_RETURN
(
point
);
DBUG_RETURN
(
point
);
}
/* my_malloc */
}
/* my_malloc */
...
@@ -64,29 +64,29 @@ void my_no_flags_free(gptr ptr)
...
@@ -64,29 +64,29 @@ void my_no_flags_free(gptr ptr)
/* malloc and copy */
/* malloc and copy */
gptr
my_memdup
(
const
byte
*
from
,
uint
length
,
myf
MyF
lags
)
gptr
my_memdup
(
const
byte
*
from
,
uint
length
,
myf
my_f
lags
)
{
{
gptr
ptr
;
gptr
ptr
;
if
((
ptr
=
my_malloc
(
length
,
MyF
lags
))
!=
0
)
if
((
ptr
=
my_malloc
(
length
,
my_f
lags
))
!=
0
)
memcpy
((
byte
*
)
ptr
,
(
byte
*
)
from
,(
size_t
)
length
);
memcpy
((
byte
*
)
ptr
,
(
byte
*
)
from
,(
size_t
)
length
);
return
(
ptr
);
return
(
ptr
);
}
}
char
*
my_strdup
(
const
char
*
from
,
myf
MyF
lags
)
char
*
my_strdup
(
const
char
*
from
,
myf
my_f
lags
)
{
{
gptr
ptr
;
gptr
ptr
;
uint
length
=
(
uint
)
strlen
(
from
)
+
1
;
uint
length
=
(
uint
)
strlen
(
from
)
+
1
;
if
((
ptr
=
my_malloc
(
length
,
MyF
lags
))
!=
0
)
if
((
ptr
=
my_malloc
(
length
,
my_f
lags
))
!=
0
)
memcpy
((
byte
*
)
ptr
,
(
byte
*
)
from
,(
size_t
)
length
);
memcpy
((
byte
*
)
ptr
,
(
byte
*
)
from
,(
size_t
)
length
);
return
((
my_string
)
ptr
);
return
((
my_string
)
ptr
);
}
}
char
*
my_strdup_with_length
(
const
byte
*
from
,
uint
length
,
myf
MyF
lags
)
char
*
my_strdup_with_length
(
const
byte
*
from
,
uint
length
,
myf
my_f
lags
)
{
{
gptr
ptr
;
gptr
ptr
;
if
((
ptr
=
my_malloc
(
length
+
1
,
MyF
lags
))
!=
0
)
if
((
ptr
=
my_malloc
(
length
+
1
,
my_f
lags
))
!=
0
)
{
{
memcpy
((
byte
*
)
ptr
,
(
byte
*
)
from
,(
size_t
)
length
);
memcpy
((
byte
*
)
ptr
,
(
byte
*
)
from
,(
size_t
)
length
);
((
char
*
)
ptr
)[
length
]
=
0
;
((
char
*
)
ptr
)[
length
]
=
0
;
...
...
mysys/my_realloc.c
View file @
7b994129
...
@@ -23,40 +23,41 @@
...
@@ -23,40 +23,41 @@
/* My memory re allocator */
/* My memory re allocator */
gptr
my_realloc
(
gptr
oldpoint
,
uint
Size
,
myf
MyF
lags
)
gptr
my_realloc
(
gptr
oldpoint
,
uint
size
,
myf
my_f
lags
)
{
{
gptr
point
;
gptr
point
;
DBUG_ENTER
(
"my_realloc"
);
DBUG_ENTER
(
"my_realloc"
);
DBUG_PRINT
(
"my"
,(
"ptr: %lx Size: %u MyFlags: %d"
,
oldpoint
,
Size
,
MyFlags
));
DBUG_PRINT
(
"my"
,(
"ptr: %lx size: %u my_flags: %d"
,
oldpoint
,
size
,
my_flags
));
if
(
!
oldpoint
&&
(
MyF
lags
&
MY_ALLOW_ZERO_PTR
))
if
(
!
oldpoint
&&
(
my_f
lags
&
MY_ALLOW_ZERO_PTR
))
DBUG_RETURN
(
my_malloc
(
Size
,
MyF
lags
));
DBUG_RETURN
(
my_malloc
(
size
,
my_f
lags
));
#ifdef USE_HALLOC
#ifdef USE_HALLOC
if
(
!
(
point
=
malloc
(
S
ize
)))
if
(
!
(
point
=
malloc
(
s
ize
)))
{
{
if
(
MyF
lags
&
MY_FREE_ON_ERROR
)
if
(
my_f
lags
&
MY_FREE_ON_ERROR
)
my_free
(
oldpoint
,
MyF
lags
);
my_free
(
oldpoint
,
my_f
lags
);
if
(
MyF
lags
&
MY_HOLD_ON_ERROR
)
if
(
my_f
lags
&
MY_HOLD_ON_ERROR
)
DBUG_RETURN
(
oldpoint
);
DBUG_RETURN
(
oldpoint
);
my_errno
=
errno
;
my_errno
=
errno
;
if
(
MyF
lags
&
MY_FAE
+
MY_WME
)
if
(
my_f
lags
&
MY_FAE
+
MY_WME
)
my_error
(
EE_OUTOFMEMORY
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
S
ize
);
my_error
(
EE_OUTOFMEMORY
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
s
ize
);
}
}
else
else
{
{
memcpy
(
point
,
oldpoint
,
S
ize
);
memcpy
(
point
,
oldpoint
,
s
ize
);
free
(
oldpoint
);
free
(
oldpoint
);
}
}
#else
#else
if
((
point
=
(
char
*
)
realloc
(
oldpoint
,
S
ize
))
==
NULL
)
if
((
point
=
(
char
*
)
realloc
(
oldpoint
,
s
ize
))
==
NULL
)
{
{
if
(
MyF
lags
&
MY_FREE_ON_ERROR
)
if
(
my_f
lags
&
MY_FREE_ON_ERROR
)
my_free
(
oldpoint
,
MyFLAGS
);
my_free
(
oldpoint
,
MyFLAGS
);
if
(
MyF
lags
&
MY_HOLD_ON_ERROR
)
if
(
my_f
lags
&
MY_HOLD_ON_ERROR
)
DBUG_RETURN
(
oldpoint
);
DBUG_RETURN
(
oldpoint
);
my_errno
=
errno
;
my_errno
=
errno
;
if
(
MyF
lags
&
(
MY_FAE
+
MY_WME
))
if
(
my_f
lags
&
(
MY_FAE
+
MY_WME
))
my_error
(
EE_OUTOFMEMORY
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
S
ize
);
my_error
(
EE_OUTOFMEMORY
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
s
ize
);
}
}
#endif
#endif
DBUG_PRINT
(
"exit"
,(
"ptr: %lx"
,
point
));
DBUG_PRINT
(
"exit"
,(
"ptr: %lx"
,
point
));
...
...
sql/sql_yacc.yy
View file @
7b994129
...
@@ -4380,6 +4380,7 @@ keyword:
...
@@ -4380,6 +4380,7 @@ keyword:
| BOOL_SYM {}
| BOOL_SYM {}
| BOOLEAN_SYM {}
| BOOLEAN_SYM {}
| BYTE_SYM {}
| BYTE_SYM {}
| BTREE_SYM {}
| CACHE_SYM {}
| CACHE_SYM {}
| CHANGED {}
| CHANGED {}
| CHARSET {}
| CHARSET {}
...
@@ -4425,6 +4426,7 @@ keyword:
...
@@ -4425,6 +4426,7 @@ keyword:
| GRANTS {}
| GRANTS {}
| GLOBAL_SYM {}
| GLOBAL_SYM {}
| HANDLER_SYM {}
| HANDLER_SYM {}
| HASH_SYM {}
| HEAP_SYM {}
| HEAP_SYM {}
| HELP_SYM {}
| HELP_SYM {}
| HOSTS_SYM {}
| HOSTS_SYM {}
...
@@ -4507,6 +4509,7 @@ keyword:
...
@@ -4507,6 +4509,7 @@ keyword:
| ROWS_SYM {}
| ROWS_SYM {}
| ROW_FORMAT_SYM {}
| ROW_FORMAT_SYM {}
| ROW_SYM {}
| ROW_SYM {}
| RTREE_SYM {}
| SAVEPOINT_SYM {}
| SAVEPOINT_SYM {}
| SECOND_SYM {}
| SECOND_SYM {}
| SERIAL_SYM {}
| SERIAL_SYM {}
...
...
sql/table.cc
View file @
7b994129
...
@@ -1207,17 +1207,14 @@ bool get_field(MEM_ROOT *mem, Field *field, String *res)
...
@@ -1207,17 +1207,14 @@ bool get_field(MEM_ROOT *mem, Field *field, String *res)
char
*
get_field
(
MEM_ROOT
*
mem
,
Field
*
field
)
char
*
get_field
(
MEM_ROOT
*
mem
,
Field
*
field
)
{
{
char
buff
[
MAX_FIELD_WIDTH
]
,
*
to
;
char
buff
[
MAX_FIELD_WIDTH
];
String
str
(
buff
,
sizeof
(
buff
),
&
my_charset_bin
);
String
str
(
buff
,
sizeof
(
buff
),
&
my_charset_bin
);
uint
length
;
uint
length
;
field
->
val_str
(
&
str
,
&
str
);
field
->
val_str
(
&
str
,
&
str
);
if
(
!
(
length
=
str
.
length
()))
if
(
!
(
length
=
str
.
length
()))
return
NullS
;
return
NullS
;
to
=
(
char
*
)
alloc_root
(
mem
,
length
+
1
);
return
strmake_root
(
mem
,
str
.
ptr
(),
length
);
memcpy
(
to
,
str
.
ptr
(),
(
uint
)
length
);
to
[
length
]
=
0
;
return
to
;
}
}
...
...
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