Browse code

db_mysql: improved fix in commit 1736723cc2a15 - it did not worked for mariadb

- improved fix in commit 1736723cc2a15 - it did not worked for mariadb
- Reason is that MariaDB increased its numbering scheme, they are now at 10.x
- MariaDB 10 is still using my_bool type, added few more #ifs to fix this

Henning Westerholt authored on 14/08/2018 17:35:20
Showing 1 changed files
... ...
@@ -29,13 +29,21 @@
29 29
 #include "../../lib/srdb2/db_drv.h"
30 30
 #include "../../lib/srdb2/db_fld.h"
31 31
 #include <mysql.h>
32
+
33
+/* MariaDB exports MYSQL_VERSION_ID as well, but changed numbering */
34
+#if MYSQL_VERSION_ID > 80000 && ! defined MARIADB_BASE_VERSION
32 35
 #include <stdbool.h>
36
+#endif
33 37
 
34 38
 struct my_fld {
35 39
 	db_drv_t gen;
36 40
 
37 41
 	char* name;
42
+#if MYSQL_VERSION_ID > 80000 && ! defined MARIADB_BASE_VERSION
38 43
 	bool is_null;
44
+#else
45
+	my_bool is_null;
46
+#endif
39 47
 	MYSQL_TIME time;
40 48
 	unsigned long length;
41 49
 	str buf;
Browse code

db_mysql: replaced my_bool with bool

- mysql 8.0.1 removed my_bool and suggests use of bool:
* https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html
- use stdbool.h, it defines bool in C99, which should be old enough to
be everywhere, otherwise it may require some ifdefs to get it for older
but still alive systems
- reported by GH #1602

Daniel-Constantin Mierla authored on 02/08/2018 22:28:49
Showing 1 changed files
... ...
@@ -29,12 +29,13 @@
29 29
 #include "../../lib/srdb2/db_drv.h"
30 30
 #include "../../lib/srdb2/db_fld.h"
31 31
 #include <mysql.h>
32
+#include <stdbool.h>
32 33
 
33 34
 struct my_fld {
34 35
 	db_drv_t gen;
35 36
 
36 37
 	char* name;
37
-	my_bool is_null;
38
+	bool is_null;
38 39
 	MYSQL_TIME time;
39 40
 	unsigned long length;
40 41
 	str buf;
Browse code

db_mysql: coherent indentation and whitespacing

Daniel-Constantin Mierla authored on 09/11/2017 06:03:02
Showing 1 changed files
... ...
@@ -1,4 +1,4 @@
1
-/* 
1
+/*
2 2
  * Copyright (C) 2001-2003 FhG Fokus
3 3
  * Copyright (C) 2006-2007 iptelorg GmbH
4 4
  *
... ...
@@ -14,8 +14,8 @@
14 14
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 15
  * GNU General Public License for more details.
16 16
  *
17
- * You should have received a copy of the GNU General Public License 
18
- * along with this program; if not, write to the Free Software 
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20 20
  */
21 21
 
Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,47 @@
1
+/* 
2
+ * Copyright (C) 2001-2003 FhG Fokus
3
+ * Copyright (C) 2006-2007 iptelorg GmbH
4
+ *
5
+ * This file is part of Kamailio, a free SIP server.
6
+ *
7
+ * Kamailio is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * (at your option) any later version
11
+ *
12
+ * Kamailio is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License 
18
+ * along with this program; if not, write to the Free Software 
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20
+ */
21
+
22
+#ifndef _MY_FLD_H
23
+#define _MY_FLD_H  1
24
+
25
+/** @addtogroup mysql
26
+ *  @{
27
+ */
28
+
29
+#include "../../lib/srdb2/db_drv.h"
30
+#include "../../lib/srdb2/db_fld.h"
31
+#include <mysql.h>
32
+
33
+struct my_fld {
34
+	db_drv_t gen;
35
+
36
+	char* name;
37
+	my_bool is_null;
38
+	MYSQL_TIME time;
39
+	unsigned long length;
40
+	str buf;
41
+};
42
+
43
+int my_fld(db_fld_t* fld, char* table);
44
+
45
+/** @} */
46
+
47
+#endif /* _MY_FLD_H */