1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Ensure that we free memory used with --order-by-primary (in mysqldump)

Simple, non critical, fix to mysql_fix_privilege_tables
This commit is contained in:
monty@mysql.com
2004-12-09 12:47:20 +02:00
parent 4753641048
commit 01e4740f4c
6 changed files with 44 additions and 31 deletions

View File

@ -615,10 +615,12 @@ my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return 1;
}
bzero(initid->ptr,sizeof(longlong));
// Fool MySQL to think that this function is a constant
// This will ensure that MySQL only evalutes the function
// when the rows are sent to the client and not before any ORDER BY
// clauses
/*
Fool MySQL to think that this function is a constant
This will ensure that MySQL only evalutes the function
when the rows are sent to the client and not before any ORDER BY
clauses
*/
initid->const_item=1;
return 0;
}
@ -635,9 +637,10 @@ longlong sequence(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
ulonglong val=0;
if (args->arg_count)
val= *((longlong*) args->args[0]);
return ++ *((longlong*) initid->ptr) + val;
return ++*((longlong*) initid->ptr) + val;
}
/****************************************************************************
** Some functions that handles IP and hostname conversions
** The orignal function was from Zeev Suraski.