RE: [gnome-db] [PATCH] libgda/gda-connection.c



On Wed, 2005-11-02 at 10:55 +0000, Bob Ham wrote:
> Upon a successful execution, the return code is only set if a non-NULL data
> model is returned:
> 
> 	if (GDA_IS_DATA_MODEL (model))
> 		result = gda_data_model_get_n_rows (model);
> 
> The MySQL provider will never return a data model for non-queries:
> 
> 			if (! g_ascii_strncasecmp (tststr, "SELECT", 6) ||
> 			    ! g_ascii_strncasecmp (tststr, "SHOW", 4) ||
> 			    ! g_ascii_strncasecmp (tststr, "DESCRIBE", 6) ||
> 			    ! g_ascii_strncasecmp (tststr, "EXPLAIN", 7)) {
> 				mysql_res = mysql_store_result (mysql);
> 				recset = gda_mysql_recordset_new (cnc,
> mysql_res,mysql);
> ...
> 			}
> 			else {
> ...
> 				/* don't return a data model */
> 				reclist = g_list_append (reclist, NULL);
> 
> Also, from what I can tell from a quick look at the Oracle provider, it too will
> possibly not return a data model.
> 
> 
> This all means that the return code will never be 0 for successful calls that
> return a NULL data model.  Setting it explicitly is necessary.
> 
ok, could you resend your patch in unified form (cvs diff -up) please?
-- 
Rodrigo Moya <rodrigo gnome-db org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]