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
dfd0f82b
Commit
dfd0f82b
authored
Sep 18, 2002
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update mysql-test results after merge
parent
70b1d538
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
27 deletions
+44
-27
include/my_sys.h
include/my_sys.h
+3
-3
include/sslopt-longopts.h
include/sslopt-longopts.h
+2
-2
mysql-test/r/binary.result
mysql-test/r/binary.result
+10
-0
mysys/my_malloc.c
mysys/my_malloc.c
+4
-4
sql/udf_example.cc
sql/udf_example.cc
+25
-18
No files found.
include/my_sys.h
View file @
dfd0f82b
...
@@ -153,9 +153,9 @@ extern gptr my_malloc(uint Size,myf MyFlags);
...
@@ -153,9 +153,9 @@ extern gptr my_malloc(uint Size,myf MyFlags);
extern
gptr
my_realloc
(
gptr
oldpoint
,
uint
Size
,
myf
MyFlags
);
extern
gptr
my_realloc
(
gptr
oldpoint
,
uint
Size
,
myf
MyFlags
);
extern
void
my_no_flags_free
(
gptr
ptr
);
extern
void
my_no_flags_free
(
gptr
ptr
);
extern
gptr
my_memdup
(
const
byte
*
from
,
uint
length
,
myf
MyFlags
);
extern
gptr
my_memdup
(
const
byte
*
from
,
uint
length
,
myf
MyFlags
);
extern
my_string
my_strdup
(
const
char
*
from
,
myf
MyFlags
);
extern
char
*
my_strdup
(
const
char
*
from
,
myf
MyFlags
);
extern
my_string
my_strdup_with_length
(
const
char
*
from
,
uint
length
,
extern
char
*
my_strdup_with_length
(
const
byte
*
from
,
uint
length
,
myf
MyFlags
);
myf
MyFlags
);
#define my_free(PTR,FG) my_no_flags_free(PTR)
#define my_free(PTR,FG) my_no_flags_free(PTR)
#define CALLER_INFO_PROTO
/* nothing */
#define CALLER_INFO_PROTO
/* nothing */
#define CALLER_INFO
/* nothing */
#define CALLER_INFO
/* nothing */
...
...
include/sslopt-longopts.h
View file @
dfd0f82b
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
#ifdef HAVE_OPENSSL
#ifdef HAVE_OPENSSL
{
"ssl"
,
OPT_SSL_SSL
,
{
"ssl"
,
OPT_SSL_SSL
,
"
Use SSL for connection (automatically set with other flags)
"
,
"
Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl
"
,
(
gptr
*
)
&
opt_use_ssl
,
(
gptr
*
)
&
opt_use_ssl
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
(
gptr
*
)
&
opt_use_ssl
,
(
gptr
*
)
&
opt_use_ssl
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
},
{
"ssl-key"
,
OPT_SSL_KEY
,
"X509 key in PEM format (implies --ssl)"
,
{
"ssl-key"
,
OPT_SSL_KEY
,
"X509 key in PEM format (implies --ssl)"
,
(
gptr
*
)
&
opt_ssl_key
,
(
gptr
*
)
&
opt_ssl_key
,
0
,
GET_STR
,
REQUIRED_ARG
,
(
gptr
*
)
&
opt_ssl_key
,
(
gptr
*
)
&
opt_ssl_key
,
0
,
GET_STR
,
REQUIRED_ARG
,
...
...
mysql-test/r/binary.result
View file @
dfd0f82b
...
@@ -54,3 +54,13 @@ select * from t1 where b="hello";
...
@@ -54,3 +54,13 @@ select * from t1 where b="hello";
a b
a b
hello hello
hello hello
drop table t1;
drop table t1;
create table t1 (b char(8));
insert into t1 values(NULL);
select b from t1 where binary b like '';
b
select b from t1 group by binary b like '';
b
NULL
select b from t1 having binary b like '';
b
drop table t1;
mysys/my_malloc.c
View file @
dfd0f82b
...
@@ -73,7 +73,7 @@ gptr my_memdup(const byte *from, uint length, myf MyFlags)
...
@@ -73,7 +73,7 @@ gptr my_memdup(const byte *from, uint length, myf MyFlags)
}
}
my_string
my_strdup
(
const
char
*
from
,
myf
MyFlags
)
char
*
my_strdup
(
const
char
*
from
,
myf
MyFlags
)
{
{
gptr
ptr
;
gptr
ptr
;
uint
length
=
(
uint
)
strlen
(
from
)
+
1
;
uint
length
=
(
uint
)
strlen
(
from
)
+
1
;
...
@@ -83,13 +83,13 @@ my_string my_strdup(const char *from, myf MyFlags)
...
@@ -83,13 +83,13 @@ my_string my_strdup(const char *from, myf MyFlags)
}
}
gptr
my_strdup_with_length
(
const
byte
*
from
,
uint
length
,
myf
MyFlags
)
char
*
my_strdup_with_length
(
const
byte
*
from
,
uint
length
,
myf
MyFlags
)
{
{
gptr
ptr
;
gptr
ptr
;
if
((
ptr
=
my_malloc
(
length
+
1
,
MyFlags
))
!=
0
)
if
((
ptr
=
my_malloc
(
length
+
1
,
MyFlags
))
!=
0
)
{
{
memcpy
((
byte
*
)
ptr
,
(
byte
*
)
from
,(
size_t
)
length
);
memcpy
((
byte
*
)
ptr
,
(
byte
*
)
from
,(
size_t
)
length
);
ptr
[
length
]
=
0
;
((
char
*
)
ptr
)
[
length
]
=
0
;
}
}
return
(
ptr
);
return
(
(
char
*
)
ptr
);
}
}
sql/udf_example.cc
View file @
dfd0f82b
/* Copyright (C) 200
0 MySQL AB & MySQL Finland AB & TCX DataKonsult
AB
/* Copyright (C) 200
2 MySQL
AB
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
@@ -111,6 +111,13 @@
...
@@ -111,6 +111,13 @@
#ifdef STANDARD
#ifdef STANDARD
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#ifdef __WIN__
typedef
unsigned
__int64
ulonglong
;
/* Microsofts 64 bit types */
typedef
__int64
longlong
;
#else
typedef
unsigned
long
long
ulonglong
;
typedef
long
long
longlong
;
#endif
/*__WIN__*/
#else
#else
#include <my_global.h>
#include <my_global.h>
#include <my_sys.h>
#include <my_sys.h>
...
@@ -135,7 +142,7 @@ longlong myfunc_int(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
...
@@ -135,7 +142,7 @@ longlong myfunc_int(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
char
*
error
);
char
*
error
);
my_bool
sequence_init
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
message
);
my_bool
sequence_init
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
message
);
void
sequence_deinit
(
UDF_INIT
*
initid
);
void
sequence_deinit
(
UDF_INIT
*
initid
);
long
long
sequence
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
longlong
sequence
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
char
*
error
);
char
*
error
);
my_bool
avgcost_init
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
message
);
my_bool
avgcost_init
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
message
);
void
avgcost_deinit
(
UDF_INIT
*
initid
);
void
avgcost_deinit
(
UDF_INIT
*
initid
);
...
@@ -558,10 +565,10 @@ double myfunc_double(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
...
@@ -558,10 +565,10 @@ double myfunc_double(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
/* This function returns the sum of all arguments */
/* This function returns the sum of all arguments */
long
long
myfunc_int
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
longlong
myfunc_int
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
char
*
error
)
char
*
error
)
{
{
long
long
val
=
0
;
longlong
val
=
0
;
for
(
uint
i
=
0
;
i
<
args
->
arg_count
;
i
++
)
for
(
uint
i
=
0
;
i
<
args
->
arg_count
;
i
++
)
{
{
if
(
args
->
args
[
i
]
==
NULL
)
if
(
args
->
args
[
i
]
==
NULL
)
...
@@ -571,10 +578,10 @@ long long myfunc_int(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
...
@@ -571,10 +578,10 @@ long long myfunc_int(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
val
+=
args
->
lengths
[
i
];
val
+=
args
->
lengths
[
i
];
break
;
break
;
case
INT_RESULT
:
// Add numbers
case
INT_RESULT
:
// Add numbers
val
+=
*
((
long
long
*
)
args
->
args
[
i
]);
val
+=
*
((
longlong
*
)
args
->
args
[
i
]);
break
;
break
;
case
REAL_RESULT
:
// Add numers as long
long
case
REAL_RESULT
:
// Add numers as longlong
val
+=
(
long
long
)
*
((
double
*
)
args
->
args
[
i
]);
val
+=
(
longlong
)
*
((
double
*
)
args
->
args
[
i
]);
break
;
break
;
}
}
}
}
...
@@ -617,12 +624,12 @@ void sequence_deinit(UDF_INIT *initid)
...
@@ -617,12 +624,12 @@ void sequence_deinit(UDF_INIT *initid)
free
(
initid
->
ptr
);
free
(
initid
->
ptr
);
}
}
long
long
sequence
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
longlong
sequence
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
char
*
error
)
char
*
error
)
{
{
ulonglong
val
=
0
;
ulonglong
val
=
0
;
if
(
args
->
arg_count
)
if
(
args
->
arg_count
)
val
=
*
((
long
long
*
)
args
->
args
[
0
]);
val
=
*
((
longlong
*
)
args
->
args
[
0
]);
return
++
*
((
longlong
*
)
initid
->
ptr
)
+
val
;
return
++
*
((
longlong
*
)
initid
->
ptr
)
+
val
;
}
}
...
@@ -743,10 +750,10 @@ char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result,
...
@@ -743,10 +750,10 @@ char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result,
return
0
;
return
0
;
}
}
sprintf
(
result
,
"%d.%d.%d.%d"
,
sprintf
(
result
,
"%d.%d.%d.%d"
,
(
int
)
*
((
long
long
*
)
args
->
args
[
0
]),
(
int
)
*
((
longlong
*
)
args
->
args
[
0
]),
(
int
)
*
((
long
long
*
)
args
->
args
[
1
]),
(
int
)
*
((
longlong
*
)
args
->
args
[
1
]),
(
int
)
*
((
long
long
*
)
args
->
args
[
2
]),
(
int
)
*
((
longlong
*
)
args
->
args
[
2
]),
(
int
)
*
((
long
long
*
)
args
->
args
[
3
]));
(
int
)
*
((
longlong
*
)
args
->
args
[
3
]));
}
}
else
else
{
// string argument
{
// string argument
...
@@ -795,9 +802,9 @@ char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result,
...
@@ -795,9 +802,9 @@ char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result,
struct
avgcost_data
struct
avgcost_data
{
{
u
nsigned
long
long
count
;
u
longlong
count
;
long
long
totalquantity
;
longlong
totalquantity
;
double
totalprice
;
double
totalprice
;
};
};
...
@@ -871,8 +878,8 @@ avgcost_add( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message )
...
@@ -871,8 +878,8 @@ avgcost_add( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message )
if
(
args
->
args
[
0
]
&&
args
->
args
[
1
])
if
(
args
->
args
[
0
]
&&
args
->
args
[
1
])
{
{
struct
avgcost_data
*
data
=
(
struct
avgcost_data
*
)
initid
->
ptr
;
struct
avgcost_data
*
data
=
(
struct
avgcost_data
*
)
initid
->
ptr
;
long
long
quantity
=
*
((
long
long
*
)
args
->
args
[
0
]);
long
long
quantity
=
*
((
long
long
*
)
args
->
args
[
0
]);
long
long
newquantity
=
data
->
totalquantity
+
quantity
;
longlong
newquantity
=
data
->
totalquantity
+
quantity
;
double
price
=
*
((
double
*
)
args
->
args
[
1
]);
double
price
=
*
((
double
*
)
args
->
args
[
1
]);
data
->
count
++
;
data
->
count
++
;
...
...
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