Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

Christine Bao

Hi all,

 

Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch for fixing ticket http://trac.osgeo.org/fdo/ticket/907.

 

Thanks & regards,

Christine

 


_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Reply | Threaded
Open this post in threaded view
|

Re: Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

Romica Dascalescu

+1

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Christine Bao
Sent: Monday, May 11, 2015 6:00 AM
To: [hidden email]
Subject: [fdo-internals] Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

 

Hi all,

 

Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch for fixing ticket http://trac.osgeo.org/fdo/ticket/907.

 

Thanks & regards,

Christine

 


_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Reply | Threaded
Open this post in threaded view
|

Re: Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

Greg Boone

Regarding….

if (m_nTotalProps == 0)

{

    m_nTotalProps = sqlite3_column_count(m_pStmt);

}

 

Why is the m_nTotalProps check for 0 needed? Why not directly call sqlite3_column_count(m_pStmt) ?  m_pStmt has just been reset in the statement above.

 

m_pStmt = m_connection->GetCachedParsedStatement(m_sql.Data());

 

Greg

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Romica Dascalescu
Sent: Monday, May 11, 2015 11:28 AM
To: FDO Internals Mail List
Subject: Re: [fdo-internals] Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

 

+1

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Christine Bao
Sent: Monday, May 11, 2015 6:00 AM
To: [hidden email]
Subject: [fdo-internals] Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

 

Hi all,

 

Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch for fixing ticket http://trac.osgeo.org/fdo/ticket/907.

 

Thanks & regards,

Christine

 


_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Reply | Threaded
Open this post in threaded view
|

Re: Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

Christine Bao

Hi Greg,

 

The function context is below. Check if (m_nTotalProps == 0) because m_nTotalProps can be setup above.

 

SltReader::SltReader(SltConnection* connection, FdoIdentifierCollection* props, FdoParameterValueCollectionparmValues, const char* fcname, const char* sql)

: m_refCount(1),

m_pStmt(0),

m_class(NULL),

m_sprops(NULL),

m_closeOpcode(-1),

m_curfid(0),

m_nMaxProps(0),

m_nTotalProps(0),

m_eGeomFormat(eFGF),

m_wkbBuffer(NULL),

m_wkbBufferLen(0),

m_closeDB(ReaderCloseType_None),

m_useFastStepping(false),

m_ri(NULL),

m_aPropNames(NULL),

m_filter(NULL),

m_fromwhere(),

m_isViewSelect(false),

m_canAddSelectProps(false)

{

       m_connection = FDO_SAFE_ADDREF(connection);

    m_parmValues  = FDO_SAFE_ADDREF(parmValues);

   

    SltMetadata* md = m_connection->GetMetadata(fcname);

    if (!md)

        throw FdoCommandException::Create(L"Requested feature class does not exist in the database.");

 

       if (props && props->GetCount())

       {

        FdoPtr<FdoClassDefinition> clsDef = md->ToClass();

        SltExpressionTranslator exTrans(props, clsDef);

              int nProps = props->GetCount();

        m_reissueProps.Reserve(nProps);

              for (int i=0; i<nProps; i++)

              {

                     FdoPtr<FdoIdentifier> id = props->GetItem(i);

            exTrans.Reset();

            id->Process(&exTrans);

            StringBuffer* exp = exTrans.GetExpression();

            m_reissueProps.Add(exp->Data(), exp->Length());

        }

        m_nTotalProps = nProps;

       }

    //remember the geometry encoding format

    m_eGeomFormat = md->GetGeomFormat();

 

    m_mainClassName = fcname;

    m_sql.Append(sql);

    m_pStmt = m_connection->GetCachedParsedStatement(m_sql.Data());

    InitPropIndex(m_pStmt);

       if (m_nTotalProps == 0)

       {

              m_nTotalProps = sqlite3_column_count(m_pStmt);

       }

}

 

Thanks & regards,

Christine

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Greg Boone
Sent: Tuesday, May 12, 2015 6:50 AM
To: FDO Internals Mail List
Subject: Re: [fdo-internals] Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

 

Regarding….

 

if (m_nTotalProps == 0)

{

    m_nTotalProps = sqlite3_column_count(m_pStmt);

}

 

Why is the m_nTotalProps check for 0 needed? Why not directly call sqlite3_column_count(m_pStmt) ?  m_pStmt has just been reset in the statement above.

 

