1
/* Copyright (C) 2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
/***************************************************************
17
* I N C L U D E D F I L E S *
18
***************************************************************/
20
#include <ndb_global.h>
23
#include "ndb_schema.hpp"
24
#include "ndb_error.hpp"
25
#include "userInterface.h"
27
#include <NdbThread.h>
32
/***************************************************************
33
* L O C A L C O N S T A N T S *
34
***************************************************************/
36
/***************************************************************
37
* L O C A L D A T A S T R U C T U R E S *
38
***************************************************************/
40
/***************************************************************
41
* L O C A L F U N C T I O N S *
42
***************************************************************/
49
static NdbMutex* startupMutex = NdbMutex_Create();
52
asyncDbConnect(int parallellism){
53
NdbMutex_Lock(startupMutex);
54
Ndb * pNDB = new Ndb("");
56
pNDB->init(parallellism + 1);
58
while(pNDB->waitUntilReady() != 0){
61
NdbMutex_Unlock(startupMutex);
67
asyncDbDisconnect(Ndb* pNDB)
75
static bool initialized = false;
76
static NDB_TICKS initSecs = 0;
77
static Uint32 initMicros = 0;
82
NdbTick_CurrentMicrosecond(&initSecs, &initMicros);
88
NdbTick_CurrentMicrosecond(&secs, µs);
89
double s = (double)secs - (double)initSecs;
90
double us = (double)micros - (double)initMicros;
92
timeValue = s + (us / 1000000.0);
102
now = ::time((time_t*)NULL);
103
tm_now = ::gmtime(&now);
105
BaseString::snprintf(buf, 128,
106
"%d-%.2d-%.2d %.2d:%.2d:%.2d",
107
tm_now->tm_year + 1900,
114
ndbout_c("Time: %s", buf);