summaryrefslogtreecommitdiff
path: root/sql/udf_example.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/udf_example.cc')
-rw-r--r--sql/udf_example.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/udf_example.cc b/sql/udf_example.cc
index f0f33ed6fd7..a186b4fbf6c 100644
--- a/sql/udf_example.cc
+++ b/sql/udf_example.cc
@@ -619,10 +619,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;
}
@@ -639,9 +641,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.