m_pStmt = m_connection->GetCachedParsedStatement(m_sql.Data());

 

Greg

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Romica Dascalescu
Sent: Monday, May 11, 2015 11:28 AM
To: FDO Internals Mail List
Subject: Re: [fdo-internals] Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

 

+1

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Christine Bao
Sent: Monday, May 11, 2015 6:00 AM
To: [hidden email]
Subject: [fdo-internals] Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

 

Hi all,

 

Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch for fixing ticket http://trac.osgeo.org/fdo/ticket/907.

 

Thanks & regards,

Christine

 


_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Reply | Threaded
Open this post in threaded view
|

Re: Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

Greg Boone

+1

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Christine Bao
Sent: Monday, May 11, 2015 11:31 PM
To: FDO Internals Mail List
Subject: Re: [fdo-internals] Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

 

Hi Greg,

 

The function context is below. Check if (m_nTotalProps == 0) because m_nTotalProps can be setup above.

 

SltReader::SltReader(SltConnection* connection, FdoIdentifierCollection* props, FdoParameterValueCollectionparmValues, const char* fcname, const char* sql)

: m_refCount(1),

m_pStmt(0),

m_class(NULL),

m_sprops(NULL),

m_closeOpcode(-1),

m_curfid(0),

m_nMaxProps(0),

m_nTotalProps(0),

m_eGeomFormat(eFGF),

m_wkbBuffer(NULL),

m_wkbBufferLen(0),

m_closeDB(ReaderCloseType_None),

m_useFastStepping(false),

m_ri(NULL),

m_aPropNames(NULL),

m_filter(NULL),

m_fromwhere(),

m_isViewSelect(false),

m_canAddSelectProps(false)

{

       m_connection = FDO_SAFE_ADDREF(connection);

    m_parmValues  = FDO_SAFE_ADDREF(parmValues);

   

    SltMetadata* md = m_connection->GetMetadata(fcname);

    if (!md)

        throw FdoCommandException::Create(L"Requested feature class does not exist in the database.");

 

       if (props && props->GetCount())

       {

        FdoPtr<FdoClassDefinition> clsDef = md->ToClass();

        SltExpressionTranslator exTrans(props, clsDef);

              int nProps = props->GetCount();

        m_reissueProps.Reserve(nProps);

              for (int i=0; i<nProps; i++)

              {

                     FdoPtr<FdoIdentifier> id = props->GetItem(i);

            exTrans.Reset();

            id->Process(&exTrans);

            StringBuffer* exp = exTrans.GetExpression();

            m_reissueProps.Add(exp->Data(), exp->Length());

        }

        m_nTotalProps = nProps;

       }

    //remember the geometry encoding format

    m_eGeomFormat = md->GetGeomFormat();

 

    m_mainClassName = fcname;

    m_sql.Append(sql);

    m_pStmt = m_connection->GetCachedParsedStatement(m_sql.Data());

    InitPropIndex(m_pStmt);

       if (m_nTotalProps == 0)

       {

              m_nTotalProps = sqlite3_column_count(m_pStmt);

       }

}

 

Thanks & regards,

Christine

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Greg Boone
Sent: Tuesday, May 12, 2015 6:50 AM
To: FDO Internals Mail List
Subject: Re: [fdo-internals] Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

 

Regarding….

 

if (m_nTotalProps == 0)

{

    m_nTotalProps = sqlite3_column_count(m_pStmt);

}

 

Why is the m_nTotalProps check for 0 needed? Why not directly call sqlite3_column_count(m_pStmt) ?  m_pStmt has just been reset in the statement above.

 

m_pStmt = m_connection->GetCachedParsedStatement(m_sql.Data());

 

Greg

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Romica Dascalescu
Sent: Monday, May 11, 2015 11:28 AM
To: FDO Internals Mail List
Subject: Re: [fdo-internals] Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

 

+1

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Christine Bao
Sent: Monday, May 11, 2015 6:00 AM
To: [hidden email]
Subject: [fdo-internals] Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch

 

Hi all,

 

Please review http://trac.osgeo.org/fdo/attachment/ticket/907/Fix907.patch for fixing ticket http://trac.osgeo.org/fdo/ticket/907.

 

Thanks & regards,

Christine

 


_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals