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
641ac16c
Commit
641ac16c
authored
Sep 27, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql into hundin.mysql.fi:/my/bk/mysql
parents
89f92db6
a4bc23ad
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
68 additions
and
32 deletions
+68
-32
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
Docs/manual.texi
Docs/manual.texi
+3
-0
acinclude.m4
acinclude.m4
+1
-1
mysql-test/r/join.result
mysql-test/r/join.result
+2
-0
mysql-test/r/null_key.result
mysql-test/r/null_key.result
+1
-1
mysql-test/t/join.test
mysql-test/t/join.test
+23
-0
mysys/my_open.c
mysys/my_open.c
+2
-3
scripts/mysql_fix_privilege_tables.sh
scripts/mysql_fix_privilege_tables.sh
+6
-7
sql/sql_select.cc
sql/sql_select.cc
+14
-10
sql/udf_example.cc
sql/udf_example.cc
+15
-10
No files found.
BitKeeper/etc/logging_ok
View file @
641ac16c
Miguel@light.local
Miguel@light.local
monty@hundin.mysql.fi
paul@central.snake.net
paul@central.snake.net
Docs/manual.texi
View file @
641ac16c
...
@@ -46854,6 +46854,9 @@ not yet 100% confident in this code.
...
@@ -46854,6 +46854,9 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.43
@appendixsubsec Changes in release 3.23.43
@itemize @bullet
@itemize @bullet
@item
@item
Fixed unlikely bug, which returned not matching rows, in SELECT with
many tables and multi-column indexes and 'range' type.
@item
Fixed a unlikely core-dump bug when doing @code{EXPLAIN SELECT} when using
Fixed a unlikely core-dump bug when doing @code{EXPLAIN SELECT} when using
many tables and @code{ORDER BY}.
many tables and @code{ORDER BY}.
@item
@item
acinclude.m4
View file @
641ac16c
...
@@ -1106,7 +1106,7 @@ changequote([, ])dnl
...
@@ -1106,7 +1106,7 @@ changequote([, ])dnl
AC_DEFUN(AC_SYS_LARGEFILE,
AC_DEFUN(AC_SYS_LARGEFILE,
[AC_REQUIRE([AC_CANONICAL_HOST])
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_ENABLE(largefile,
AC_ARG_ENABLE(largefile,
[ --disable-large
-files
Omit support for large files])
[ --disable-large
file
Omit support for large files])
if test "$enable_largefile" != no; then
if test "$enable_largefile" != no; then
AC_CHECK_TOOL(GETCONF, getconf)
AC_CHECK_TOOL(GETCONF, getconf)
AC_SYS_LARGEFILE_FLAGS(CFLAGS)
AC_SYS_LARGEFILE_FLAGS(CFLAGS)
...
...
mysql-test/r/join.result
View file @
641ac16c
...
@@ -20,3 +20,5 @@ id catid stateid countyid
...
@@ -20,3 +20,5 @@ id catid stateid countyid
a
a
1
1
2
2
a a b
2 2 3
mysql-test/r/null_key.result
View file @
641ac16c
...
@@ -11,7 +11,7 @@ t1 index NULL a 9 NULL 12 where used; Using index
...
@@ -11,7 +11,7 @@ t1 index NULL a 9 NULL 12 where used; Using index
table type possible_keys key key_len ref rows Extra
table type possible_keys key key_len ref rows Extra
t1 range a,b a 9 NULL 3 where used; Using index
t1 range a,b a 9 NULL 3 where used; Using index
table type possible_keys key key_len ref rows Extra
table type possible_keys key key_len ref rows Extra
t1 r
ef a,b b 4 const 2 where used
t1 r
ange a,b a 9 NULL 2 where used; Using index
table type possible_keys key key_len ref rows Extra
table type possible_keys key key_len ref rows Extra
t1 ref a,b a 5 const 3 where used; Using index
t1 ref a,b a 5 const 3 where used; Using index
table type possible_keys key key_len ref rows Extra
table type possible_keys key key_len ref rows Extra
...
...
mysql-test/t/join.test
View file @
641ac16c
...
@@ -89,3 +89,26 @@ select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using
...
@@ -89,3 +89,26 @@ select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using
--
error
1116
--
error
1116
select
t1
.
a
from
t1
as
t1
left
join
t1
as
t2
using
(
a
)
left
join
t1
as
t3
using
(
a
)
left
join
t1
as
t4
using
(
a
)
left
join
t1
as
t5
using
(
a
)
left
join
t1
as
t6
using
(
a
)
left
join
t1
as
t7
using
(
a
)
left
join
t1
as
t8
using
(
a
)
left
join
t1
as
t9
using
(
a
)
left
join
t1
as
t10
using
(
a
)
left
join
t1
as
t11
using
(
a
)
left
join
t1
as
t12
using
(
a
)
left
join
t1
as
t13
using
(
a
)
left
join
t1
as
t14
using
(
a
)
left
join
t1
as
t15
using
(
a
)
left
join
t1
as
t16
using
(
a
)
left
join
t1
as
t17
using
(
a
)
left
join
t1
as
t18
using
(
a
)
left
join
t1
as
t19
using
(
a
)
left
join
t1
as
t20
using
(
a
)
left
join
t1
as
t21
using
(
a
)
left
join
t1
as
t22
using
(
a
)
left
join
t1
as
t23
using
(
a
)
left
join
t1
as
t24
using
(
a
)
left
join
t1
as
t25
using
(
a
)
left
join
t1
as
t26
using
(
a
)
left
join
t1
as
t27
using
(
a
)
left
join
t1
as
t28
using
(
a
)
left
join
t1
as
t29
using
(
a
)
left
join
t1
as
t30
using
(
a
)
left
join
t1
as
t31
using
(
a
)
left
join
t1
as
t32
using
(
a
)
left
join
t1
as
t33
using
(
a
)
left
join
t1
as
t34
using
(
a
)
left
join
t1
as
t35
using
(
a
)
left
join
t1
as
t36
using
(
a
)
left
join
t1
as
t37
using
(
a
)
left
join
t1
as
t38
using
(
a
)
left
join
t1
as
t39
using
(
a
)
left
join
t1
as
t40
using
(
a
)
left
join
t1
as
t41
using
(
a
)
left
join
t1
as
t42
using
(
a
)
left
join
t1
as
t43
using
(
a
)
left
join
t1
as
t44
using
(
a
)
left
join
t1
as
t45
using
(
a
)
left
join
t1
as
t46
using
(
a
)
left
join
t1
as
t47
using
(
a
)
left
join
t1
as
t48
using
(
a
)
left
join
t1
as
t49
using
(
a
)
left
join
t1
as
t50
using
(
a
)
left
join
t1
as
t51
using
(
a
)
left
join
t1
as
t52
using
(
a
)
left
join
t1
as
t53
using
(
a
)
left
join
t1
as
t54
using
(
a
)
left
join
t1
as
t55
using
(
a
)
left
join
t1
as
t56
using
(
a
)
left
join
t1
as
t57
using
(
a
)
left
join
t1
as
t58
using
(
a
)
left
join
t1
as
t59
using
(
a
)
left
join
t1
as
t60
using
(
a
)
left
join
t1
as
t61
using
(
a
)
left
join
t1
as
t62
using
(
a
)
left
join
t1
as
t63
using
(
a
)
left
join
t1
as
t64
using
(
a
)
left
join
t1
as
t65
using
(
a
);
select
t1
.
a
from
t1
as
t1
left
join
t1
as
t2
using
(
a
)
left
join
t1
as
t3
using
(
a
)
left
join
t1
as
t4
using
(
a
)
left
join
t1
as
t5
using
(
a
)
left
join
t1
as
t6
using
(
a
)
left
join
t1
as
t7
using
(
a
)
left
join
t1
as
t8
using
(
a
)
left
join
t1
as
t9
using
(
a
)
left
join
t1
as
t10
using
(
a
)
left
join
t1
as
t11
using
(
a
)
left
join
t1
as
t12
using
(
a
)
left
join
t1
as
t13
using
(
a
)
left
join
t1
as
t14
using
(
a
)
left
join
t1
as
t15
using
(
a
)
left
join
t1
as
t16
using
(
a
)
left
join
t1
as
t17
using
(
a
)
left
join
t1
as
t18
using
(
a
)
left
join
t1
as
t19
using
(
a
)
left
join
t1
as
t20
using
(
a
)
left
join
t1
as
t21
using
(
a
)
left
join
t1
as
t22
using
(
a
)
left
join
t1
as
t23
using
(
a
)
left
join
t1
as
t24
using
(
a
)
left
join
t1
as
t25
using
(
a
)
left
join
t1
as
t26
using
(
a
)
left
join
t1
as
t27
using
(
a
)
left
join
t1
as
t28
using
(
a
)
left
join
t1
as
t29
using
(
a
)
left
join
t1
as
t30
using
(
a
)
left
join
t1
as
t31
using
(
a
)
left
join
t1
as
t32
using
(
a
)
left
join
t1
as
t33
using
(
a
)
left
join
t1
as
t34
using
(
a
)
left
join
t1
as
t35
using
(
a
)
left
join
t1
as
t36
using
(
a
)
left
join
t1
as
t37
using
(
a
)
left
join
t1
as
t38
using
(
a
)
left
join
t1
as
t39
using
(
a
)
left
join
t1
as
t40
using
(
a
)
left
join
t1
as
t41
using
(
a
)
left
join
t1
as
t42
using
(
a
)
left
join
t1
as
t43
using
(
a
)
left
join
t1
as
t44
using
(
a
)
left
join
t1
as
t45
using
(
a
)
left
join
t1
as
t46
using
(
a
)
left
join
t1
as
t47
using
(
a
)
left
join
t1
as
t48
using
(
a
)
left
join
t1
as
t49
using
(
a
)
left
join
t1
as
t50
using
(
a
)
left
join
t1
as
t51
using
(
a
)
left
join
t1
as
t52
using
(
a
)
left
join
t1
as
t53
using
(
a
)
left
join
t1
as
t54
using
(
a
)
left
join
t1
as
t55
using
(
a
)
left
join
t1
as
t56
using
(
a
)
left
join
t1
as
t57
using
(
a
)
left
join
t1
as
t58
using
(
a
)
left
join
t1
as
t59
using
(
a
)
left
join
t1
as
t60
using
(
a
)
left
join
t1
as
t61
using
(
a
)
left
join
t1
as
t62
using
(
a
)
left
join
t1
as
t63
using
(
a
)
left
join
t1
as
t64
using
(
a
)
left
join
t1
as
t65
using
(
a
);
drop
table
t1
;
drop
table
t1
;
#
# Simple join test. This failed in 3.23.42, there should have been
# no matches, still three matches were found.
#
CREATE
TABLE
t1
(
a
int
(
11
)
NOT
NULL
,
b
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
a
,
b
)
)
TYPE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
1
,
1
),(
1
,
2
),(
1
,
3
),(
1
,
4
),(
1
,
5
),(
1
,
6
),(
1
,
7
),(
2
,
3
);
CREATE
TABLE
t2
(
a
int
(
11
)
default
NULL
)
TYPE
=
MyISAM
;
INSERT
INTO
t2
VALUES
(
2
),(
3
);
SELECT
t1
.
a
,
t2
.
a
,
b
FROM
t1
,
t2
WHERE
t1
.
a
=
t2
.
a
AND
(
t1
.
a
=
1
OR
t1
.
a
=
2
)
AND
b
>=
1
AND
b
<=
3
;
DROP
TABLE
t1
,
t2
;
mysys/my_open.c
View file @
641ac16c
...
@@ -75,8 +75,8 @@ int my_close(File fd, myf MyFlags)
...
@@ -75,8 +75,8 @@ int my_close(File fd, myf MyFlags)
pthread_mutex_destroy
(
&
my_file_info
[
fd
].
mutex
);
pthread_mutex_destroy
(
&
my_file_info
[
fd
].
mutex
);
#endif
#endif
my_file_info
[
fd
].
type
=
UNOPEN
;
my_file_info
[
fd
].
type
=
UNOPEN
;
my_file_opened
--
;
}
}
my_file_opened
--
;
pthread_mutex_unlock
(
&
THR_LOCK_open
);
pthread_mutex_unlock
(
&
THR_LOCK_open
);
DBUG_RETURN
(
err
);
DBUG_RETURN
(
err
);
}
/* my_close */
}
/* my_close */
...
@@ -96,9 +96,8 @@ File my_register_filename(File fd, const char *FileName, enum file_type
...
@@ -96,9 +96,8 @@ File my_register_filename(File fd, const char *FileName, enum file_type
my_error
(
EE_OUT_OF_FILERESOURCES
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
my_error
(
EE_OUT_OF_FILERESOURCES
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
FileName
,
my_errno
);
FileName
,
my_errno
);
return
(
-
1
);
return
(
-
1
);
#else
thread_safe_increment
(
my_file_opened
,
&
THR_LOCK_open
);
#endif
#endif
thread_safe_increment
(
my_file_opened
,
&
THR_LOCK_open
);
return
(
fd
);
/* safeguard */
return
(
fd
);
/* safeguard */
}
}
pthread_mutex_lock
(
&
THR_LOCK_open
);
pthread_mutex_lock
(
&
THR_LOCK_open
);
...
...
scripts/mysql_fix_privilege_tables.sh
View file @
641ac16c
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
echo
"This scripts updates the mysql.user, mysql.db, mysql.host and the"
echo
"This scripts updates the mysql.user, mysql.db, mysql.host and the"
echo
"mysql.func table to MySQL 3.22.14 and above."
echo
"mysql.func table to MySQL 3.22.14 and above."
echo
""
echo
""
echo
"This is needed if you want to use the new GRANT functions
or
"
echo
"This is needed if you want to use the new GRANT functions
,
"
echo
"
want to use the more secure passwords.
"
echo
"
CREATE AGGREAGATE FUNCTION or want to use the more secure passwords in 3.23
"
echo
""
echo
""
echo
"If you get Access denied errors, you should run this script again"
echo
"If you get Access denied errors, you should run this script again"
echo
"and give the MySQL root user password as a argument!"
echo
"and give the MySQL root user password as a argument!"
...
@@ -15,13 +15,12 @@ host="localhost"
...
@@ -15,13 +15,12 @@ host="localhost"
# Fix old password format, add File_priv and func table
# Fix old password format, add File_priv and func table
echo
""
echo
""
echo
"If your tables are already up to date or partially up to date you will"
echo
"If your tables are already up to date or partially up to date you will"
echo
"get some warnings about 'Duplicated column name' or"
echo
"get some warnings about 'Duplicated column name'. You can safely ignore these!"
echo
"'Table 'func' already exists'. You can safely ignore these!"
@bindir@/mysql
-f
--user
=
root
--password
=
"
$root_password
"
--host
=
"
$host
"
mysql
<<
END_OF_DATA
@bindir@/mysql
-f
--user
=
root
--password
=
"
$root_password
"
--host
=
"
$host
"
mysql
<<
END_OF_DATA
alter table user change password password char(16) NOT NULL;
alter table user change password password char(16) NOT NULL;
alter table user add File_priv enum('N','Y') NOT NULL;
alter table user add File_priv enum('N','Y') NOT NULL;
CREATE TABLE func (
CREATE TABLE
if not exists
func (
name char(64) DEFAULT '' NOT NULL,
name char(64) DEFAULT '' NOT NULL,
ret tinyint(1) DEFAULT '0' NOT NULL,
ret tinyint(1) DEFAULT '0' NOT NULL,
dl char(128) DEFAULT '' NOT NULL,
dl char(128) DEFAULT '' NOT NULL,
...
@@ -64,7 +63,7 @@ fi
...
@@ -64,7 +63,7 @@ fi
echo
"Creating the new table and column privilege tables"
echo
"Creating the new table and column privilege tables"
@bindir@/mysql
-f
--user
=
root
--password
=
"
$root_password
"
--host
=
"
$host
"
mysql
<<
END_OF_DATA
@bindir@/mysql
-f
--user
=
root
--password
=
"
$root_password
"
--host
=
"
$host
"
mysql
<<
END_OF_DATA
CREATE TABLE tables_priv (
CREATE TABLE
IF NOT EXISTS
tables_priv (
Host char(60) DEFAULT '' NOT NULL,
Host char(60) DEFAULT '' NOT NULL,
Db char(60) DEFAULT '' NOT NULL,
Db char(60) DEFAULT '' NOT NULL,
User char(16) DEFAULT '' NOT NULL,
User char(16) DEFAULT '' NOT NULL,
...
@@ -75,7 +74,7 @@ CREATE TABLE tables_priv (
...
@@ -75,7 +74,7 @@ CREATE TABLE tables_priv (
Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,
Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,
PRIMARY KEY (Host,Db,User,Table_name)
PRIMARY KEY (Host,Db,User,Table_name)
);
);
CREATE TABLE columns_priv (
CREATE TABLE
IF NOT EXISTS
columns_priv (
Host char(60) DEFAULT '' NOT NULL,
Host char(60) DEFAULT '' NOT NULL,
Db char(60) DEFAULT '' NOT NULL,
Db char(60) DEFAULT '' NOT NULL,
User char(16) DEFAULT '' NOT NULL,
User char(16) DEFAULT '' NOT NULL,
...
...
sql/sql_select.cc
View file @
641ac16c
...
@@ -2258,7 +2258,20 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
...
@@ -2258,7 +2258,20 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
{
{
JOIN_TAB
*
tab
=
join
->
join_tab
+
i
;
JOIN_TAB
*
tab
=
join
->
join_tab
+
i
;
table_map
current_map
=
tab
->
table
->
map
;
table_map
current_map
=
tab
->
table
->
map
;
bool
use_quick_range
=
0
;
used_tables
|=
current_map
;
used_tables
|=
current_map
;
if
(
tab
->
type
==
JT_REF
&&
tab
->
quick
&&
tab
->
ref
.
key_length
<
tab
->
quick
->
max_used_key_length
)
{
/* Range uses longer key; Use this instead of ref on key */
tab
->
type
=
JT_ALL
;
use_quick_range
=
1
;
tab
->
use_quick
=
1
;
tab
->
ref
.
key_parts
=
0
;
// Don't use ref key.
join
->
best_positions
[
i
].
records_read
=
tab
->
quick
->
records
;
}
COND
*
tmp
=
make_cond_for_table
(
cond
,
used_tables
,
current_map
);
COND
*
tmp
=
make_cond_for_table
(
cond
,
used_tables
,
current_map
);
if
(
!
tmp
&&
tab
->
quick
)
if
(
!
tmp
&&
tab
->
quick
)
{
// Outer join
{
// Outer join
...
@@ -2301,7 +2314,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
...
@@ -2301,7 +2314,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
if
(
tab
->
const_keys
&&
tab
->
table
->
reginfo
.
impossible_range
)
if
(
tab
->
const_keys
&&
tab
->
table
->
reginfo
.
impossible_range
)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
else
if
(
tab
->
type
==
JT_ALL
)
else
if
(
tab
->
type
==
JT_ALL
&&
!
use_quick_range
)
{
{
if
(
tab
->
const_keys
&&
if
(
tab
->
const_keys
&&
tab
->
table
->
reginfo
.
impossible_range
)
tab
->
table
->
reginfo
.
impossible_range
)
...
@@ -2356,15 +2369,6 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
...
@@ -2356,15 +2369,6 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
}
}
}
}
}
}
if
(
tab
->
type
==
JT_REF
&&
sel
->
quick
&&
tab
->
ref
.
key_length
<
sel
->
quick
->
max_used_key_length
)
{
/* Range uses longer key; Use this instead of ref on key */
tab
->
type
=
JT_ALL
;
tab
->
use_quick
=
1
;
tab
->
ref
.
key_parts
=
0
;
// Don't use ref key.
join
->
best_positions
[
i
].
records_read
=
sel
->
quick
->
records
;
}
}
}
}
}
}
}
...
...
sql/udf_example.cc
View file @
641ac16c
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
** You can easily get all switches right by doing:
** You can easily get all switches right by doing:
** cd sql ; make udf_example.o
** cd sql ; make udf_example.o
** Take the compile line that make writes, remove the '-c' near the end of
** Take the compile line that make writes, remove the '-c' near the end of
** the line and add -o udf_example.so to the end of the compile line.
** the line and add -
shared -
o udf_example.so to the end of the compile line.
** The resulting library (udf_example.so) should be copied to some dir
** The resulting library (udf_example.so) should be copied to some dir
** searched by ld. (/usr/lib ?)
** searched by ld. (/usr/lib ?)
**
**
...
@@ -97,6 +97,13 @@
...
@@ -97,6 +97,13 @@
** Active function will be reloaded on every restart of server
** Active function will be reloaded on every restart of server
** (if --skip-grant-tables is not given)
** (if --skip-grant-tables is not given)
**
**
** If you ge problems with undefined symbols when loading the shared
** library, you should verify that mysqld is compiled with the -rdynamic
** option.
**
** If you can't get AGGREGATES to work, check that you have the column
** 'type' in the mysql.func table. If not, run 'mysql_fix_privilege_tables'.
**
*/
*/
#ifdef STANDARD
#ifdef STANDARD
...
@@ -128,6 +135,11 @@ my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
...
@@ -128,6 +135,11 @@ 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
,
long
long
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
);
void
avgcost_deinit
(
UDF_INIT
*
initid
);
void
avgcost_reset
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
char
*
error
);
void
avgcost_add
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
char
*
error
);
double
avgcost
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
char
*
error
);
}
}
...
@@ -766,6 +778,7 @@ char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result,
...
@@ -766,6 +778,7 @@ char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result,
*
res_length
=
(
ulong
)
(
strmov
(
result
,
hp
->
h_name
)
-
result
);
*
res_length
=
(
ulong
)
(
strmov
(
result
,
hp
->
h_name
)
-
result
);
return
result
;
return
result
;
}
}
#endif // defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST)
/*
/*
** Syntax for the new aggregate commands are:
** Syntax for the new aggregate commands are:
...
@@ -777,13 +790,6 @@ char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result,
...
@@ -777,13 +790,6 @@ char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result,
** (this example is provided by Andreas F. Bobak <bobak@relog.ch>)
** (this example is provided by Andreas F. Bobak <bobak@relog.ch>)
*/
*/
extern
"C"
{
my_bool
avgcost_init
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
message
);
void
avgcost_deinit
(
UDF_INIT
*
initid
);
void
avgcost_reset
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
char
*
error
);
void
avgcost_add
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
char
*
error
);
double
avgcost
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
char
*
is_null
,
char
*
error
);
}
struct
avgcost_data
struct
avgcost_data
{
{
...
@@ -810,7 +816,7 @@ avgcost_init( UDF_INIT* initid, UDF_ARGS* args, char* message )
...
@@ -810,7 +816,7 @@ avgcost_init( UDF_INIT* initid, UDF_ARGS* args, char* message )
return
1
;
return
1
;
}
}
if
((
args
->
arg_type
[
0
]
!=
INT_RESULT
)
&&
(
args
->
arg_type
[
1
]
!=
REAL_RESULT
)
)
if
((
args
->
arg_type
[
0
]
!=
INT_RESULT
)
||
(
args
->
arg_type
[
1
]
!=
REAL_RESULT
)
)
{
{
strcpy
(
strcpy
(
message
,
message
,
...
@@ -917,5 +923,4 @@ avgcost( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error )
...
@@ -917,5 +923,4 @@ avgcost( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error )
return
data
->
totalprice
/
double
(
data
->
totalquantity
);
return
data
->
totalprice
/
double
(
data
->
totalquantity
);
}
}
#endif // defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST)
#endif
/* HAVE_DLOPEN */
#endif
/* HAVE_DLOPEN */
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