System.Data.SQLite
Check-in [ab8b2729bb]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed a bug in aggregate functions with empty resultsets
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: ab8b2729bbed71259267de9f60678284c91a2382
User & Date: rmsimpson 2006-01-27 06:13:39
Context
2006-01-27
22:21
Better generic entrypoint handling check-in: 08f855ffb1 user: rmsimpson tags: sourceforge
06:13
Fixed a bug in aggregate functions with empty resultsets check-in: ab8b2729bb user: rmsimpson tags: sourceforge
05:55
Transaction enlistment and nested transaction test added check-in: a15dd26217 user: rmsimpson tags: sourceforge
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteFunction.cs.

334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353




354

355

356
357
358
359
360
361
362
363
364
      int n = _base.AggregateCount(context);
      int nAux;
      object obj = null;

      nAux = _base.AggregateContext(context);
      if (n > 1) obj = _contextDataList[nAux];

      Step(ConvertParams(nArgs, argsptr), _base.AggregateCount(context), ref obj);
      _contextDataList[nAux] = obj;      
    }

    /// <summary>
    /// An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method.
    /// </summary>
    /// <param name="context">A raw context pointer</param>
    /// <param name="nArgs">Not used, always zero</param>
    /// <param name="argsptr">Not used, always zero</param>
    internal void FinalCallback(int context, int nArgs, IntPtr argsptr)
    {
      int n = _base.AggregateContext(context);




      object obj = _contextDataList[n];



      SetReturnValue(context, Final(obj));
      _contextDataList.Remove(n);

      IDisposable disp = obj as IDisposable;
      if (disp != null) disp.Dispose();
    }

    /// <summary>
    /// Placeholder for a user-defined disposal routine







|












>
>
>
>
|
>
|
>

<







334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362

363
364
365
366
367
368
369
      int n = _base.AggregateCount(context);
      int nAux;
      object obj = null;

      nAux = _base.AggregateContext(context);
      if (n > 1) obj = _contextDataList[nAux];

      Step(ConvertParams(nArgs, argsptr), n, ref obj);
      _contextDataList[nAux] = obj;      
    }

    /// <summary>
    /// An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method.
    /// </summary>
    /// <param name="context">A raw context pointer</param>
    /// <param name="nArgs">Not used, always zero</param>
    /// <param name="argsptr">Not used, always zero</param>
    internal void FinalCallback(int context, int nArgs, IntPtr argsptr)
    {
      int n = _base.AggregateContext(context);
      object obj = null;

      if (_contextDataList.ContainsKey(n))
      {
        obj = _contextDataList[n];
        _contextDataList.Remove(n);
      }

      SetReturnValue(context, Final(obj));


      IDisposable disp = obj as IDisposable;
      if (disp != null) disp.Dispose();
    }

    /// <summary>
    /// Placeholder for a user-defined disposal routine