Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 692672
Collapse All | Expand All

(-)libgda-5.2.8-orig/providers/mysql/gda-mysql-provider.c (-11 / +11 lines)
Lines 1835-1841 real_prepare (GdaServerProvider *provide Link Here
1835
		return FALSE;
1835
		return FALSE;
1836
	}
1836
	}
1837
1837
1838
	my_bool update_max_length = 1;
1838
	_Bool update_max_length = 1;
1839
	if (mysql_stmt_attr_set (mysql_stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (const void *) &update_max_length)) {
1839
	if (mysql_stmt_attr_set (mysql_stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (const void *) &update_max_length)) {
1840
		_gda_mysql_make_error (cnc, NULL, mysql_stmt, error);
1840
		_gda_mysql_make_error (cnc, NULL, mysql_stmt, error);
1841
		mysql_stmt_close (mysql_stmt);
1841
		mysql_stmt_close (mysql_stmt);
Lines 1941-1947 prepare_stmt_simple (MysqlConnectionData Link Here
1941
		return FALSE;
1941
		return FALSE;
1942
	}
1942
	}
1943
1943
1944
	my_bool update_max_length = 1;
1944
	_Bool update_max_length = 1;
1945
	if (mysql_stmt_attr_set (mysql_stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (const void *) &update_max_length)) {
1945
	if (mysql_stmt_attr_set (mysql_stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (const void *) &update_max_length)) {
1946
		_gda_mysql_make_error (cdata->cnc, NULL, mysql_stmt, error);
1946
		_gda_mysql_make_error (cdata->cnc, NULL, mysql_stmt, error);
1947
		mysql_stmt_close (mysql_stmt);
1947
		mysql_stmt_close (mysql_stmt);
Lines 2327-2333 gda_mysql_provider_statement_execute (Gd Link Here
2327
			if (allow_noparam) {
2327
			if (allow_noparam) {
2328
                                /* bind param to NULL */
2328
                                /* bind param to NULL */
2329
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2329
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2330
				mysql_bind_param[i].is_null = (my_bool*)1;
2330
				mysql_bind_param[i].is_null = (_Bool *) 1;
2331
                                empty_rs = TRUE;
2331
                                empty_rs = TRUE;
2332
                                continue;
2332
                                continue;
2333
			}
2333
			}
Lines 2347-2353 gda_mysql_provider_statement_execute (Gd Link Here
2347
			if (allow_noparam) {
2347
			if (allow_noparam) {
2348
                                /* bind param to NULL */
2348
                                /* bind param to NULL */
2349
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2349
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2350
				mysql_bind_param[i].is_null = (my_bool*)1;
2350
				mysql_bind_param[i].is_null = (_Bool *) 1;
2351
                                empty_rs = TRUE;
2351
                                empty_rs = TRUE;
2352
                                continue;
2352
                                continue;
2353
			}
2353
			}
Lines 2399-2405 gda_mysql_provider_statement_execute (Gd Link Here
2399
			GdaStatement *rstmt;
2399
			GdaStatement *rstmt;
2400
			if (! gda_rewrite_statement_for_null_parameters (stmt, params, &rstmt, error)) {
2400
			if (! gda_rewrite_statement_for_null_parameters (stmt, params, &rstmt, error)) {
2401
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2401
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2402
				mysql_bind_param[i].is_null = (my_bool*)1;
2402
				mysql_bind_param[i].is_null = (_Bool *) 1;
2403
			}
2403
			}
2404
			else if (!rstmt)
2404
			else if (!rstmt)
2405
				return NULL;
2405
				return NULL;
Lines 2459-2465 gda_mysql_provider_statement_execute (Gd Link Here
2459
			ts = (GdaTimestamp*) gda_value_get_timestamp (value);
2459
			ts = (GdaTimestamp*) gda_value_get_timestamp (value);
2460
			if (!ts) {
2460
			if (!ts) {
2461
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2461
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2462
				mysql_bind_param[i].is_null = (my_bool*)1;
2462
				mysql_bind_param[i].is_null = (_Bool *) 1;
2463
			}
2463
			}
2464
			else {
2464
			else {
2465
				_Bool tofree = FALSE;
2465
				_Bool tofree = FALSE;
Lines 2495-2501 gda_mysql_provider_statement_execute (Gd Link Here
2495
			ts = (GdaTime*) gda_value_get_time (value);
2495
			ts = (GdaTime*) gda_value_get_time (value);
2496
			if (!ts) {
2496
			if (!ts) {
2497
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2497
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2498
				mysql_bind_param[i].is_null = (my_bool*)1;
2498
				mysql_bind_param[i].is_null = (_Bool *) 1;
2499
			}
2499
			}
2500
			else {
2500
			else {
2501
				_Bool tofree = FALSE;
2501
				_Bool tofree = FALSE;
Lines 2528-2534 gda_mysql_provider_statement_execute (Gd Link Here
2528
			ts = (GDate*) g_value_get_boxed (value);
2528
			ts = (GDate*) g_value_get_boxed (value);
2529
			if (!ts) {
2529
			if (!ts) {
2530
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2530
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2531
				mysql_bind_param[i].is_null = (my_bool*)1;
2531
				mysql_bind_param[i].is_null = (_Bool *) 1;
2532
			}
2532
			}
2533
			else {
2533
			else {
2534
				MYSQL_TIME *mtime;
2534
				MYSQL_TIME *mtime;
Lines 2548-2554 gda_mysql_provider_statement_execute (Gd Link Here
2548
			str = g_value_get_string (value);
2548
			str = g_value_get_string (value);
2549
			if (!str) {
2549
			if (!str) {
2550
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2550
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2551
				mysql_bind_param[i].is_null = (my_bool*)1;
2551
				mysql_bind_param[i].is_null = (_Bool *) 1;
2552
			}
2552
			}
2553
			else {
2553
			else {
2554
				mysql_bind_param[i].buffer_type= MYSQL_TYPE_STRING;
2554
				mysql_bind_param[i].buffer_type= MYSQL_TYPE_STRING;
Lines 2624-2630 gda_mysql_provider_statement_execute (Gd Link Here
2624
			bin = ((GdaBinary*) blob);
2624
			bin = ((GdaBinary*) blob);
2625
			if (!bin) {
2625
			if (!bin) {
2626
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2626
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2627
				mysql_bind_param[i].is_null = (my_bool*)1;
2627
				mysql_bind_param[i].is_null = (_Bool *) 1;
2628
			}
2628
			}
2629
			else {
2629
			else {
2630
				gchar *str = NULL;
2630
				gchar *str = NULL;
Lines 2665-2671 gda_mysql_provider_statement_execute (Gd Link Here
2665
			bin = gda_value_get_binary (value);
2665
			bin = gda_value_get_binary (value);
2666
			if (!bin) {
2666
			if (!bin) {
2667
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2667
				mysql_bind_param[i].buffer_type = MYSQL_TYPE_NULL;
2668
				mysql_bind_param[i].is_null = (my_bool*)1;
2668
				mysql_bind_param[i].is_null = (_Bool *) 1;
2669
			}
2669
			}
2670
			else {
2670
			else {
2671
				mysql_bind_param[i].buffer_type= MYSQL_TYPE_BLOB;
2671
				mysql_bind_param[i].buffer_type= MYSQL_TYPE_BLOB;
(-)libgda-5.2.8-orig/providers/mysql/gda-mysql-recordset.c (-4 / +4 lines)
Lines 627-633 gda_mysql_recordset_new (GdaConnection Link Here
627
		/* binding results with types */
627
		/* binding results with types */
628
		mysql_bind_result[i].buffer_type = field->type;
628
		mysql_bind_result[i].buffer_type = field->type;
629
		mysql_bind_result[i].is_unsigned = field->flags & UNSIGNED_FLAG ? TRUE : FALSE;
629
		mysql_bind_result[i].is_unsigned = field->flags & UNSIGNED_FLAG ? TRUE : FALSE;
630
		mysql_bind_result[i].is_null = g_malloc0 (sizeof (my_bool));
630
		mysql_bind_result[i].is_null = g_malloc0 (sizeof (_Bool));
631
		
631
		
632
		switch (mysql_bind_result[i].buffer_type) {
632
		switch (mysql_bind_result[i].buffer_type) {
633
		case MYSQL_TYPE_TINY:
633
		case MYSQL_TYPE_TINY:
Lines 753-759 new_row_from_mysql_stmt (GdaMysqlRecords Link Here
753
753
754
		gint col;
754
		gint col;
755
		for (col = 0; col < ((GdaDataSelect *) imodel)->prep_stmt->ncols; ++col) {
755
		for (col = 0; col < ((GdaDataSelect *) imodel)->prep_stmt->ncols; ++col) {
756
			my_bool truncated;
756
			_Bool truncated;
757
			mysql_bind_result[col].error = &truncated;
757
			mysql_bind_result[col].error = &truncated;
758
			mysql_stmt_fetch_column (imodel->priv->mysql_stmt, &(mysql_bind_result[col]),
758
			mysql_stmt_fetch_column (imodel->priv->mysql_stmt, &(mysql_bind_result[col]),
759
						 (unsigned int)col, 0);
759
						 (unsigned int)col, 0);
Lines 784-793 new_row_from_mysql_stmt (GdaMysqlRecords Link Here
784
		
784
		
785
		/*g_print ("%s: #%d : TYPE=%d, GTYPE=%s\n", __func__, i, mysql_bind_result[i].buffer_type, g_type_name (type));*/
785
		/*g_print ("%s: #%d : TYPE=%d, GTYPE=%s\n", __func__, i, mysql_bind_result[i].buffer_type, g_type_name (type));*/
786
786
787
		my_bool is_null = FALSE;
787
		_Bool is_null = FALSE;
788
		unsigned long length;
788
		unsigned long length;
789
		
789
		
790
		memmove (&is_null, mysql_bind_result[i].is_null, sizeof (my_bool));
790
		memmove (&is_null, mysql_bind_result[i].is_null, sizeof (_Bool));
791
		if (is_null) {
791
		if (is_null) {
792
			gda_value_set_null (value);
792
			gda_value_set_null (value);
793
			continue;
793
			continue;

Return to bug 692672