FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
152 stars 63 forks source link

Default parameters in FbRestore [DNET255] #264

Closed firebird-automations closed 14 years ago

firebird-automations commented 14 years ago

Submitted by: Konstantin Dombrugov (abracadabra)

Current source code sets page size = 4096 by default. If "a priori" page size of backup is unknown and if it is not set (right) this could lead to error during restore. For example: "key size for index exceeds limit" can happen because limit for key size depends on page size

Imho, optional parameters such as page size and page buffers should not be passed to Spb if they are not specified.

fix is simple: 1) remove initialization of pageBuffers and pageSize from constructor FbRestore() 2) update setter of PageSize to allow 0 value
3) replace in FbRestore.Execute() this.StartSpb.Append(IscCodes.isc_spb_res_buffers, this.pageBuffers); this.StartSpb.Append(IscCodes.isc_spb_res_page_size, this.pageSize); with if (pageBuffers!=0) this.StartSpb.Append(IscCodes.isc_spb_res_buffers, this.pageBuffers); if (pageSize!=0) this.StartSpb.Append(IscCodes.isc_spb_res_page_size, this.pageSize);

Commits: FirebirdSQL/NETProvider@c979db172e03eeb357a00ab09759a11c02dfcccd

firebird-automations commented 14 years ago
Modified by: @cincuranet issuetype: Task \[ 3 \] =\> Improvement \[ 4 \] Component: Provider \[ 10041 \]
firebird-automations commented 14 years ago

Commented by: @cincuranet

Done with support as nullable types and as well for FbBackup.

firebird-automations commented 14 years ago
Modified by: @cincuranet status: Open \[ 1 \] =\> Resolved \[ 5 \] resolution: Fixed \[ 1 \] Fix Version: 2\.5\.1 \[ 10360 \]