~jan-kneschke/mysql-proxy/packet-tracking-assertions

« back to all changes in this revision

Viewing changes to lib/glib2.c

  • Committer: jan at mysql
  • Date: 2010-07-29 11:52:03 UTC
  • Revision ID: jan@mysql.com-20100729115203-wvnlch41l2cs99rw
replicate the behaviour of a real MySQL Server if we would send it 'SELECT x'; 

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
        return 0;
34
34
}
35
35
 
36
 
static int lua_g_get_current_time (lua_State *L) {
37
 
        GTimeVal t;
38
 
 
39
 
        g_get_current_time(&t);
40
 
 
41
 
        lua_newtable(L);
42
 
        lua_pushinteger(L, t.tv_sec);
43
 
        lua_setfield(L, -2, "tv_sec");
44
 
        lua_pushinteger(L, t.tv_usec);
45
 
        lua_setfield(L, -2, "tv_usec");
46
 
 
47
 
        return 1;
48
 
}
49
 
 
50
36
static int lua_g_checksum_md5 (lua_State *L) {
51
37
        size_t str_len;
52
38
        const char *str = luaL_checklstring (L, 1, &str_len);
68
54
*/
69
55
static void set_info (lua_State *L) {
70
56
        lua_pushliteral (L, "_COPYRIGHT");
71
 
        lua_pushliteral (L, "Copyright (c) 2010 Oracle");
 
57
        lua_pushliteral (L, "Copyright (c) 2008 MySQL AB, 2008 Sun Microsystems, Inc.");
72
58
        lua_settable (L, -3);
73
59
        lua_pushliteral (L, "_DESCRIPTION");
74
60
        lua_pushliteral (L, "export glib2-functions as glib.*");
82
68
static const struct luaL_reg gliblib[] = {
83
69
        {"usleep", lua_g_usleep},
84
70
        {"md5", lua_g_checksum_md5},
85
 
        {"get_current_time", lua_g_get_current_time},
86
71
        {NULL, NULL},
87
72
};
88
73